All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DataArray< T > Class Template Reference 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. More...
Inheritance diagram for DataArray< T >:
![]()
Detailed Descriptiontemplate<class T>
|
p_size | number of unitialised elements. |
p_max | maximum number of elements the array can hold. |
p_fac | value for memFactor. |
Definition at line 315 of file dataarray.h.
~DataArray | ( | ) |
destructor
Definition at line 331 of file dataarray.h.
void append | ( | const T & | t | ) |
append element t
.
Definition at line 121 of file dataarray.h.
void append | ( | int | n, |
const T | t[] | ||
) |
append n
elements from t
.
Definition at line 126 of file dataarray.h.
void append | ( | const DataArray< T > & | t | ) |
append all elements from t
.
Definition at line 131 of file dataarray.h.
void clear | ( | ) |
remove all elements.
Definition at line 189 of file dataarray.h.
const T* get_const_ptr | ( | ) | const |
get a const C pointer to the data.
Definition at line 115 of file dataarray.h.
Referenced by SPxBasis::Desc::colStatus(), SPxBasis::Desc::coStatus(), soplex::initPrefs(), SPxBasis::Desc::rowStatus(), SPxSteepPR::selectEnterDenseCoDim(), SPxSteepPR::selectEnterDenseDim(), SPxSteepPR::selectEnterSparseCoDim(), SPxSteepPR::selectEnterSparseDim(), SPxSteepPR::selectLeave(), SPxSteepPR::selectLeavePart(), SPxSteepPR::selectLeaveSparse(), and SPxBasis::Desc::status().
T* get_ptr | ( | ) |
get a C pointer to the data.
Definition at line 110 of file dataarray.h.
Referenced by SPxLP::added2Set(), SVSet::remove(), DataSet< soplex::SVSet::DLPSV >::remove(), LPColSet::remove(), LPRowSet::remove(), SPxLP::removeColRange(), SPxLP::removeCols(), SPxLP::removeRowRange(), and SPxLP::removeRows().
void insert | ( | int | i, |
int | n | ||
) |
insert n
uninitialized elements before i
'th element.
move n
elements in memory from insert position i
to the back
Definition at line 137 of file dataarray.h.
Referenced by DataArray< Real >::append(), DataArray< Real >::insert(), and SVSet::xtend().
void insert | ( | int | i, |
int | n, | ||
const T | t[] | ||
) |
insert n
elements from t
before i
'the element.
Definition at line 152 of file dataarray.h.
void insert | ( | int | i, |
const DataArray< T > & | t | ||
) |
insert all elements from t
before i
'th element.
Definition at line 162 of file dataarray.h.
bool isConsistent | ( | ) | const |
consistency check
Definition at line 277 of file dataarray.h.
Referenced by DataArray< Real >::DataArray(), SPxScaler::isConsistent(), SPxWeightST::isConsistent(), and DataArray< Real >::operator=().
T& last | ( | ) |
reference last element.
Definition at line 97 of file dataarray.h.
Referenced by SVSet::create(), SVSet::isConsistent(), and SVSet::xtend().
const T& last | ( | ) | const |
reference last const element.
Definition at line 103 of file dataarray.h.
int max | ( | ) | const |
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 223 of file dataarray.h.
Referenced by DataArray< Real >::DataArray().
assignment operator
Definition at line 264 of file dataarray.h.
T& operator[] | ( | int | n | ) |
reference n
'th element.
Definition at line 82 of file dataarray.h.
Referenced by SVSet::deleteVec(), and SVSet::memPack().
const T& operator[] | ( | int | n | ) | const |
reference n
'th const element.
Definition at line 89 of file dataarray.h.
ptrdiff_t reMax | ( | int | newMax = 1 , |
int | newSize = -1 |
||
) |
reset maximum number of elements.
The value of max() is reset to newMax
thereby setting size() to newSize
. However, if newSize
has a value <
0
(as the default argument does) size() remains unchanged and max() is set to MIN(size(), newMax). Hence, calling reMax() without the default arguments, will reduce the memory consumption to a minimum. In no instance max() will be set to a value less than 1 (even if specified).
Definition at line 241 of file dataarray.h.
Referenced by DataArray< Real >::reSize().
void remove | ( | int | n = 0 , |
int | m = 1 |
||
) |
remove m
elements starting at n
.
Definition at line 172 of file dataarray.h.
void removeLast | ( | int | m = 1 | ) |
remove m
last elements.
Definition at line 183 of file dataarray.h.
Referenced by SVSet::create(), and SVSet::deleteVec().
void reSize | ( | int | newsize | ) |
reset size to newsize
.
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.
newsize | the new number of elements the array can hold. |
Definition at line 207 of file dataarray.h.
Referenced by SPxSteepPR::addedCoVecs(), SPxSteepPR::addedVecs(), SVSet::create(), SPxLP::doAddCols(), SPxLP::doAddRows(), SPxWeightST::generate(), DataArray< Real >::insert(), SPxSteepPR::load(), SVSet::memPack(), DataArray< Real >::operator=(), SPxSteepPR::setType(), SPxScaler::setup(), and SPxMainSM::simplify().
int size | ( | ) | const |
return nr. of elements.
Definition at line 195 of file dataarray.h.
Referenced by SVSet::add(), SPxLP::added2Set(), SPxBasis::Desc::coDim(), SVSet::deleteVec(), SPxBasis::Desc::dim(), SPxSolver::enter(), SPxWeightST::generate(), soplex::initPrefs(), DataArray< Real >::insert(), SPxSolver::isBasisValid(), SPxSolver::leave(), SPxScaler::maxAbsColscale(), SPxScaler::maxAbsRowscale(), SVSet::memSize(), SPxScaler::minAbsColscale(), SPxScaler::minAbsRowscale(), SPxBasis::Desc::nCols(), SPxBasis::Desc::nRows(), soplex::operator<<(), DataArray< Real >::operator=(), SVSet::operator=(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::reMax(), DataArray< Real >::remove(), DataArray< Real >::removeLast(), SPxSteepPR::setupPrefsX(), SPxVectorST::setupWeights(), SPxMainSM::simplify(), SPxScaler::unscaleDual(), SPxScaler::unscalePrimal(), SPxScaler::unscaleRedCost(), and SPxScaler::unscaleSlacks().
|
private |
the array of elements
Definition at line 68 of file dataarray.h.
Referenced by DataArray< Real >::DataArray(), DataArray< Real >::get_const_ptr(), DataArray< Real >::get_ptr(), DataArray< Real >::insert(), DataArray< Real >::isConsistent(), DataArray< Real >::last(), DataArray< Real >::operator=(), DataArray< Real >::operator[](), DataArray< Real >::reMax(), DataArray< Real >::remove(), and DataArray< Real >::~DataArray().
|
protected |
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 memFactor
* size
. This makes reSizeing perform better in codes where a DataArray is extended often by a small number of elements only.
Definition at line 77 of file dataarray.h.
Referenced by SVSet::ensureMem(), DataArray< Real >::isConsistent(), DataArray< Real >::reSize(), and SVSet::xtend().
|
private |
the length of array data and
Definition at line 67 of file dataarray.h.
Referenced by DataArray< Real >::DataArray(), DataArray< Real >::isConsistent(), DataArray< Real >::max(), DataArray< Real >::reMax(), and DataArray< Real >::reSize().
|
private |
number of used elements in array data
Definition at line 66 of file dataarray.h.
Referenced by DataArray< Real >::append(), DataArray< Real >::clear(), DataArray< Real >::DataArray(), DataArray< Real >::insert(), DataArray< Real >::isConsistent(), DataArray< Real >::last(), DataArray< Real >::operator[](), DataArray< Real >::reMax(), DataArray< Real >::remove(), DataArray< Real >::removeLast(), DataArray< Real >::reSize(), and DataArray< Real >::size().
© 2003-2013 by Zuse Institute Berlin (ZIB), Imprint | Generated on Wed Jan 9 2013 for SoPlex by doxygen |