Loading...
Searching...
No Matches
DataArray< T > Class Template Reference Safe arrays of data objects. More...
Detailed Descriptiontemplate<class T> class soplex::DataArray< T > Safe arrays of data objects. Class DataArray provides safe arrays of Data Objects. For general C++ objects (in contrast to data objects) class Array is provided which manages memory in a C++ compliant way. The elements of an instance of DataArray can be accessed just like ordinary C++ array elements by means of the index operator[](). Safety is provided by
Moreover, DataArrays may easily be extended by inserting or appending elements to the DataArray or shrunken by removing elements. Method reSize(int n) resets the DataArrays length to A DataArray may be used as arguments for standard C functions requiring pointers through the use of get_ptr() and get_const_ptr(). Internally, a DataArray object allocates a block of memory that fits up to max() elements, only size() of them are used. This makes extension and shrinking methods perform better.
Definition at line 74 of file dataarray.h. Constructor & Destructor Documentation◆ DataArray() [1/2]copy constructor Definition at line 328 of file dataarray.h. References DataArray< T >::data, DataArray< T >::isConsistent(), DataArray< T >::max(), soplex::spx_alloc(), and DataArray< T >::thesize. ◆ DataArray() [2/2]default constructor. The constructor allocates an Array containing
Definition at line 353 of file dataarray.h. References DataArray< T >::data, DataArray< T >::isConsistent(), soplex::spx_alloc(), DataArray< T >::themax, and DataArray< T >::thesize. ◆ ~DataArray()
template<class T >
destructor Definition at line 370 of file dataarray.h. References DataArray< T >::data, and soplex::spx_free(). Member Function Documentation◆ append() [1/4]
template<class T >
append all elements from Definition at line 149 of file dataarray.h. References DataArray< T >::insert(), and DataArray< T >::thesize. ◆ append() [2/4]
template<class T >
append element Definition at line 134 of file dataarray.h. References DataArray< T >::insert(), and DataArray< T >::thesize. ◆ append() [3/4]
template<class T >
append Definition at line 139 of file dataarray.h. References DataArray< T >::insert(), and DataArray< T >::thesize. ◆ append() [4/4]
template<class T >
append Definition at line 144 of file dataarray.h. References DataArray< T >::insert(), and DataArray< T >::thesize. ◆ clear()
template<class T >
remove all elements. Definition at line 221 of file dataarray.h. References DataArray< T >::thesize. Referenced by LPColSetBase< R >::clear(), and LPRowSetBase< R >::clear(). ◆ get_const_ptr()
template<class T >
get a const C pointer to the data. Definition at line 128 of file dataarray.h. References DataArray< T >::data. Referenced by SPxBasisBase< R >::Desc::colStatus(), SPxBasisBase< R >::Desc::coStatus(), SPxBasisBase< R >::Desc::rowStatus(), and SPxBasisBase< R >::Desc::status(). ◆ get_ptr()
template<class T >
get a C pointer to the data. Definition at line 123 of file dataarray.h. References DataArray< T >::data. Referenced by SPxLPBase< R >::added2Set(), ClassSet< T >::remove(), ClassSet< T >::remove(), DataSet< DATA >::remove(), DataSet< DATA >::remove(), LPColSetBase< R >::remove(), LPRowSetBase< R >::remove(), SVSetBase< R >::remove(), SVSetBase< R >::remove(), SPxLPBase< R >::removeColRange(), SPxLPBase< R >::removeCols(), SPxLPBase< R >::removeCols(), SPxLPBase< R >::removeRowRange(), SPxLPBase< R >::removeRows(), and SPxLPBase< R >::removeRows(). ◆ insert() [1/4]
template<class T >
insert all elements from Definition at line 192 of file dataarray.h. References DataArray< T >::data, DataArray< T >::insert(), and DataArray< T >::size(). ◆ insert() [2/4]
template<class T >
insert move Definition at line 155 of file dataarray.h. References DataArray< T >::data, DataArray< T >::reSize(), and DataArray< T >::thesize. Referenced by DataArray< T >::append(), DataArray< T >::append(), DataArray< T >::append(), DataArray< T >::append(), DataArray< T >::insert(), DataArray< T >::insert(), and DataArray< T >::insert(). ◆ insert() [3/4]
template<class T >
insert Definition at line 170 of file dataarray.h. References DataArray< T >::data, and DataArray< T >::insert(). ◆ insert() [4/4]
template<class T >
insert Definition at line 182 of file dataarray.h. References DataArray< T >::data, and DataArray< T >::insert(). ◆ isConsistent()
template<class T >
consistency check Definition at line 311 of file dataarray.h. References DataArray< T >::data, DataArray< T >::memFactor, SPX_MSG_INCONSISTENT, DataArray< T >::themax, and DataArray< T >::thesize. Referenced by DataArray< T >::DataArray(), DataArray< T >::DataArray(), and DataArray< T >::operator=(). ◆ last() [1/2]
template<class T >
reference last element. Definition at line 110 of file dataarray.h. References DataArray< T >::data, and DataArray< T >::thesize. ◆ last() [2/2]
template<class T >
reference last const element. Definition at line 116 of file dataarray.h. References DataArray< T >::data, and DataArray< T >::thesize. ◆ max()
template<class T >
return maximum number of elements. Even though the DataArray currently holds no more than size() elements, up to max() elements could be added without need to reallocated free store. Definition at line 256 of file dataarray.h. References DataArray< T >::themax. Referenced by DataArray< T >::DataArray(). ◆ operator=()assignment operator Definition at line 297 of file dataarray.h. References DataArray< T >::data, DataArray< T >::isConsistent(), DataArray< T >::reSize(), and DataArray< T >::size(). ◆ operator[]() [1/2]
template<class T >
reference Definition at line 95 of file dataarray.h. References DataArray< T >::data, and DataArray< T >::thesize. ◆ operator[]() [2/2]
template<class T >
reference Definition at line 102 of file dataarray.h. References DataArray< T >::data, and DataArray< T >::thesize. ◆ reMax()
template<class T >
reset maximum number of elements. The value of max() is reset to Definition at line 271 of file dataarray.h. References DataArray< T >::data, soplex::spx_alloc(), soplex::spx_free(), soplex::spx_realloc(), DataArray< T >::themax, and DataArray< T >::thesize. Referenced by DataArray< T >::reSize(). ◆ remove()
template<class T >
remove Definition at line 202 of file dataarray.h. References DataArray< T >::data, DataArray< T >::size(), and DataArray< T >::thesize. ◆ removeLast()
template<class T >
remove Definition at line 215 of file dataarray.h. References DataArray< T >::size(), and DataArray< T >::thesize. ◆ reSize()
template<class T >
reset size to Resizing a DataArray to less than the previous size, involves discarding its last elements. Resizing to a larger value involves adding uninitialized elements (similar to append()). If neccessary, also memory will be reallocated.
Definition at line 239 of file dataarray.h. References DataArray< T >::memFactor, DataArray< T >::reMax(), DataArray< T >::themax, and DataArray< T >::thesize. Referenced by LPColSetBase< R >::add(), LPColSetBase< R >::add(), LPRowSetBase< R >::add(), LPRowSetBase< R >::add(), LPColSetBase< R >::create(), LPRowSetBase< R >::create(), SPxLPBase< R >::doAddCols(), SPxLPBase< R >::doAddRows(), DataArray< T >::insert(), DataArray< T >::operator=(), LPColSetBase< R >::reMax(), LPRowSetBase< R >::reMax(), LPColSetBase< R >::remove(), LPColSetBase< R >::remove(), LPColSetBase< R >::remove(), LPRowSetBase< R >::remove(), LPRowSetBase< R >::remove(), and LPRowSetBase< R >::remove(). ◆ size()
template<class T >
return nr. of elements. Definition at line 227 of file dataarray.h. References DataArray< T >::thesize. Referenced by SPxLPBase< R >::addCols(), SPxLPBase< R >::addRows(), SPxBasisBase< R >::Desc::coDim(), SPxBasisBase< R >::Desc::dim(), SPxLPBase< R >::doAddCols(), SPxLPBase< R >::doAddRows(), DataArray< T >::insert(), SPxBasisBase< R >::Desc::nCols(), SPxBasisBase< R >::Desc::nRows(), DataArray< T >::operator=(), DataArray< T >::remove(), and DataArray< T >::removeLast(). Member Data Documentation◆ data
template<class T >
the array of elements Definition at line 81 of file dataarray.h. Referenced by DataArray< T >::DataArray(), DataArray< T >::DataArray(), DataArray< T >::get_const_ptr(), DataArray< T >::get_ptr(), DataArray< T >::insert(), DataArray< T >::insert(), DataArray< T >::insert(), DataArray< T >::insert(), DataArray< T >::isConsistent(), DataArray< T >::last(), DataArray< T >::last(), DataArray< T >::operator=(), DataArray< T >::operator[](), DataArray< T >::operator[](), DataArray< T >::reMax(), DataArray< T >::remove(), and DataArray< T >::~DataArray(). ◆ memFactor
template<class T >
memory extension factor. When a DataArray is reSize()d to more than max() elements, the new value for max() is not just set to the new size but rather to Definition at line 90 of file dataarray.h. Referenced by DataArray< T >::isConsistent(), and DataArray< T >::reSize(). ◆ themax
template<class T >
the length of array data and Definition at line 80 of file dataarray.h. Referenced by DataArray< T >::DataArray(), DataArray< T >::isConsistent(), DataArray< T >::max(), DataArray< T >::reMax(), and DataArray< T >::reSize(). ◆ thesize
template<class T >
number of used elements in array data Definition at line 79 of file dataarray.h. Referenced by DataArray< T >::append(), DataArray< T >::append(), DataArray< T >::append(), DataArray< T >::append(), DataArray< T >::clear(), DataArray< T >::DataArray(), DataArray< T >::DataArray(), DataArray< T >::insert(), DataArray< T >::isConsistent(), DataArray< T >::last(), DataArray< T >::last(), DataArray< T >::operator[](), DataArray< T >::operator[](), DataArray< T >::reMax(), DataArray< T >::remove(), DataArray< T >::removeLast(), DataArray< T >::reSize(), and DataArray< T >::size().
|