LevelS C++ support library
3.50
|
#include <rangeset.h>
Public Member Functions | |
void | clear () |
void | reserve (tsize n) |
tsize | nranges () const |
const rtype & | data () const |
const T & | ivbegin (tdiff i) const |
const T & | ivend (tdiff i) const |
T | ivlen (tdiff i) const |
void | append (const T &v1, const T &v2) |
void | append (const T &v) |
void | append (const rangeset &other) |
void | add (const T &v1, const T &v2) |
void | add (const T &v) |
void | remove (const T &v1, const T &v2) |
void | remove (const T &v) |
void | intersect (const T &a, const T &b) |
T | nval () const |
void | toVector (std::vector< T > &res) const |
std::vector< T > | toVector () const |
rangeset | op_or (const rangeset &other) const |
rangeset | op_and (const rangeset &other) const |
rangeset | op_andnot (const rangeset &other) const |
rangeset | op_xor (const rangeset &other) const |
tdiff | findInterval (const T &v) const |
bool | operator== (const rangeset &other) const |
bool | contains (T a, T b) const |
bool | contains (T v) const |
bool | contains (const rangeset &other) const |
bool | overlaps (T a, T b) const |
bool | overlaps (const rangeset &other) const |
Class for storing sets of ranges of integer numbers
Definition at line 44 of file rangeset.h.
|
inline |
Removes all rangeset entries.
Definition at line 223 of file rangeset.h.
Reserves space for n ranges.
Definition at line 225 of file rangeset.h.
Returns the current number of ranges.
Definition at line 227 of file rangeset.h.
|
inline |
Returns the current vector of ranges.
Definition at line 231 of file rangeset.h.
Returns the first value of range i.
Definition at line 245 of file rangeset.h.
Returns the one-past-last value of range i.
Definition at line 247 of file rangeset.h.
Returns the length of range i.
Definition at line 249 of file rangeset.h.
|
inline |
Appends [v1;v2[ to the rangeset. v1 must be larger than the minimum of the last range in the rangeset.
Definition at line 253 of file rangeset.h.
|
inline |
Appends [v;v+1[ to the rangeset. v must be larger than the minimum of the last range in the rangeset.
Definition at line 266 of file rangeset.h.
Appends other to the rangeset. All values in other must be larger than the minimum of the last range in the rangeset.
Definition at line 271 of file rangeset.h.
|
inline |
After this operation, the rangeset contains the union of itself with [v1;v2[.
Definition at line 279 of file rangeset.h.
|
inline |
After this operation, the rangeset contains the union of itself with [v;v+1[.
Definition at line 287 of file rangeset.h.
|
inline |
Removes all values within [v1;v2[ from the rangeset.
Definition at line 290 of file rangeset.h.
|
inline |
Removes the value v from the rangeset.
Definition at line 299 of file rangeset.h.
|
inline |
Removes all values not within [a;b[ from the rangeset.
Definition at line 302 of file rangeset.h.
|
inline |
Returns the total number of elements in the rangeset.
Definition at line 322 of file rangeset.h.
|
inline |
After this operation, res contains all elements of the rangeset in ascending order.
Definition at line 332 of file rangeset.h.
|
inline |
Returns a vector containing all elements of the rangeset in ascending order.
Definition at line 343 of file rangeset.h.
Returns the union of this rangeset and other.
Definition at line 351 of file rangeset.h.
Returns the intersection of this rangeset and other.
Definition at line 358 of file rangeset.h.
Returns the part of this rangeset which is not in other.
Definition at line 365 of file rangeset.h.
Returns the parts of this rangeset and other, which are not in both rangesets.
Definition at line 373 of file rangeset.h.
Returns the index of the interval containing v; if no such interval exists, -1 is returned.
Definition at line 382 of file rangeset.h.
Returns true if the rangeset is identical to other, else false.
Definition at line 390 of file rangeset.h.
|
inline |
Returns true if the rangeset contains all values in the range [a;b[, else false.
Definition at line 395 of file rangeset.h.
|
inline |
Returns true if the rangeset contains the value v, else false.
Definition at line 403 of file rangeset.h.
Returns true if the rangeset contains all values stored in other, else false.
Definition at line 407 of file rangeset.h.
|
inline |
Returns true if any of the numbers [a;b[ are contained in the set, else false.
Definition at line 411 of file rangeset.h.
Returns true if there is overlap between the set and "other", else false.
Definition at line 420 of file rangeset.h.