65 char* tmp = &(
mem[idx]);
77 for(
int i = 0; i < p_set.
num(); ++i)
88 for(
int i = 0; i < p_set.
num(); ++i)
93 add(p_key[i], p_set[i]);
104 assert(hkey !=
nullptr);
120 for(
int i = 0; i < n; ++i)
126 for(
int i = 0; i < n; ++i)
132 for(
int i = 0; i <
set.
num(); i++)
166 for(
int i =
num() - 1; i >= 0; --i)
172 char* newmem =
nullptr;
180 for(i = 0; i <
num(); i++)
182 const char* t = &
mem[
set[i]];
185 newlast += strlen(t) + 1;
188 memcpy(
mem, newmem, newlast);
195 for(i = 0; i <
num(); i++)
202 unsigned int res = 37;
203 const char* sptr = str->
name;
208 res += (
unsigned int)(*sptr++);
235#ifdef ENABLE_CONSISTENCY_CHECKS
242 for(i = 0; i <
num(); i++)
244 const char* t = &
mem[
set[i]];
249 if(strcmp(t,
operator[](
key(t))))
261 for(
int i = 0; i < nset.
num(); i++)
265 << nset.
key(i).
idx <<
"= "
Entry identifier class for items of a DataSet.
int info
user information to store values -1, 0, +1
int idx
(locally) unique key index
void remove(int removenum)
removes the removenum 'th element.
bool isConsistent() const
consistency check.
DATA * create(DataKey &newkey)
creates new data element in DataSet.
int max() const
returns maximum number of elements that would fit into DataSet.
ptrdiff_t reMax(int newmax=0)
resets max() to newmax.
int num() const
returns number of elements currently in DataSet.
void clear()
remove all elements.
Handles of names in a NameSet.
static const char deflt
default zero string.
const char * name
pointer to the name string.
size_t memSize() const
returns used length of string memory.
size_t memmax
size of string memory
size_t memMax() const
returns maximum length of string memory.
DataHashTable< Name, DataKey > hashtab
hashtable for names
bool isConsistent() const
consistency check.
void memRemax(size_t newmax=0)
resets memMax() to newmax.
size_t memused
size of used string memory
bool has(int pnum) const
does NameSet has a name with number pnum?
DataSet< size_t > set
name set
Real factor
memory extension factor for entries.
NameSet(int max=10000, size_t mmax=0, Real fac=2, Real memFac=2)
default constructor.
int max() const
returns maximum nr. of names that fit into NameSet.
void remove(const DataKey &key)
removes name with DataKey key from NameSet.
int num() const
returns nr. of names in NameSet.
void reMax(int newmax=0)
resets max() to newmax.
void clear()
removes all names from NameSet.
void memPack()
garbage collection.
Real memFactor
memory extension factor for names.
void add(const char *str)
int size() const
returns maximum DataKey::idx used in NameSet.
DataKey key(int pnum) const
returns DataKey of the pnum 'th name in NameSet.
#define SOPLEX_HASHTABLE_FILLFACTOR
Everything should be within this namespace.
int spxSnprintf(char *t, size_t len, const char *s,...)
safe version of snprintf
void spx_realloc(T &p, size_t n)
Change amount of allocated memory.
void spx_free(T &p)
Release memory.
std::ostream & operator<<(std::ostream &s, const VectorBase< R > &vec)
Output operator.
static int NameSetNameHashFunction(const NameSet::Name *str)
returns the hash value of the name.
void spx_alloc(T &p, size_t n=1)
Allocate memory.
Memory allocation routines.
Debugging, floating point type and parameter definitions.
#define SPX_MSG_INCONSISTENT(name)