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...
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 328 of file dataarray.h.
~DataArray | ( | ) |
destructor
Definition at line 344 of file dataarray.h.
void append | ( | const T & | t | ) |
append element t
.
Definition at line 121 of file dataarray.h.
Referenced by SoPlex::_transformEquality(), SoPlex::_transformFeasibility(), SoPlex::_transformUnbounded(), SoPlex::addColRational(), SoPlex::addColReal(), SoPlex::addColsRational(), SoPlex::addColsReal(), SoPlex::addRowRational(), SoPlex::addRowReal(), SoPlex::addRowsRational(), SoPlex::addRowsReal(), SPxDevexPR::buildBestPriceVectorEnterCoDim(), SPxSteepPR::buildBestPriceVectorEnterCoDim(), SPxDevexPR::buildBestPriceVectorEnterDim(), SPxSteepPR::buildBestPriceVectorEnterDim(), SPxDevexPR::buildBestPriceVectorLeave(), SPxSteepPR::buildBestPriceVectorLeave(), SPxMainSM::operator=(), and SPxMainSM::SPxMainSM().
void append | ( | int | n, |
const T & | t | ||
) |
append n
elements with value t
.
Definition at line 126 of file dataarray.h.
void append | ( | int | n, |
const T | t[] | ||
) |
append n
elements from t
.
Definition at line 131 of file dataarray.h.
void append | ( | const DataArray< T > & | t | ) |
append all elements from t
.
Definition at line 136 of file dataarray.h.
void clear | ( | ) |
remove all elements.
Definition at line 205 of file dataarray.h.
Referenced by SPxDevexPR::buildBestPriceVectorEnterCoDim(), SPxSteepPR::buildBestPriceVectorEnterCoDim(), SPxDevexPR::buildBestPriceVectorEnterDim(), SPxSteepPR::buildBestPriceVectorEnterDim(), SPxDevexPR::buildBestPriceVectorLeave(), SPxSteepPR::buildBestPriceVectorLeave(), SPxSolver::clear(), SoPlexLegacy::clearBasis(), SoPlex::clearLPRational(), SoPlex::clearLPReal(), and SPxMainSM::operator=().
const T* get_const_ptr | ( | ) | const |
get a const C pointer to the data.
Definition at line 115 of file dataarray.h.
Referenced by SPxDevexPR::buildBestPriceVectorEnterCoDim(), SPxSteepPR::buildBestPriceVectorEnterCoDim(), SPxDevexPR::buildBestPriceVectorEnterDim(), SPxSteepPR::buildBestPriceVectorEnterDim(), SPxDevexPR::buildBestPriceVectorLeave(), SPxSteepPR::buildBestPriceVectorLeave(), SPxBasis::Desc::colStatus(), SPxBasis::Desc::coStatus(), soplex::initPrefs(), SPxBasis::Desc::rowStatus(), SPxSteepPR::selectEnterDenseCoDim(), SPxSteepPR::selectEnterDenseDim(), SPxSteepPR::selectEnterHyperCoDim(), SPxSteepPR::selectEnterHyperDim(), SPxSteepPR::selectEnterSparseCoDim(), SPxSteepPR::selectEnterSparseDim(), SPxSteepPR::selectLeaveHyper(), SPxSteepPR::selectLeaveSparse(), SPxSteepPR::selectLeaveX(), and SPxBasis::Desc::status().
T* get_ptr | ( | ) |
get a C pointer to the data.
Definition at line 110 of file dataarray.h.
Referenced by SoPlex::_factorizeColumnRational(), SoPlex::_solveRealForRational(), SPxLPBase< Real >::added2Set(), SPxDevexPR::buildBestPriceVectorEnterCoDim(), SPxSteepPR::buildBestPriceVectorEnterCoDim(), SPxDevexPR::buildBestPriceVectorEnterDim(), SPxSteepPR::buildBestPriceVectorEnterDim(), SPxDevexPR::buildBestPriceVectorLeave(), SPxSteepPR::buildBestPriceVectorLeave(), DataSet< soplex::SVSetBase::DLPSV >::remove(), LPColSetBase< Real >::remove(), LPRowSetBase< Real >::remove(), SVSetBase< Real >::remove(), SPxLPBase< Real >::removeColRange(), SoPlex::removeColRangeRational(), SoPlex::removeColRangeReal(), SPxLPBase< Real >::removeCols(), SoPlex::removeColsRational(), SoPlex::removeColsReal(), SPxLPBase< Real >::removeRowRange(), SoPlex::removeRowRangeRational(), SoPlex::removeRowRangeReal(), SPxLPBase< Real >::removeRows(), SoPlex::removeRowsRational(), and SoPlex::removeRowsReal().
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 142 of file dataarray.h.
Referenced by DataArray< const soplex::SVectorBase * >::append(), and DataArray< const soplex::SVectorBase * >::insert().
void insert | ( | int | i, |
int | n, | ||
const T & | t | ||
) |
insert n
elements with value t
before i
'the element.
Definition at line 157 of file dataarray.h.
void insert | ( | int | i, |
int | n, | ||
const T | t[] | ||
) |
insert n
elements from t
before i
'the element.
Definition at line 168 of file dataarray.h.
void insert | ( | int | i, |
const DataArray< T > & | t | ||
) |
insert all elements from t
before i
'th element.
Definition at line 178 of file dataarray.h.
bool isConsistent | ( | ) | const |
consistency check
Definition at line 288 of file dataarray.h.
Referenced by DataArray< const soplex::SVectorBase * >::DataArray(), SPxScaler::isConsistent(), SPxWeightST::isConsistent(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::isConsistent(), SPxBasis::Desc::isConsistent(), and DataArray< const soplex::SVectorBase * >::operator=().
T& last | ( | ) |
reference last element.
Definition at line 97 of file dataarray.h.
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 239 of file dataarray.h.
Referenced by DataArray< const soplex::SVectorBase * >::DataArray().
assignment operator
Definition at line 275 of file dataarray.h.
T& operator[] | ( | int | n | ) |
reference n
'th element.
Definition at line 82 of file dataarray.h.
const T& operator[] | ( | int | n | ) | const |
reference n
'th const element.
Definition at line 89 of file dataarray.h.
void 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 254 of file dataarray.h.
Referenced by SPxDevexPR::init(), DataArray< const soplex::SVectorBase * >::reSize(), and SPxSteepPR::setType().
void remove | ( | int | n = 0 , |
int | m = 1 |
||
) |
remove m
elements starting at n
.
Definition at line 188 of file dataarray.h.
void removeLast | ( | int | m = 1 | ) |
remove m
last elements.
Definition at line 199 of file dataarray.h.
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 223 of file dataarray.h.
Referenced by SoPlex::_recomputeRangeTypesRational(), SoPlex::_recomputeRangeTypesReal(), SoPlex::_solveRealForRational(), SoPlex::_untransformEquality(), SoPlex::_untransformFeasibility(), SoPlex::_untransformUnbounded(), SPxSteepPR::addedCoVecs(), SPxSteepPR::addedVecs(), SPxLPBase< Real >::doAddCols(), SPxLPBase< Real >::doAddRows(), SPxWeightST::generate(), SPxSolver::init(), DataArray< const soplex::SVectorBase * >::insert(), SPxSteepPR::load(), DataArray< const soplex::SVectorBase * >::operator=(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::reMax(), SoPlex::removeColRational(), SoPlex::removeColReal(), SoPlex::removeColsRational(), SoPlex::removeColsReal(), SoPlex::removeRowRational(), SoPlex::removeRowReal(), SoPlex::removeRowsRational(), SoPlex::removeRowsReal(), SPxBasis::Desc::reSize(), SoPlexLegacy::setBasis(), SPxSteepPR::setType(), SPxScaler::setup(), SPxMainSM::simplify(), SPxMainSM::SPxMainSM(), and SPxMainSM::unsimplify().
int size | ( | ) | const |
return nr. of elements.
Definition at line 211 of file dataarray.h.
Referenced by SoPlex::_factorizeColumnRational(), SoPlex::_solveRealForRational(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::add(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::autoHashSize(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::autoHashSizeold(), SPxDevexPR::buildBestPriceVectorEnterCoDim(), SPxSteepPR::buildBestPriceVectorEnterCoDim(), SPxDevexPR::buildBestPriceVectorEnterDim(), SPxSteepPR::buildBestPriceVectorEnterDim(), SPxDevexPR::buildBestPriceVectorLeave(), SPxSteepPR::buildBestPriceVectorLeave(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::clear(), SPxBasis::Desc::coDim(), SPxBasis::Desc::dim(), SPxWeightST::generate(), SPxMainSM::getBasis(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::index(), soplex::initPrefs(), DataArray< const soplex::SVectorBase * >::insert(), SPxSolver::isBasisValid(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::isConsistent(), SPxScaler::maxAbsColscale(), SPxScaler::maxAbsRowscale(), SPxScaler::minAbsColscale(), SPxScaler::minAbsRowscale(), SPxBasis::Desc::nCols(), SPxBasis::Desc::nRows(), soplex::operator<<(), DataArray< const soplex::SVectorBase * >::operator=(), SPxMainSM::operator=(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::reMax(), DataArray< const soplex::SVectorBase * >::remove(), DataArray< const soplex::SVectorBase * >::removeLast(), SPxBasis::Desc::reSize(), SPxSteepPR::setupPrefsX(), SPxVectorST::setupWeights(), SPxMainSM::simplify(), SPxScaler::unscaleDual(), SPxScaler::unscalePrimal(), SPxScaler::unscaleRedCost(), SPxScaler::unscaleSlacks(), SPxMainSM::unsimplify(), and SPxMainSM::~SPxMainSM().
|
private |
the array of elements
Definition at line 68 of file dataarray.h.
Referenced by DataArray< const soplex::SVectorBase * >::DataArray(), DataArray< const soplex::SVectorBase * >::get_const_ptr(), DataArray< const soplex::SVectorBase * >::get_ptr(), DataArray< const soplex::SVectorBase * >::insert(), and DataArray< const soplex::SVectorBase * >::operator=().
|
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.
|
private |
the length of array data and
Definition at line 67 of file dataarray.h.
Referenced by DataArray< const soplex::SVectorBase * >::max().
|
private |
number of used elements in array data
Definition at line 66 of file dataarray.h.
Referenced by DataArray< const soplex::SVectorBase * >::insert(), and DataArray< const soplex::SVectorBase * >::size().