34 #include "../my_config.h"
44 range() { parts.clear(); };
45 range(
const infinint & low,
const infinint & high) { parts.push_back(segment(low, high)); };
48 range operator + (
const range & ref)
const { range ret = *
this; ret += ref;
return ret; };
49 std::string display()
const;
57 void reset_read()
const;
65 bool read_next_segment(infinint & low, infinint & high)
const;
71 segment(
const infinint & x_low,
const infinint & x_high) { low = x_low; high = x_high; };
73 const infinint & get_low()
const {
return low; };
74 const infinint & get_high()
const {
return high; };
76 bool overlaps_with(
const segment & ref)
const {
return !(ref < *this) && !(ref > *
this); };
77 void merge_with(
const segment & ref);
80 bool operator < (
const segment & ref)
const {
return high + 1 < ref.low; };
81 bool operator > (
const segment & ref)
const {
return ref < *
this; };
82 bool operator == (
const segment & ref)
const {
return ref.high == high && ref.low == low; };
83 bool operator != (
const segment & ref)
const {
return ! (*
this == ref); };
86 bool operator <= (
const segment & ref)
const {
return ref.low < low && low <= ref.high + 1 && ref.high < high; };
87 bool operator >= (
const segment &ref)
const {
return ref <= *
this; };
88 bool contains(
const segment & ref)
const {
return low <= ref.low && ref.high <= high; };
90 std::string display()
const;
96 std::list<segment> parts;
97 std::list<segment>::const_iterator read_cursor;
switch module to limitint (32 ou 64 bits integers) or infinint
manages the decimal representation of infinint