34 for(
int i = 0; i <
size(); i++)
43 for(
int n = 0; n <
size(); n++)
52 assert(n >= 0 &&
size() + n <=
max());
54 for(
int j = 0; j < n; j++)
62 assert(n <= m && m <
size() && n >= 0);
66 int newnum =
num - cpy;
67 cpy = (
size() - m >= cpy) ? cpy :
size() - m;
128#ifdef ENABLE_CONSISTENCY_CHECKS
131 if(
len > 0 &&
idx ==
nullptr)
134 for(i = 0; i <
size(); ++i)
139 for(j = 0; j < i; j++)
bool freeArray
true iff idx should be freed inside of this object
bool isConsistent() const
consistency check.
int pos(int i) const
returns the position of index i.
void remove(int n, int m)
removes indices at position numbers n through m.
int max() const
returns the maximal number of indices which can be stored in IdxSet.
int num
number of used indices
IdxSet()
default constructor.
int index(int n) const
access n 'th index.
int dim() const
returns the maximal index.
int * idx
array of indices
void add(int n)
appends n uninitialized indices.
int size() const
returns the number of used indices.
IdxSet & operator=(const IdxSet &set)
assignment operator.
int len
length of array idx
Everything should be within this namespace.
void spx_free(T &p)
Release memory.
void spx_alloc(T &p, int n=1)
Allocate memory.
#define SPX_MSG_INCONSISTENT(name)