98 static_assert(std::is_trivially_copyable<DATA>::value,
99 "Only trivially copyable types are allowed with DataSet, since it does memcopy");
161 for(
int i = 0;
i <
n; ++
i)
171 for(
int i = 0;
i <
n; ++
i)
180 for(
int i = 0;
i < set.num(); ++
i)
189 for(
int i = 0;
i < set.num(); ++
i)
279 int k,
j, first = -1;
299 for(
k = first,
j =
num();
k <
j; ++
k)
318 for(
int i =
num() - 1;
i >= 0; --
i)
337 for(
int i =
num() - 1;
i >= 0; --
i)
435 if(
k.idx < 0 ||
k.idx >=
size())
463 return (
n >= 0 &&
n <
num());
511 return reinterpret_cast<char*
>(
theitem)
518#ifdef ENABLE_CONSISTENCY_CHECKS
619 for(
i = 0;
i < rhs.
size(); ++
i)
622 for(
i = 0;
i < rhs.num(); ++
i)
625 if(rhs.firstfree == -rhs.
themax - 1)
632 while(rhs.theitem[ -
i - 1].info != -rhs.
themax - 1)
633 i = rhs.theitem[ -
i - 1].info;
Save arrays of arbitrary types.
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
void remove(const int *nums, int n)
remove n elements with numbers nums.
void remove(int removenum)
removes the removenum 'th element.
DATA * create()
creates new (uninitialized) data element in DataSet.
bool has(int n) const
Is n a valid number of an element in DataSet?
DataSet(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.
void add(DataKey newkey[], const DataSet< DATA > &set)
adds several new items.
int number(const DATA *item) const
returns the number of element item in DataSet, throws exception if it doesn't exist.
void add(DataKey &newkey, const DATA &item)
adds an element.
DataSet(const DataSet &old)
copy constructor.
int themax
length of arrays theitem and thekey
void add(const DATA *items, int n)
adds n elements from items.
void add(const DataSet< DATA > &set)
adds all elements of set.
void remove(int perm[])
remove multiple elements.
int firstfree
first unused element in theitem
DATA * create(DataKey &newkey)
creates new data element in DataSet.
int number(const DataKey &k) const
returns the number of the element with DataKey k in DataSet or -1, if it doesn't exist.
const DATA & operator[](int n) const
returns element number n.
int max() const
returns maximum number of elements that would fit into DataSet.
void add(const DATA &item)
adds element item.
ptrdiff_t reMax(int newmax=0)
resets max() to newmax.
struct soplex::DataSet::Item * theitem
array of elements in the DataSet
int num() const
returns number of elements currently in DataSet.
DATA & operator[](const DataKey &k)
int thesize
highest used element in theitem
bool has(const DataKey &k) const
Is k a valid DataKey of an element in DataSet?
DataKey * thekey
DataKey::idx's of elements.
bool has(const DATA *item) const
Does item belong to DataSet?
void add(DataKey newkey[], const DATA *item, int n)
add several items.
void clear()
remove all elements.
DataSet< DATA > & operator=(const DataSet< DATA > &rhs)
assignment operator.
DataKey key(int n) const
returns DataKey of n 'th element in DataSet.
const DATA & operator[](const DataKey &k) const
returns element with DataKey k.
void remove(const DataKey *keys, int n, int *perm)
remove n elements given by keys and perm.
DataKey key(const DATA *item) const
returns DataKey of element item in DataSet.
int thenum
number of elements in DataSet
int size() const
returns the maximum DataKey::idx currently in DataSet.
void remove(const int *nums, int n, int *perm)
remove n elements given by nums and perm.
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