7 #ifndef SEQUENCE_INTERVAL_HPP_ 8 #define SEQUENCE_INTERVAL_HPP_ 11 #include "boost/functional/hash/hash_fwd.hpp" 12 #include "boost/numeric/interval.hpp" 13 #include "boost/numeric/interval/checking.hpp" 15 namespace vdj_pipe{
namespace detail{
22 typedef int value_type;
23 static value_type pos_inf() {
return std::numeric_limits<value_type>::max();}
24 static value_type neg_inf() {
return 0;}
25 static value_type nan() {
return std::numeric_limits<value_type>::min();}
26 static bool is_nan(
const value_type v) {
return v == nan();}
27 static value_type empty_lower() {
return 0;}
28 static value_type empty_upper() {
return 0;}
29 static bool is_empty(
const value_type lo,
const value_type up) {
return lo == up;}
34 typedef boost::numeric::interval<
36 boost::numeric::interval_lib::policies<
37 boost::numeric::interval_lib::rounded_math<int>,
44 inline sequence_interval sequence_interval_invalid() {
53 return sequence_interval(-1, -1);
58 namespace boost{
namespace numeric {
62 inline bool is_valid( vdj_pipe::sequence_interval
const& si) {
63 return si.upper() >= 0;
68 inline std::size_t hash_value(vdj_pipe::sequence_interval
const& si) {
70 boost::hash_combine(n, si.lower());
71 boost::hash_combine(n, si.upper());
77 template<
class ChT,
class Tr>
inline 78 std::basic_ostream<ChT,Tr>& operator<<(
79 std::basic_ostream<ChT,Tr>& os,
80 vdj_pipe::sequence_interval
const& si
82 os <<
'[' << si.lower() <<
',' << si.upper() <<
']';
Definition: sequence_interval.hpp:58
Definition: sequence_interval.hpp:21
Main namespace of vdj_pipe library.
Definition: sequence_file.hpp:14
Definition: sequence_interval.hpp:19