LevelS C++ support library
3.50
|
#include <crangeset.h>
Public Member Functions | |
tdiff | iiv (const T &val) const |
void | clear () |
void | append (const T &v1, const T &v2) |
void | append (const T &v) |
void | append (const crangeset &other) |
T | nval () const |
bool | operator== (const crangeset &other) const |
bool | contains (T a, T b) const |
bool | contains (T v) const |
bool | contains (const crangeset &other) const |
bool | overlaps (T a, T b) const |
bool | overlaps (const crangeset &other) const |
Static Public Member Functions | |
static int | strategy (tsize sza, tsize szb) |
Class for storing sets of ranges of integer numbers T must be a signed integer type, but all numbers entered into the range set must be nonnegative!
Definition at line 76 of file crangeset.h.
Returns the index of the last number in r
whose absolute value is <= val If val is smaller than all absolute values in r
, returns -1.
Definition at line 212 of file crangeset.h.
Estimate a good strategy for set operations involving two rangesets.
Definition at line 219 of file crangeset.h.
|
inline |
Removes all rangeset entries.
Definition at line 378 of file crangeset.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 396 of file crangeset.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 432 of file crangeset.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 437 of file crangeset.h.
|
inline |
Returns the total number of elements in the rangeset.
Definition at line 447 of file crangeset.h.
Returns true if the rangeset is identical to other, else false.
Definition at line 467 of file crangeset.h.
|
inline |
Returns true if the rangeset contains all values in the range [a;b[, else false.
Definition at line 472 of file crangeset.h.
|
inline |
Returns true if the rangeset contains the value v, else false.
Definition at line 489 of file crangeset.h.
Returns true if the rangeset contains all values stored in other, else false.
Definition at line 505 of file crangeset.h.
|
inline |
Returns true if any of the numbers [a;b[ are contained in the set, else false.
Definition at line 510 of file crangeset.h.
Returns true if there is overlap between the set and "other", else false.
Definition at line 530 of file crangeset.h.