158 for(
int i = 0;
i <
n; ++
i)
168 for(
int i = 0;
i <
n; ++
i)
177 for(
int i = 0;
i < set.num(); ++
i)
186 for(
int i = 0;
i < set.num(); ++
i)
276 int k,
j, first = -1;
296 for(
k = first,
j =
num();
k <
j; ++
k)
315 for(
int i =
num() - 1;
i >= 0; --
i)
334 for(
int i =
num() - 1;
i >= 0; --
i)
432 if(
k.idx < 0 ||
k.idx >=
size())
460 return (
n >= 0 &&
n <
num());
464 bool has(
const T* item)
const
508 for(
i = 0;
i <
max();
i++)
534#ifdef ENABLE_CONSISTENCY_CHECKS
609 for(
i = 0;
i <
old.thenum;
i++)
648 for(
i = 0;
i < rhs.
size(); ++
i)
651 for(
i = 0;
i < rhs.num(); ++
i)
654 if(rhs.firstfree == -rhs.
themax - 1)
661 while(rhs.theitem[ -
i - 1].info != -rhs.
themax - 1)
662 i = rhs.theitem[ -
i - 1].info;
Save arrays of arbitrary types.
Save arrays of data objects.
void remove(const int *nums, int n)
remove n elements with numbers nums.
ClassSet(const ClassSet &old)
copy constructor.
T * create(DataKey &newkey)
creates new class element in ClassSet.
void remove(int removenum)
removes the removenum 'th element.
bool has(int n) const
Is n a valid number of an element in ClassSet?
ClassSet(int pmax=8)
default constructor.
void remove(const DataKey &removekey)
removes element with key removekey.
void remove(const DataKey *keys, int n)
remove n elements given by keys.
bool isConsistent() const
consistency check.
struct soplex::ClassSet::Item * theitem
array of elements in the ClassSet
int themax
length of arrays theitem and thekey
void add(const ClassSet< T > &set)
adds all elements of set.
void add(DataKey newkey[], const ClassSet< T > &set)
adds several new items.
void add(DataKey &newkey, const T &item)
adds an element.
int number(const T *item) const
returns the number of element item in ClassSet, throws exception if it doesn't exist.
void remove(int perm[])
remove multiple elements.
T & operator[](const DataKey &k)
int firstfree
first unused element in theitem
const T & operator[](const DataKey &k) const
returns element with DataKey k.
int number(const DataKey &k) const
returns the number of the element with DataKey k in ClassSet or -1, if it doesn't exist.
void add(DataKey newkey[], const T *item, int n)
add several items.
int max() const
returns maximum number of elements that would fit into ClassSet.
DataKey key(const T *item) const
returns DataKey of element item in ClassSet.
ptrdiff_t reMax(int newmax=0)
resets max() to newmax.
T * create()
creates new (uninitialized) class element in ClassSet.
void add(const T &item)
adds element item.
int num() const
returns number of elements currently in ClassSet.
int thesize
highest used element in theitem
bool has(const T *item) const
Does item belong to ClassSet?
bool has(const DataKey &k) const
Is k a valid DataKey of an element in ClassSet?
DataKey * thekey
DataKey::idx's of elements.
void add(const T *items, int n)
adds n elements from items.
void clear()
remove all elements.
const T & operator[](int n) const
returns element number n.
DataKey key(int n) const
returns DataKey of n 'th element in ClassSet.
void remove(const DataKey *keys, int n, int *perm)
remove n elements given by keys and perm.
int thenum
number of elements in ClassSet
ClassSet< T > & operator=(const ClassSet< T > &rhs)
assignment operator.
int size() const
returns the maximum DataKey::idx currently in ClassSet.
void remove(const int *nums, int n, int *perm)
remove n elements given by nums and perm.
Safe arrays of data objects.
T * get_ptr()
get a C pointer to the data.
int themax
the length of array data and
int thesize
number of used elements in array data
T * data
the array of elements
int size() const
return nr. of elements.
Entry identifier class for items of a DataSet.
int idx
(locally) unique key index
Exception class for out of memory exceptions.
Save arrays of data objects.
Entry identifier class for items of a DataSet.
Exception classes for SoPlex.
Everything should be within this namespace.
void spx_realloc(T &p, int n)
Change amount of allocated memory.
void spx_free(T &p)
Release memory.
void spx_alloc(T &p, int n=1)
Allocate memory.
Memory allocation routines.
#define MSGinconsistent(name)
int info
element number. info [0,thesize-1] iff element is used