Loading...
Searching...
No Matches
NameSet Class Reference Set of strings. More...
Detailed DescriptionSet of strings. Class NameSet implements a symbol or name table. It allows to store or remove names (i.e., Names in a NameSet may be accessed via numbers from 0 through num()-1 and via DataKeys. See DataSet for a description of these concepts. At a time a NameSet can hold a maximum of max() entries. This can be reset with method reMax(). If more than max() names are added to a NameSet, it adjusts itself automatically to the required size. This implies, that references to names within a NameSet may become invalid if the NameSet is expanded. All names (i.e., the actual char strings) in a NameSet are stored in one continuous memory block of size memMax(). At one time memSize() bytes of it are used for actually saving names; the remaining memory is free to hold additional names. memRemax() can be used to reset memMax() but not lower than to memSize(). Method memPack() performs a garbage collection to gain free memory resulting from removed names. Constructor & Destructor Documentation◆ NameSet() [1/2]default constructor.
Definition at line 216 of file nameset.cpp. References DataSet< DATA >::max(), NameSet::mem, NameSet::memmax, NameSet::memused, soplex::NameSetNameHashFunction(), NameSet::set, and soplex::spx_alloc(). ◆ ~NameSet()
destructor. Definition at line 228 of file nameset.cpp. References NameSet::mem, and soplex::spx_free(). ◆ NameSet() [2/2]Member Function Documentation◆ add() [1/4]
Definition at line 34 of file nameset.cpp. References NameSet::add(). Referenced by NameSet::add(), NameSet::add(), and NameSet::add(). ◆ add() [2/4]
Definition at line 75 of file nameset.cpp. References NameSet::add(), NameSet::hashtab, and NameSet::num(). ◆ add() [3/4]
adds name Definition at line 40 of file nameset.cpp. References DataSet< DATA >::create(), NameSet::factor, NameSet::hashtab, NameSet::max(), NameSet::mem, NameSet::memFactor, NameSet::memMax(), NameSet::memPack(), NameSet::memRemax(), NameSet::memSize(), NameSet::memused, NameSet::reMax(), NameSet::set, NameSet::size(), SOPLEX_HASHTABLE_FILLFACTOR, SPX_MAXSTRLEN, and soplex::spxSnprintf(). ◆ add() [4/4]adds all names in Definition at line 86 of file nameset.cpp. References NameSet::add(), NameSet::hashtab, and NameSet::num(). ◆ clear()
removes all names from NameSet. Definition at line 146 of file nameset.cpp. References DataSet< DATA >::clear(), NameSet::hashtab, NameSet::memused, and NameSet::set. ◆ has() [1/3]
◆ has() [2/3]
does NameSet has a name with DataKey Definition at line 262 of file nameset.h. References DataSet< DATA >::has(), and NameSet::set. ◆ has() [3/3]
does NameSet has a name with number Definition at line 249 of file nameset.h. References DataSet< DATA >::has(), and NameSet::set. Referenced by NameSet::isConsistent(), and NameSet::remove(). ◆ isConsistent()
consistency check. Definition at line 233 of file nameset.cpp. References NameSet::has(), NameSet::hashtab, DataSet< DATA >::isConsistent(), NameSet::key(), NameSet::mem, NameSet::memmax, NameSet::memused, NameSet::num(), NameSet::set, and SPX_MSG_INCONSISTENT. Referenced by NameSet::remove(). ◆ key() [1/2]
returns DataKey of name Definition at line 221 of file nameset.h. References NameSet::hashtab. ◆ key() [2/2]
returns DataKey of the Definition at line 215 of file nameset.h. References DataSet< DATA >::key(), and NameSet::set. Referenced by NameSet::isConsistent(), NameSet::memPack(), NameSet::memRemax(), soplex::operator<<(), and NameSet::remove(). ◆ max()
returns maximum nr. of names that fit into NameSet. Definition at line 191 of file nameset.h. References DataSet< DATA >::max(), and NameSet::set. Referenced by NameSet::add(). ◆ memMax()
returns maximum length of string memory. Definition at line 203 of file nameset.h. References NameSet::memmax. Referenced by NameSet::add(), and NameSet::memPack(). ◆ memPack()
garbage collection. Definition at line 170 of file nameset.cpp. References NameSet::hashtab, NameSet::key(), NameSet::mem, NameSet::memMax(), NameSet::memSize(), NameSet::memused, NameSet::num(), NameSet::set, soplex::spx_alloc(), soplex::spx_free(), SPX_MAXSTRLEN, and soplex::spxSnprintf(). Referenced by NameSet::add(). ◆ memRemax()
resets memMax() to Definition at line 159 of file nameset.cpp. References NameSet::hashtab, NameSet::key(), NameSet::mem, NameSet::memmax, NameSet::memSize(), NameSet::num(), NameSet::set, and soplex::spx_realloc(). Referenced by NameSet::add(). ◆ memSize()
returns used length of string memory. Definition at line 209 of file nameset.h. References NameSet::memused. Referenced by NameSet::add(), NameSet::memPack(), and NameSet::memRemax(). ◆ num()
returns nr. of names in NameSet. Definition at line 185 of file nameset.h. References DataSet< DATA >::num(), and NameSet::set. Referenced by NameSet::add(), NameSet::add(), NameSet::isConsistent(), NameSet::memPack(), NameSet::memRemax(), and soplex::operator<<(). ◆ number() [1/2]
returns number of name Definition at line 235 of file nameset.h. References NameSet::hashtab, and NameSet::number(). ◆ number() [2/2]
returns number of name with DataKey Definition at line 229 of file nameset.h. References DataSet< DATA >::number(), and NameSet::set. Referenced by NameSet::number(). ◆ operator=()◆ operator[]() [1/2]
returns name for DataKey Definition at line 179 of file nameset.h. References NameSet::mem, and NameSet::set. ◆ operator[]() [2/2]
returns Definition at line 173 of file nameset.h. References NameSet::mem, and NameSet::set. ◆ reMax()
resets max() to Definition at line 153 of file nameset.cpp. References NameSet::hashtab, DataSet< DATA >::reMax(), and NameSet::set. Referenced by NameSet::add(). ◆ remove() [1/6]
removes name Definition at line 97 of file nameset.cpp. References NameSet::hashtab, DataSet< DATA >::remove(), and NameSet::set. ◆ remove() [2/6]
removes name with DataKey Definition at line 110 of file nameset.cpp. References NameSet::has(), NameSet::hashtab, NameSet::mem, DataSet< DATA >::remove(), and NameSet::set. Referenced by NameSet::remove(), NameSet::remove(), and NameSet::remove(). ◆ remove() [3/6]
removes Definition at line 118 of file nameset.cpp. References NameSet::remove(). ◆ remove() [4/6]
removes Definition at line 124 of file nameset.cpp. References NameSet::remove(). ◆ remove() [5/6]
remove all entries where Definition at line 130 of file nameset.cpp. References NameSet::hashtab, NameSet::isConsistent(), NameSet::mem, DataSet< DATA >::num(), DataSet< DATA >::remove(), and NameSet::set. ◆ remove() [6/6]
removes Definition at line 290 of file nameset.h. References NameSet::key(), and NameSet::remove(). ◆ size()
returns maximum DataKey::idx used in NameSet. Definition at line 197 of file nameset.h. References NameSet::set, and DataSet< DATA >::size(). Referenced by NameSet::add(). Member Data Documentation◆ factor
memory extension factor for entries. When more than max() names are added to a NameSet, it is automatically resized to fit the additional names. Parameter Definition at line 335 of file nameset.h. Referenced by NameSet::add(). ◆ hashtab
hashtable for names Every name in a NameSet is assigned a DataKey by which it can be accessed (see NameSet::operator[]()). See DataKey for a more detailed description of the concept of Keys. Definition at line 164 of file nameset.h. Referenced by NameSet::add(), NameSet::add(), NameSet::add(), NameSet::clear(), NameSet::has(), NameSet::isConsistent(), NameSet::key(), NameSet::memPack(), NameSet::memRemax(), NameSet::number(), NameSet::reMax(), NameSet::remove(), NameSet::remove(), and NameSet::remove(). ◆ mem
string memory Definition at line 157 of file nameset.h. Referenced by NameSet::add(), NameSet::isConsistent(), NameSet::memPack(), NameSet::memRemax(), NameSet::NameSet(), NameSet::operator[](), NameSet::operator[](), NameSet::remove(), NameSet::remove(), and NameSet::~NameSet(). ◆ memFactor
memory extension factor for names. When the names added to a NameSet do no longer fit into the name memory (i.e. the memory for saving the strings), it is automatically resized to fit the additional names. Parameter Definition at line 343 of file nameset.h. Referenced by NameSet::add(). ◆ memmax
size of string memory Definition at line 158 of file nameset.h. Referenced by NameSet::isConsistent(), NameSet::memMax(), NameSet::memRemax(), and NameSet::NameSet(). ◆ memused
size of used string memory Definition at line 159 of file nameset.h. Referenced by NameSet::add(), NameSet::clear(), NameSet::isConsistent(), NameSet::memPack(), NameSet::memSize(), and NameSet::NameSet(). ◆ set
name set. Definition at line 156 of file nameset.h. Referenced by NameSet::add(), NameSet::clear(), NameSet::has(), NameSet::has(), NameSet::isConsistent(), NameSet::key(), NameSet::max(), NameSet::memPack(), NameSet::memRemax(), NameSet::NameSet(), NameSet::num(), NameSet::number(), NameSet::operator[](), NameSet::operator[](), NameSet::reMax(), NameSet::remove(), NameSet::remove(), NameSet::remove(), and NameSet::size().
|