Sparse vector set. More...
#include <svsetbase.h>
Classes | |
class | DLPSV |
SVectorBase with prev/next pointers. More... | |
Public Member Functions | |
Extension | |
void | add (const SVectorBase< R > &svec) |
Adds svec to the set. More... | |
void | add (DataKey &nkey, const SVectorBase< R > &svec) |
Adds svec to SVSetBase. More... | |
template<class S > | |
void | add (DataKey &nkey, const S *rowValues, const int *rowIndices, int rowSize) |
Adds svec to SVSetBase. More... | |
void | add (const SVectorBase< R > svec[], int n) |
Adds all n SVectorBases in the array svec to the set. More... | |
void | add (DataKey nkey[], const SVectorBase< R > svec[], int n) |
Adds n SVectorBases to SVSetBase. More... | |
template<class S > | |
void | add (const SVSetBase< S > &pset) |
Adds all SVectorBases in pset to SVSetBase. More... | |
template<class S > | |
void | add (DataKey nkey[], const SVSetBase< S > &pset) |
Adds all SVectorBases of pset to SVSetBase. More... | |
SVectorBase< R > * | create (int idxmax=0) |
Creates new SVectorBase in set. More... | |
SVectorBase< R > * | create (DataKey &nkey, int idxmax=-1) |
Creates new SVectorBase in set. More... | |
void | xtend (SVectorBase< R > &svec, int newmax) |
Extends svec to fit newmax nonzeros. More... | |
void | add2 (SVectorBase< R > &svec, int idx, R val) |
Adds nonzero (idx , val ) to svec of this SVSetBase. More... | |
void | add2 (SVectorBase< R > &svec, int n, const int idx[], const R val[]) |
Adds n nonzeros to svec of this SVSetBase. More... | |
template<class S > | |
void | add2 (SVectorBase< R > &svec, int n, const int idx[], const S val[]) |
Adds n nonzeros to svec of this SVSetBase. More... | |
Shrinking | |
void | remove (const DataKey &removekey) |
Removes the vector with key removekey from the set. More... | |
void | remove (int removenum) |
Removes the vector with number removenum from the set. More... | |
void | remove (const SVectorBase< R > *svec) |
Removes one SVectorBase from set. More... | |
void | remove (int perm[]) |
Removes multiple elements. More... | |
void | remove (const DataKey keys[], int n) |
Removes n SVectorBases from set. More... | |
void | remove (const int nums[], int n) |
Removes n SVectorBases from set. More... | |
void | remove (const DataKey keys[], int n, int *perm) |
void | remove (const int nums[], int n, int *perm) |
void | clear (int minNewSize=-1) |
Removes all SVectorBases from set. More... | |
Access | |
SVectorBase< R > & | operator[] (int n) |
Gets SVectorBase by number, writeable. More... | |
const SVectorBase< R > & | operator[] (int n) const |
Gets SVectorBase by number. More... | |
SVectorBase< R > & | operator[] (const DataKey &k) |
Gets SVectorBase by DataKey, writeable. More... | |
const SVectorBase< R > & | operator[] (const DataKey &k) const |
Gets SVectorBase by DataKey. More... | |
Inquiry | |
int | num () const |
Current number of SVectorBases. More... | |
int | max () const |
Current maximum number of SVectorBases. More... | |
DataKey | key (int n) const |
Gets DataKey of vector number. More... | |
DataKey | key (const SVectorBase< R > *svec) const |
Gets DataKey of SVectorBase. More... | |
int | number (const DataKey &k) const |
Gets vector number of DataKey. More... | |
int | number (const SVectorBase< R > *svec) const |
Gets vector number of SVectorBase. More... | |
bool | has (const DataKey &k) const |
True iff SVSetBase contains a SVectorBase for DataKey k . More... | |
bool | has (int n) const |
True iff SVSetBase contains a SVectorBase for vector number n. More... | |
bool | has (const SVectorBase< R > *svec) const |
Is an SVectorBase in the set? More... | |
Memory Management | |
int | memSize () const |
Used nonzero memory. More... | |
int | memMax () const |
Length of nonzero memory. More... | |
void | memRemax (int newmax) |
Reset length of nonzero memory. More... | |
void | memPack () |
Garbage collection in nonzero memory. More... | |
Miscellaneous | |
void | reMax (int newmax=0) |
Resets maximum number of SVectorBases. More... | |
bool | isConsistent () const |
Consistency check. More... | |
Constructors / destructors | |
SVSetBase (int pmax=-1, int pmemmax=-1, double pfac=1.1, double pmemFac=1.2) | |
Default constructor. More... | |
virtual | ~SVSetBase () |
Destructor. More... | |
SVSetBase< R > & | operator= (const SVSetBase< R > &rhs) |
Assignment operator. More... | |
template<class S > | |
SVSetBase< R > & | operator= (const SVSetBase< S > &rhs) |
Assignment operator. More... | |
SVSetBase (const SVSetBase< R > &old) | |
Copy constructor. More... | |
template<class S > | |
SVSetBase (const SVSetBase< S > &old) | |
Copy constructor. More... | |
Private Types | |
typedef ClassArray< Nonzero< R > > | SVSetBaseArray |
Private Member Functions | |
Helpers | |
void | countUnusedMem () |
count size of unused memory exactly More... | |
void | updateUnusedMemEstimation (int change) |
update estimation of unused memory More... | |
void | ensurePSVec (int n) |
Provides enough vector memory for n more SVectorBases. More... | |
void | ensureMem (int n, bool shortenLast=true) |
Provides enough nonzero memory for n more Nonzeros. More... | |
void | deleteVec (DLPSV *ps) |
Deleting a vector from the data array and the list. More... | |
Private Attributes | |
Data | |
ClassSet< DLPSV > | set |
set of SVectorBases More... | |
IdList< DLPSV > | list |
doubly linked list for non-zero management More... | |
int | unusedMem |
an estimate of the unused memory (the difference of max() and size() summed up over all vectors) due to deleteVec() and xtend() More... | |
int | numUnusedMemUpdates |
counter for how often unusedMem has been updated since last exact value More... | |
Control Parameters | |
double | factor |
sparse vector memory enlargment factor More... | |
Friends | |
template<class S > | |
class | SVSetBase |
Additional Inherited Members | |
Protected Member Functions inherited from ClassArray< Nonzero< R > > | |
Nonzero< R > & | operator[] (int n) |
Reference to n 'th element. More... | |
const Nonzero< R > & | operator[] (int n) const |
Reference to n 'th const element. More... | |
Nonzero< R > & | last () |
Reference to last element. More... | |
const Nonzero< R > & | last () const |
Reference to last const element. More... | |
Nonzero< R > * | get_ptr () |
Gets a C pointer to the data. More... | |
const Nonzero< R > * | get_const_ptr () const |
Gets a const C pointer to the data. More... | |
void | append (const Nonzero< R > &t) |
Appends element t . More... | |
void | append (int n, const Nonzero< R > t[]) |
Appends n elements from t . More... | |
void | append (const ClassArray< Nonzero< R > > &t) |
Appends all elements from t . More... | |
void | insert (int i, int n) |
Inserts n uninitialized elements before i 'th element. More... | |
void | insert (int i, int n, const Nonzero< R > t[]) |
Inserts n elements from t before i 'the element. More... | |
void | insert (int i, const ClassArray< Nonzero< R > > &t) |
Inserts all elements from t before i 'th element. More... | |
void | remove (int n=0, int m=1) |
Removes m elements starting at n . More... | |
void | removeLast (int m=1) |
Removes m last elements. More... | |
void | clear () |
Removes all elements. More... | |
int | size () const |
Returns number of elements. More... | |
void | reSize (int newsize) |
Resets size to newsize . More... | |
int | max () const |
Returns maximum number of elements. More... | |
ptrdiff_t | reMax (int newMax=1, int newSize=-1) |
Resets maximum number of elements. More... | |
ClassArray & | operator= (const ClassArray &rhs) |
Assignment operator. More... | |
bool | isConsistent () const |
Consistency check. More... | |
ClassArray (const ClassArray &old) | |
Copy constructor. More... | |
ClassArray (int p_size=0, int p_max=0, double p_fac=1.2) | |
Default constructor. More... | |
virtual | ~ClassArray () |
Destructor. More... | |
Protected Attributes inherited from ClassArray< Nonzero< R > > | |
int | thesize |
number of used elements in array data More... | |
int | themax |
the length of array data and More... | |
Nonzero< R > * | data |
the array of elements More... | |
double | memFactor |
memory extension factor. More... | |
Sparse vector set.
Class SVSetBase provides a set of sparse vectors SVectorBase. All SVectorBases in an SVSetBase share one big memory block for their nonzeros. This memory is referred to as the nonzero memory. The SVectorBases themselves are saved in another memory block referred to as the vector memory. Both memory blocks will grow automatically if required, when adding more SVectorBases to the set or enlarging SVectorBases within the set. For controlling memory consumption, methods are provided to inquire and reset the size of the memory blocks used for vectors and nonzeros.
SVectorBases in an SVSetBase are numbered from 0 thru num()-1. They can be accessed using the index operator[](). When removing SVectorBases of a SVSetBase the remaining ones will be renumbered. However, all SVectorBase with a smaller number than the lowest number of the removed SVectorBases will remain unchanged.
For providing a uniform access to SVectorBases in a set even if others are removed or added, SVSetBase assigns a DataKey to each SVectorBase in the set. Such a DataKey remains unchanged as long as the corresponding SVectorBase is in the SVSetBase, no matter what other SVectorBases are added to or removed from the SVSetBase. Methods are provided for getting the DataKey to a SVectorBase or its number and vice versa. Further, each add() method for enlarging an SVSetBase is provided with two signatures. One of them returns the DataKeys assigned to the SVectorBases added to the SVSetBase.
Definition at line 72 of file svsetbase.h.
|
private |
Definition at line 78 of file svsetbase.h.
|
explicit |
Default constructor.
Definition at line 1015 of file svsetbase.h.
References SVSetBase< R >::isConsistent().
|
virtual |
Destructor.
Definition at line 1026 of file svsetbase.h.
Copy constructor.
Definition at line 1082 of file svsetbase.h.
References SVSetBase< R >::isConsistent().
Copy constructor.
Definition at line 1095 of file svsetbase.h.
References SVSetBase< R >::isConsistent().
void add | ( | const SVectorBase< R > & | svec | ) |
Adds svec
to the set.
This includes copying its nonzeros to the sets nonzero memory and creating an additional SVectorBase entry in vector memory. If neccessary, the memory blocks are enlarged appropriately.
Definition at line 352 of file svsetbase.h.
References SVSetBase< R >::create(), SVSetBase< R >::ensurePSVec(), and SVectorBase< R >::size().
Referenced by LPColSetBase< R >::add(), LPRowSetBase< R >::add(), SVSetBase< R >::add(), and SVSetBase< R >::operator=().
void add | ( | const SVectorBase< R > | svec[], |
int | n | ||
) |
Adds all n
SVectorBases in the array svec
to the set.
svec
must hold at least n
entries. Definition at line 402 of file svsetbase.h.
References SVSetBase< R >::create(), SVSetBase< R >::ensureMem(), SVSetBase< R >::ensurePSVec(), and ClassArray< Nonzero< R > >::size().
void add | ( | const SVSetBase< S > & | pset | ) |
Adds all SVectorBases in pset
to SVSetBase.
Definition at line 436 of file svsetbase.h.
References SVSetBase< R >::create(), SVSetBase< R >::ensureMem(), SVSetBase< R >::ensurePSVec(), SVSetBase< R >::num(), and ClassArray< Nonzero< R > >::size().
void add | ( | DataKey & | nkey, |
const S * | rowValues, | ||
const int * | rowIndices, | ||
int | rowSize | ||
) |
Adds svec
to SVSetBase.
Adds SVectorBase svec
to the set. This includes copying its nonzeros to the sets nonzero memory and creating an additional SVectorBase entry in vector memory. If neccessary, the memory blocks are enlarged appropriately.
At return, nkey
contains the DataKey, that the SVSetBase has assosicated to the new SVectorBase.
Definition at line 385 of file svsetbase.h.
References SVectorBase< R >::assignArray(), SVSetBase< R >::create(), and SVSetBase< R >::ensurePSVec().
void add | ( | DataKey & | nkey, |
const SVectorBase< R > & | svec | ||
) |
Adds svec
to SVSetBase.
Adds SVectorBase svec
to the set. This includes copying its nonzeros to the sets nonzero memory and creating an additional SVectorBase entry in vector memory. If neccessary, the memory blocks are enlarged appropriately.
At return, nkey
contains the DataKey, that the SVSetBase has assosicated to the new SVectorBase.
Definition at line 368 of file svsetbase.h.
References SVSetBase< R >::create(), SVSetBase< R >::ensurePSVec(), and SVectorBase< R >::size().
void add | ( | DataKey | nkey[], |
const SVectorBase< R > | svec[], | ||
int | n | ||
) |
Adds n SVectorBases to SVSetBase.
Adds all n
SVectorBases in the array svec
to the set.
At return, nkey contains the DataKeys, that the SVSetBase has assosicated to the new SVectorBases.
nkey
must be large enough to fit n
DataKeys. Definition at line 426 of file svsetbase.h.
References SVSetBase< R >::add(), SVSetBase< R >::key(), and SVSetBase< R >::num().
Adds all SVectorBases of pset
to SVSetBase.
Adds all n
SVectorBases in the pset
to an SVSetBase.
At return, nkey
contains the DataKeys, that the SVSetBase has assosicated to the new SVectorBases.
nkey
must be large enough to fit pset.num()
DataKeys. Definition at line 462 of file svsetbase.h.
References SVSetBase< R >::add(), SVSetBase< R >::key(), and SVSetBase< R >::num().
void add2 | ( | SVectorBase< R > & | svec, |
int | idx, | ||
R | val | ||
) |
Adds nonzero (idx
, val
) to svec
of this SVSetBase.
Adds one nonzero (idx
, val
) to SVectorBase svec
in the SVSetBase. If svec
is not large enough to hold the additional nonzero, it will be automatically enlarged within the set.
svec
must be an SVectorBase of the SVSetBase. Definition at line 605 of file svsetbase.h.
References SVectorBase< R >::add(), SVectorBase< R >::size(), and SVSetBase< R >::xtend().
Referenced by LPColSetBase< R >::add2(), and LPRowSetBase< R >::add2().
void add2 | ( | SVectorBase< R > & | svec, |
int | n, | ||
const int | idx[], | ||
const R | val[] | ||
) |
Adds n
nonzeros to svec
of this SVSetBase.
Adds n
nonzeros to SVectorBase svec
in the SVSetBase. If svec
is not large enough to hold the additional nonzeros, it will be automatically enlarged within the set.
svec
must be an SVectorBase of the SVSetBase. Definition at line 617 of file svsetbase.h.
References SVectorBase< R >::add(), SVectorBase< R >::size(), and SVSetBase< R >::xtend().
void add2 | ( | SVectorBase< R > & | svec, |
int | n, | ||
const int | idx[], | ||
const S | val[] | ||
) |
Adds n
nonzeros to svec
of this SVSetBase.
Adds n
nonzeros to SVectorBase svec
in the SVSetBase. If svec
is not large enough to hold the additional nonzeros, it will be automatically enlarged within the set.
svec
must be an SVectorBase of the SVSetBase. Definition at line 630 of file svsetbase.h.
References SVectorBase< R >::add(), SVectorBase< R >::size(), and SVSetBase< R >::xtend().
void clear | ( | int | minNewSize = -1 | ) |
Removes all SVectorBases from set.
Definition at line 740 of file svsetbase.h.
References ClassArray< Nonzero< R > >::clear(), SVSetBase< R >::list, ClassArray< Nonzero< R > >::max(), SVSetBase< R >::numUnusedMemUpdates, ClassArray< Nonzero< R > >::reMax(), SVSetBase< R >::set, and SVSetBase< R >::unusedMem.
|
private |
count size of unused memory exactly
Definition at line 205 of file svsetbase.h.
References SPxOut::debug(), SVSetBase< R >::list, SVSetBase< R >::memSize(), SVSetBase< R >::numUnusedMemUpdates, and SVSetBase< R >::unusedMem.
Referenced by SVSetBase< R >::updateUnusedMemEstimation().
SVectorBase< R > * create | ( | DataKey & | nkey, |
int | idxmax = -1 |
||
) |
Creates new SVectorBase in set.
The new SVectorBase will be ready to fit at least idxmax
nonzeros.
nkey
contains the DataKey associated to the new SVectorBase. Definition at line 511 of file svsetbase.h.
References SVSetBase< R >::create(), SVSetBase< R >::key(), and SVSetBase< R >::num().
SVectorBase< R > * create | ( | int | idxmax = 0 | ) |
Creates new SVectorBase in set.
The new SVectorBase will be ready to fit at least idxmax
nonzeros.
Definition at line 476 of file svsetbase.h.
References ClassArray< Nonzero< R > >::data, SVSetBase< R >::ensureMem(), SVSetBase< R >::ensurePSVec(), ClassArray< Nonzero< R > >::last(), SVSetBase< R >::list, SVSetBase< R >::memSize(), ClassArray< Nonzero< R > >::reSize(), SVSetBase< R >::set, and SVectorBase< R >::setMem().
Referenced by SVSetBase< R >::add(), LPRowSetBase< R >::create(), LPColSetBase< R >::create(), and SVSetBase< R >::create().
|
private |
Deleting a vector from the data array and the list.
Definition at line 292 of file svsetbase.h.
References SPxOut::debug(), SVSetBase< R >::list, SVectorBase< R >::max(), SVectorBase< R >::mem(), SVSetBase< R >::DLPSV::prev(), ClassArray< Nonzero< R > >::removeLast(), SVectorBase< R >::set_size(), SVectorBase< R >::setMem(), SVectorBase< R >::size(), and SVSetBase< R >::updateUnusedMemEstimation().
Referenced by SVSetBase< R >::remove().
|
private |
Provides enough nonzero memory for n
more Nonzeros.
Definition at line 247 of file svsetbase.h.
References SPxOut::debug(), SVSetBase< R >::list, SVectorBase< R >::max(), ClassArray< Nonzero< R > >::memFactor, SVSetBase< R >::memMax(), SVSetBase< R >::memPack(), SVSetBase< R >::memRemax(), SVSetBase< R >::memSize(), ClassArray< Nonzero< R > >::removeLast(), SVectorBase< R >::set_max(), SVectorBase< R >::size(), SVSetBase< R >::unusedMem, and SVSetBase< R >::updateUnusedMemEstimation().
Referenced by SVSetBase< R >::add(), SVSetBase< R >::create(), and SVSetBase< R >::xtend().
|
private |
Provides enough vector memory for n
more SVectorBases.
Definition at line 236 of file svsetbase.h.
References SVSetBase< R >::factor, SVSetBase< R >::max(), SVSetBase< R >::num(), and SVSetBase< R >::reMax().
Referenced by SVSetBase< R >::add(), and SVSetBase< R >::create().
bool has | ( | const DataKey & | k | ) | const |
True iff SVSetBase contains a SVectorBase for DataKey k
.
Definition at line 834 of file svsetbase.h.
References SVSetBase< R >::set.
Referenced by LPColSetBase< R >::has(), LPRowSetBase< R >::has(), and SVSetBase< R >::xtend().
bool has | ( | const SVectorBase< R > * | svec | ) | const |
Is an SVectorBase in the set?
Definition at line 846 of file svsetbase.h.
References SVSetBase< R >::set.
bool has | ( | int | n | ) | const |
True iff SVSetBase contains a SVectorBase for vector number n.
Definition at line 840 of file svsetbase.h.
References SVSetBase< R >::set.
bool isConsistent | ( | ) | const |
Consistency check.
Definition at line 981 of file svsetbase.h.
References ClassArray< Nonzero< R > >::isConsistent(), SVectorBase< R >::isConsistent(), ClassArray< Nonzero< R > >::last(), SVSetBase< R >::list, SVectorBase< R >::max(), SVectorBase< R >::mem(), SVSetBase< R >::set, and SPX_MSG_INCONSISTENT.
Referenced by LPColSetBase< R >::isConsistent(), LPRowSetBase< R >::isConsistent(), SVSetBase< R >::operator=(), and SVSetBase< R >::SVSetBase().
DataKey key | ( | const SVectorBase< R > * | svec | ) | const |
Gets DataKey of SVectorBase.
Definition at line 816 of file svsetbase.h.
References SVSetBase< R >::set.
DataKey key | ( | int | n | ) | const |
Gets DataKey of vector number.
Definition at line 810 of file svsetbase.h.
References SVSetBase< R >::set.
Referenced by SVSetBase< R >::add(), SVSetBase< R >::create(), LPColSetBase< R >::key(), LPRowSetBase< R >::key(), and SVSetBase< R >::remove().
int max | ( | ) | const |
Current maximum number of SVectorBases.
Definition at line 804 of file svsetbase.h.
References SVSetBase< R >::set.
Referenced by SVSetBase< R >::ensurePSVec(), LPColSetBase< R >::max(), and LPRowSetBase< R >::max().
int memMax | ( | ) | const |
Length of nonzero memory.
Definition at line 864 of file svsetbase.h.
References ClassArray< Nonzero< R > >::max().
Referenced by SVSetBase< R >::ensureMem(), LPColSetBase< R >::memMax(), LPRowSetBase< R >::memMax(), and SVSetBase< R >::memPack().
void memPack | ( | ) |
Garbage collection in nonzero memory.
Pack the svectors together as tightly as possible. This removes all additional unused memory, i.e., size = max for every svector after the call.
Note: do not call isConsistent() here, because the following might happen: In SPxLP::doAddRows(const LPRowSet& p_set), when adding rows, the sizes of the vectors for the columns of the LP are increased (without yet filling in the data) to recieve the additional entries. This is done by calling xtend() above. xtend() in turn might call this method, which checks the yet unfilled positions, i.e., isConsistent() is likely to fail. In general, isConsistent() should not be called within this class, but in classes further up in the hierarchy.
Definition at line 923 of file svsetbase.h.
References ClassArray< Nonzero< R > >::data, SPxOut::debug(), SVSetBase< R >::list, SVectorBase< R >::mem(), SVSetBase< R >::memMax(), SVSetBase< R >::memSize(), SVSetBase< R >::numUnusedMemUpdates, ClassArray< Nonzero< R > >::reSize(), SVectorBase< R >::set_max(), SVectorBase< R >::set_size(), SVectorBase< R >::setMem(), SVectorBase< R >::size(), and SVSetBase< R >::unusedMem.
Referenced by SVSetBase< R >::ensureMem(), LPColSetBase< R >::memPack(), and LPRowSetBase< R >::memPack().
void memRemax | ( | int | newmax | ) |
Reset length of nonzero memory.
Definition at line 870 of file svsetbase.h.
References SPxOut::debug(), SVSetBase< R >::list, SVSetBase< R >::memSize(), SVSetBase< R >::numUnusedMemUpdates, ClassArray< Nonzero< R > >::reMax(), and SVSetBase< R >::unusedMem.
Referenced by SVSetBase< R >::ensureMem(), LPColSetBase< R >::memRemax(), and LPRowSetBase< R >::memRemax().
int memSize | ( | ) | const |
Used nonzero memory.
Definition at line 858 of file svsetbase.h.
References ClassArray< Nonzero< R > >::size().
Referenced by SVSetBase< R >::countUnusedMem(), SVSetBase< R >::create(), SVSetBase< R >::ensureMem(), SVSetBase< R >::memPack(), SVSetBase< R >::memRemax(), LPColSetBase< R >::memSize(), LPRowSetBase< R >::memSize(), SVSetBase< R >::updateUnusedMemEstimation(), and SVSetBase< R >::xtend().
int num | ( | ) | const |
Current number of SVectorBases.
Definition at line 798 of file svsetbase.h.
References SVSetBase< R >::set.
Referenced by SVSetBase< R >::add(), SPxLPBase< R >::added2Set(), SSVectorBase< R >::assign2product(), SSVectorBase< R >::assign2product4setup(), SVSetBase< R >::create(), SVSetBase< R >::ensurePSVec(), LPColSetBase< R >::num(), LPRowSetBase< R >::num(), soplex::operator<<(), and SVSetBase< R >::remove().
int number | ( | const DataKey & | k | ) | const |
Gets vector number of DataKey.
Definition at line 822 of file svsetbase.h.
References SVSetBase< R >::set.
Referenced by LPColSetBase< R >::number(), LPRowSetBase< R >::number(), SVSetBase< R >::operator=(), and SVSetBase< R >::remove().
int number | ( | const SVectorBase< R > * | svec | ) | const |
Gets vector number of SVectorBase.
Definition at line 828 of file svsetbase.h.
References SVSetBase< R >::set.
Assignment operator.
Definition at line 1030 of file svsetbase.h.
References ClassArray< Nonzero< R > >::clear(), SVSetBase< R >::isConsistent(), SVSetBase< R >::list, SVectorBase< R >::max(), SVectorBase< R >::mem(), SVSetBase< R >::number(), ClassArray< Nonzero< R > >::operator=(), SVSetBase< R >::set, SVectorBase< R >::set_size(), SVectorBase< R >::setMem(), ClassArray< T >::size(), and SVectorBase< R >::size().
Referenced by LPColSetBase< R >::operator=(), and LPRowSetBase< R >::operator=().
Assignment operator.
Definition at line 1066 of file svsetbase.h.
References SVSetBase< R >::add(), ClassArray< Nonzero< R > >::clear(), SVSetBase< R >::isConsistent(), and ClassArray< T >::size().
SVectorBase< R > & operator[] | ( | const DataKey & | k | ) |
Gets SVectorBase by DataKey, writeable.
Definition at line 780 of file svsetbase.h.
References SVSetBase< R >::set.
const SVectorBase< R > & operator[] | ( | const DataKey & | k | ) | const |
Gets SVectorBase by DataKey.
Definition at line 786 of file svsetbase.h.
References SVSetBase< R >::set.
SVectorBase< R > & operator[] | ( | int | n | ) |
Gets SVectorBase by number, writeable.
Definition at line 768 of file svsetbase.h.
References SVSetBase< R >::set.
Referenced by LPColSetBase< R >::colVector(), LPColSetBase< R >::colVector_w(), LPRowSetBase< R >::rowVector(), and LPRowSetBase< R >::rowVector_w().
const SVectorBase< R > & operator[] | ( | int | n | ) | const |
Gets SVectorBase by number.
Definition at line 774 of file svsetbase.h.
References SVSetBase< R >::set.
void reMax | ( | int | newmax = 0 | ) |
Resets maximum number of SVectorBases.
Definition at line 975 of file svsetbase.h.
References SVSetBase< R >::list, and SVSetBase< R >::set.
Referenced by SVSetBase< R >::ensurePSVec(), LPColSetBase< R >::reMax(), and LPRowSetBase< R >::reMax().
void remove | ( | const DataKey & | removekey | ) |
Removes the vector with key removekey
from the set.
removekey
must be a key from SVSetBase Definition at line 645 of file svsetbase.h.
References SVSetBase< R >::deleteVec(), and SVSetBase< R >::set.
Referenced by LPColSetBase< R >::remove(), LPRowSetBase< R >::remove(), and SVSetBase< R >::remove().
void remove | ( | const DataKey | keys[], |
int | n | ||
) |
Removes n
SVectorBases from set.
keys
must be at least of size n
and valid keys Definition at line 694 of file svsetbase.h.
References DataArray< T >::get_ptr(), SVSetBase< R >::num(), and SVSetBase< R >::remove().
void remove | ( | const DataKey | keys[], |
int | n, | ||
int * | perm | ||
) |
Definition at line 710 of file svsetbase.h.
References SVSetBase< R >::num(), SVSetBase< R >::number(), and SVSetBase< R >::remove().
void remove | ( | const int | nums[], |
int | n | ||
) |
Removes n
SVectorBases from set.
nums
must be at least of size n
and valid vector numbers Definition at line 703 of file svsetbase.h.
References DataArray< T >::get_ptr(), SVSetBase< R >::num(), and SVSetBase< R >::remove().
void remove | ( | const int | nums[], |
int | n, | ||
int * | perm | ||
) |
Removes n
SVectorBases from set.
nums
must be at least of size n
perm
must be at least of size num() At return, perm
is the permutations resulting from this removal: perm
[i] < 0 indicates that the element to index i
has been removed. Otherwise, perm
[i] is the new index of the element with index i
before the removal. Definition at line 728 of file svsetbase.h.
References SVSetBase< R >::num(), and SVSetBase< R >::remove().
void remove | ( | const SVectorBase< R > * | svec | ) |
Removes one SVectorBase from set.
svec
must be from SVSetBase Definition at line 662 of file svsetbase.h.
References SVSetBase< R >::key(), and SVSetBase< R >::remove().
void remove | ( | int | perm[] | ) |
Removes multiple elements.
Removes all SVectorBases for the SVSetBase with an index i
such that perm
[i] < 0. Upon completion, perm
[i] >= 0 indicates the new index where the i
'th SVectorBase has been moved to due to this removal.
perm
must point to an array of at least num() integers. Definition at line 673 of file svsetbase.h.
References SVSetBase< R >::deleteVec(), SVSetBase< R >::num(), and SVSetBase< R >::set.
void remove | ( | int | removenum | ) |
Removes the vector with number removenum
from the set.
removenum
must be a valid vector number from SVSetBase Definition at line 654 of file svsetbase.h.
References SVSetBase< R >::key(), and SVSetBase< R >::remove().
|
private |
update estimation of unused memory
Definition at line 226 of file svsetbase.h.
References SVSetBase< R >::countUnusedMem(), SVSetBase< R >::memSize(), SVSetBase< R >::numUnusedMemUpdates, and SVSetBase< R >::unusedMem.
Referenced by SVSetBase< R >::deleteVec(), SVSetBase< R >::ensureMem(), and SVSetBase< R >::xtend().
void xtend | ( | SVectorBase< R > & | svec, |
int | newmax | ||
) |
Extends svec
to fit newmax
nonzeros.
svec
must be an SVectorBase of the SVSetBase. Definition at line 523 of file svsetbase.h.
References ClassArray< Nonzero< R > >::data, SPxOut::debug(), SVSetBase< R >::ensureMem(), ClassArray< Nonzero< R > >::get_ptr(), SVSetBase< R >::has(), ClassArray< Nonzero< R > >::insert(), ClassArray< Nonzero< R > >::last(), SVSetBase< R >::list, SVectorBase< R >::max(), SVectorBase< R >::mem(), SVSetBase< R >::memSize(), SVSetBase< R >::DLPSV::prev(), SVectorBase< R >::set_size(), SVectorBase< R >::setMem(), ClassArray< Nonzero< R > >::size(), SVectorBase< R >::size(), and SVSetBase< R >::updateUnusedMemEstimation().
Referenced by SVSetBase< R >::add2(), LPColSetBase< R >::xtend(), and LPRowSetBase< R >::xtend().
|
friend |
Definition at line 74 of file svsetbase.h.
|
private |
sparse vector memory enlargment factor
Definition at line 196 of file svsetbase.h.
Referenced by SVSetBase< R >::ensurePSVec().
doubly linked list for non-zero management
Definition at line 186 of file svsetbase.h.
Referenced by SVSetBase< R >::clear(), SVSetBase< R >::countUnusedMem(), SVSetBase< R >::create(), SVSetBase< R >::deleteVec(), SVSetBase< R >::ensureMem(), SVSetBase< R >::isConsistent(), SVSetBase< R >::memPack(), SVSetBase< R >::memRemax(), SVSetBase< R >::operator=(), SVSetBase< R >::reMax(), and SVSetBase< R >::xtend().
|
private |
counter for how often unusedMem has been updated since last exact value
Definition at line 188 of file svsetbase.h.
Referenced by SVSetBase< R >::clear(), SVSetBase< R >::countUnusedMem(), SVSetBase< R >::memPack(), SVSetBase< R >::memRemax(), and SVSetBase< R >::updateUnusedMemEstimation().
set of SVectorBases
Definition at line 185 of file svsetbase.h.
Referenced by LPRowSetBase< R >::add(), SPxLPBase< R >::addCols(), SPxLPBase< R >::added2Set(), SPxLPBase< R >::addRows(), SVSetBase< R >::clear(), SVSetBase< R >::create(), SPxLPBase< R >::doAddCols(), SPxLPBase< R >::doAddRows(), SPxLPBase< R >::getCols(), SPxLPBase< R >::getRows(), SVSetBase< R >::has(), SVSetBase< R >::isConsistent(), SVSetBase< R >::key(), SVSetBase< R >::max(), SVSetBase< R >::num(), SVSetBase< R >::number(), SVSetBase< R >::operator=(), SVSetBase< R >::operator[](), SVSetBase< R >::reMax(), and SVSetBase< R >::remove().
|
private |
an estimate of the unused memory (the difference of max() and size() summed up over all vectors) due to deleteVec() and xtend()
Definition at line 187 of file svsetbase.h.
Referenced by SVSetBase< R >::clear(), SVSetBase< R >::countUnusedMem(), SVSetBase< R >::ensureMem(), SVSetBase< R >::memPack(), SVSetBase< R >::memRemax(), and SVSetBase< R >::updateUnusedMemEstimation().