Loading...
Searching...
No Matches
DataSet< DATA > Class Template Reference Set of data objects. More...
Detailed Descriptiontemplate<class DATA> class soplex::DataSet< DATA > Set of data objects. Class DataSet manages of sets of data objects of a template type DATA. For constructing a DataSet the maximum number of entries must be given. The current maximum number may be inquired with method max(). Adding more then max() elements to a DataSet will core dump. However, method reMax() allows to reset max() without loss of elements currently in the DataSet. The current number of elements in a DataSet is returned by method num(). Adding elements to a DataSet is done via methods add() or create(), while remove() removes elements from a DataSet. When adding an element to a DataSet the new element is assigned a DataKey. DataKeys serve to access DATA elements in a set via a version of the subscript operator[](DataKey). For convenience all elements in a DataSet are implicitely numbered from 0 through num()-1 and can be accessed with these numbers using a 2nd subscript operator[](int). The reason for providing DataKeys to access elements of a DataSet is that the Key of an element remains unchanged as long as the element is a member of the DataSet, while the numbers will change in an undefined way, if other elements are added to or removed from the DataSet. The elements in a DataSet and their DataKeys are stored in two arrays:
Both arrays have size themax. In thekey only elements 0 thru thenum-1 contain DataKey::idx's of valid elements, i.e., elements currently in the DataSet. The current number of elements in the DataSet is counted in thenum. In theitem only elements 0 thru thesize-1 are used, but only some of them actually contain real data elements of the DataSet. They are recognized by having info >= 0, which gives the number of that element. Otherwise info < 0 indicates an unused element. Unused elements are linked in a single linked list: starting with element
Constructor & Destructor Documentation◆ DataSet() [1/2]
template<class DATA>
default constructor. Definition at line 545 of file dataset.h. References firstfree, isConsistent(), soplex::spx_alloc(), soplex::spx_free(), theitem, thekey, themax, thenum, and thesize. Referenced by DataSet(). ◆ DataSet() [2/2]copy constructor. Definition at line 571 of file dataset.h. References DataSet(), firstfree, isConsistent(), soplex::spx_alloc(), soplex::spx_free(), theitem, thekey, themax, thenum, and thesize. ◆ ~DataSet()
template<class DATA>
destructor. Definition at line 646 of file dataset.h. References soplex::spx_free(), theitem, and thekey. Member Function Documentation◆ add() [1/6]
template<class DATA>
◆ add() [2/6]
template<class DATA>
◆ add() [3/6]
template<class DATA>
◆ add() [4/6]
template<class DATA>
◆ add() [5/6]
template<class DATA>
◆ add() [6/6]◆ clear()
template<class DATA>
◆ create() [1/2]
template<class DATA>
◆ create() [2/2]
template<class DATA>
◆ has() [1/3]
template<class DATA>
◆ has() [2/3]
template<class DATA>
◆ has() [3/3]
template<class DATA>
◆ isConsistent()
template<class DATA>
◆ key() [1/2]
template<class DATA>
◆ key() [2/2]
template<class DATA>
◆ max()
template<class DATA>
◆ num()
template<class DATA>
◆ number() [1/2]
template<class DATA>
◆ number() [2/2]
template<class DATA>
◆ operator=()assignment operator. The assignment operator involves reMax()ing the lvalue DataSet to the size needed for copying all elements of the rvalue. After the assignment all DataKeys from the lvalue are valid for the rvalue as well. They refer to a copy of the corresponding data elements. Definition at line 606 of file dataset.h. References clear(), firstfree, DataSet< DATA >::Item::info, isConsistent(), max(), num(), reMax(), size(), theitem, thekey, themax, thenum, and thesize. ◆ operator[]() [1/4]
template<class DATA>
Definition at line 381 of file dataset.h. References DataKey::idx, theitem, and thesize. ◆ operator[]() [2/4]
template<class DATA>
◆ operator[]() [3/4]
template<class DATA>
◆ operator[]() [4/4]
template<class DATA>
◆ reMax()
template<class DATA>
resets max() to This method will not succeed if Definition at line 493 of file dataset.h. References firstfree, size(), soplex::spx_realloc(), theitem, thekey, and themax. Referenced by operator=(). ◆ remove() [1/7]
template<class DATA>
◆ remove() [2/7]
template<class DATA>
remove Definition at line 325 of file dataset.h. References DataArray< T >::get_ptr(), num(), and remove(). ◆ remove() [3/7]
template<class DATA>
◆ remove() [4/7]
template<class DATA>
remove Definition at line 344 of file dataset.h. References DataArray< T >::get_ptr(), num(), and remove(). ◆ remove() [5/7]
template<class DATA>
◆ remove() [6/7]
template<class DATA>
◆ remove() [7/7]
template<class DATA>
◆ size()
template<class DATA>
returns the maximum DataKey::idx currently in DataSet. Definition at line 410 of file dataset.h. References thesize. Referenced by number(), number(), operator=(), and reMax(). Member Data Documentation◆ firstfree
template<class DATA>
◆ theitem
template<class DATA>
array of elements in the DataSet Referenced by create(), DataSet(), DataSet(), has(), isConsistent(), number(), number(), operator=(), operator[](), operator[](), operator[](), operator[](), reMax(), remove(), remove(), and ~DataSet(). ◆ thekey
template<class DATA>
DataKey::idx's of elements. Definition at line 117 of file dataset.h. Referenced by create(), DataSet(), DataSet(), isConsistent(), key(), key(), operator=(), operator[](), operator[](), reMax(), remove(), remove(), and ~DataSet(). ◆ themax
template<class DATA>
length of arrays theitem and thekey Definition at line 118 of file dataset.h. Referenced by clear(), create(), DataSet(), DataSet(), isConsistent(), max(), operator=(), and reMax(). ◆ thenum
template<class DATA>
number of elements in DataSet Definition at line 120 of file dataset.h. Referenced by clear(), create(), DataSet(), DataSet(), isConsistent(), num(), operator=(), operator[](), operator[](), remove(), and remove(). ◆ thesize
template<class DATA>
highest used element in theitem Definition at line 119 of file dataset.h. Referenced by clear(), create(), DataSet(), DataSet(), isConsistent(), operator=(), operator[](), operator[](), remove(), and size().
|