LevelS C++ support library
3.83
|
#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 225 of file rangeset.h.
Reserves space for n ranges.
Definition at line 227 of file rangeset.h.
Returns the current number of ranges.
Definition at line 229 of file rangeset.h.
|
inline |
Returns the current vector of ranges.
Definition at line 233 of file rangeset.h.
Returns the first value of range i.
Definition at line 247 of file rangeset.h.
Returns the one-past-last value of range i.
Definition at line 249 of file rangeset.h.
Returns the length of range i.
Definition at line 251 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 255 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 268 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 273 of file rangeset.h.
|
inline |
After this operation, the rangeset contains the union of itself with [v1;v2[.
Definition at line 281 of file rangeset.h.
|
inline |
After this operation, the rangeset contains the union of itself with [v;v+1[.
Definition at line 289 of file rangeset.h.
|
inline |
Removes all values within [v1;v2[ from the rangeset.
Definition at line 292 of file rangeset.h.
|
inline |
Removes the value v from the rangeset.
Definition at line 301 of file rangeset.h.
|
inline |
Removes all values not within [a;b[ from the rangeset.
Definition at line 304 of file rangeset.h.
|
inline |
Returns the total number of elements in the rangeset.
Definition at line 324 of file rangeset.h.
|
inline |
After this operation, res contains all elements of the rangeset in ascending order.
Definition at line 334 of file rangeset.h.
|
inline |
Returns a vector containing all elements of the rangeset in ascending order.
Definition at line 345 of file rangeset.h.
Returns the union of this rangeset and other.
Definition at line 353 of file rangeset.h.
Returns the intersection of this rangeset and other.
Definition at line 360 of file rangeset.h.
Returns the part of this rangeset which is not in other.
Definition at line 367 of file rangeset.h.
Returns the parts of this rangeset and other, which are not in both rangesets.
Definition at line 375 of file rangeset.h.
Returns the index of the interval containing v; if no such interval exists, -1 is returned.
Definition at line 384 of file rangeset.h.
Returns true if the rangeset is identical to other, else false.
Definition at line 392 of file rangeset.h.
|
inline |
Returns true if the rangeset contains all values in the range [a;b[, else false.
Definition at line 397 of file rangeset.h.
|
inline |
Returns true if the rangeset contains the value v, else false.
Definition at line 405 of file rangeset.h.
Returns true if the rangeset contains all values stored in other, else false.
Definition at line 409 of file rangeset.h.
|
inline |
Returns true if any of the numbers [a;b[ are contained in the set, else false.
Definition at line 413 of file rangeset.h.
Returns true if there is overlap between the set and "other", else false.
Definition at line 422 of file rangeset.h.