|
DSVectorBase< R > Class Template Reference Dynamic sparse vectors.Class DSVectorBase implements dynamic sparse vectors, i.e. SVectorBases with an automatic memory management. This allows the user to freely add() as many nonzeros to a DSVectorBase as desired, without any precautions. For saving memory method setMax() allows to reduce memory consumption to the amount really required. More...
Inheritance diagram for DSVectorBase< R >:
![]()
Detailed Descriptiontemplate<class R>
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
explicit |
Default constructor.
Creates a DSVectorBase ready to hold n nonzeros. However, the memory is automatically enlarged, if more nonzeros are added to the DSVectorBase.
Definition at line 94 of file dsvectorbase.h.
|
explicit |
Copy constructor.
Definition at line 104 of file dsvectorbase.h.
| DSVectorBase | ( | const DSVectorBase< R > & | old | ) |
Copy constructor.
The redundancy with the copy constructor below is necessary since otherwise the compiler doesn't realize that it could use the more general one with S = R and generates a shallow copy constructor.
Definition at line 117 of file dsvectorbase.h.
| DSVectorBase | ( | const DSVectorBase< S > & | old | ) |
Copy constructor.
Definition at line 129 of file dsvectorbase.h.
|
explicit |
Copy constructor.
Definition at line 1016 of file basevectors.h.
References DSVectorBase< R >::allocMem(), VectorBase< R >::dim(), and DSVectorBase< R >::isConsistent().
|
explicit |
Copy constructor.
Definition at line 1031 of file basevectors.h.
References DSVectorBase< R >::allocMem(), DSVectorBase< R >::isConsistent(), SVectorBase< R >::operator=(), and SSVectorBase< R >::size().
|
virtual |
Destructor.
Definition at line 197 of file dsvectorbase.h.
| ~DSVectorBase | ( | ) |
Destructor (specialization for Real).
Definition at line 318 of file dsvectorbase.h.
References soplex::spx_free(), and DSVectorBase< R >::theelem.
| void add | ( | const SVectorBase< S > & | vec | ) |
Append nonzeros of sv.
Definition at line 216 of file dsvectorbase.h.
Referenced by SoPlex::_performOptIRStable(), SoPlex::_transformFeasibility(), SoPlex::_transformUnbounded(), SPxSolver::computeDualfarkas4Col(), SPxSolver::computeDualfarkas4Row(), SPxSolver::computePrimalray4Col(), SPxSolver::computePrimalray4Row(), SPxMainSM::DuplicateRowsPS::DuplicateRowsPS(), SPxMainSM::FreeZeroObjVariablePS::FreeZeroObjVariablePS(), main(), soplex::operator*(), and SPxLPBase< R >::readLPF().
| void add | ( | int | i, |
| const R & | v | ||
| ) |
Append one nonzero (i,v).
Definition at line 224 of file dsvectorbase.h.
| void add | ( | int | i | ) |
Append one uninitialized nonzero.
Definition at line 231 of file dsvectorbase.h.
| void add | ( | int | n, |
| const int | i[], | ||
| const R | v[] | ||
| ) |
Append n nonzeros.
Definition at line 238 of file dsvectorbase.h.
|
private |
Allocate memory for n nonzeros.
Definition at line 62 of file dsvectorbase.h.
Referenced by DSVectorBase< R >::DSVectorBase(), and DSVectorBase< Real >::DSVectorBase().
|
private |
Allocate memory for n nonzeros (specialization for Real).
Definition at line 307 of file dsvectorbase.h.
References SVectorBase< R >::setMem(), soplex::spx_alloc(), and DSVectorBase< R >::theelem.
| bool isConsistent | ( | ) | const |
Consistency check.
Definition at line 289 of file dsvectorbase.h.
Referenced by DSVectorBase< R >::DSVectorBase(), DSVectorBase< Real >::DSVectorBase(), LPColBase< R >::isConsistent(), LPRowBase< R >::isConsistent(), and DSVectorBase< R >::operator=().
|
private |
Ensure there is room for n new nonzeros.
Definition at line 71 of file dsvectorbase.h.
Referenced by DSVectorBase< Real >::add(), DSVectorBase< Real >::operator=(), and DSVectorBase< R >::operator=().
| DSVectorBase<R>& operator= | ( | const SVectorBase< S > & | vec | ) |
Assignment operator.
Definition at line 149 of file dsvectorbase.h.
Referenced by DSVectorBase< Real >::operator=().
| DSVectorBase<R>& operator= | ( | const DSVectorBase< R > & | vec | ) |
Assignment operator.
Definition at line 162 of file dsvectorbase.h.
| DSVectorBase<R>& operator= | ( | const DSVectorBase< S > & | vec | ) |
Assignment operator.
Definition at line 176 of file dsvectorbase.h.
| DSVectorBase< R > & operator= | ( | const VectorBase< S > & | vec | ) |
Assignment operator.
Definition at line 1046 of file basevectors.h.
References SVectorBase< R >::clear(), VectorBase< R >::dim(), DSVectorBase< R >::isConsistent(), SVectorBase< R >::operator=(), and DSVectorBase< R >::setMax().
| DSVectorBase< R > & operator= | ( | const SSVectorBase< S > & | vec | ) |
Assignment operator.
Definition at line 1065 of file basevectors.h.
References SVectorBase< R >::clear(), DSVectorBase< R >::makeMem(), SVectorBase< R >::operator=(), and SSVectorBase< R >::size().
| void setMax | ( | int | newmax = 1 | ) |
Reset nonzero memory to >= newmax.
This methods resets the memory consumption to newmax. However, if newmax < size(), it is reset to size() only.
Definition at line 248 of file dsvectorbase.h.
Referenced by SoPlex::_ensureDSVectorRationalMemory(), SPxSolver::computeDualfarkas4Col(), SPxSolver::computeDualfarkas4Row(), SPxSolver::computePrimalray4Col(), SPxSolver::computePrimalray4Row(), DSVectorBase< Real >::makeMem(), and DSVectorBase< R >::operator=().
| void setMax | ( | int | newmax | ) |
Reset nonzero memory to >= newmax.
This methods resets the memory consumption to newmax. However, if newmax < size(), it is reset to size() only (specialization for Real).
Definition at line 332 of file dsvectorbase.h.
References SVectorBase< R >::set_size(), SVectorBase< R >::setMem(), SVectorBase< R >::size(), soplex::spx_realloc(), and DSVectorBase< R >::theelem.
|
friend |
Definition at line 44 of file dsvectorbase.h.
|
private |
Memory.
Definition at line 53 of file dsvectorbase.h.
Referenced by DSVectorBase< R >::allocMem(), DSVectorBase< R >::setMax(), and DSVectorBase< R >::~DSVectorBase().