Semi sparse vector. More...
#include <ssvectorbase.h>
Public Member Functions | |
SSVectorBase< Rational > & | assign (const SVectorBase< Rational > &rhs) |
Assigns only the elements of rhs . More... | |
Status of an SSVectorBase | |
An SSVectorBase can be set up or not. In case it is set up, its IdxSet correctly contains all indices of nonzero elements of the SSVectorBase. Otherwise, it does not contain any useful data. Whether or not an SSVectorBase is setup can be determined with the method isSetup(). There are three methods for directly affecting the setup status of an SSVectorBase:
| |
R * | get_ptr () |
Only used in slufactor.hpp. More... | |
virtual void | setTolerances (std::shared_ptr< Tolerances > newTolerances) |
set the _tolerances member variable More... | |
const std::shared_ptr< Tolerances > & | tolerances () const |
returns current tolerances More... | |
bool | isSetup () const |
Returns setup status. More... | |
R | getEpsilon () const |
void | unSetup () |
Makes SSVectorBase not setup. More... | |
void | setup () |
Initializes nonzero indices for elements with absolute values above epsilon and sets all other elements to 0. More... | |
void | forceSetup () |
Forces setup status. More... | |
Methods for setup SSVectorBases | |
int | index (int n) const |
Returns index of the n 'th nonzero element. More... | |
R | value (int n) const |
Returns value of the n 'th nonzero element. More... | |
int | pos (int i) const |
Finds the position of index i in the IdxSet, or -1 if i doesn't exist. More... | |
int | size () const |
Returns the number of nonzeros. More... | |
void | add (int i, R x) |
Adds nonzero (i , x ) to SSVectorBase. More... | |
void | setValue (int i, R x) |
Sets i 'th element to x . More... | |
void | scaleValue (int i, int scaleExp) |
Scale i 'th element by a. More... | |
void | clearIdx (int i) |
Clears element i . More... | |
void | clearNum (int n) |
Sets n 'th nonzero element to 0 (index n must exist). More... | |
Methods independent of the Status | |
R | operator[] (int i) const |
Returns i 'th value. More... | |
const int * | indexMem () const |
Returns array indices. More... | |
const R * | values () const |
Returns array values. More... | |
const IdxSet & | indices () const |
Returns indices. More... | |
int * | altIndexMem () |
Returns array indices. More... | |
R * | altValues () |
Returns array values. More... | |
IdxSet & | altIndices () |
Returns indices. More... | |
Arithmetic operations | |
template<class S > | |
SSVectorBase< R > & | operator+= (const VectorBase< S > &vec) |
Addition. More... | |
template<class S > | |
SSVectorBase< R > & | operator+= (const SVectorBase< S > &vec) |
Addition. More... | |
template<class S > | |
SSVectorBase< R > & | operator+= (const SSVectorBase< S > &vec) |
Addition. More... | |
template<class S > | |
SSVectorBase< R > & | operator-= (const VectorBase< S > &vec) |
Subtraction. More... | |
template<class S > | |
SSVectorBase< R > & | operator-= (const SVectorBase< S > &vec) |
Subtraction. More... | |
template<class S > | |
SSVectorBase< R > & | operator-= (const SSVectorBase< S > &vec) |
Subtraction. More... | |
template<class S > | |
SSVectorBase< R > & | operator*= (S x) |
Scaling. More... | |
template<class S > | |
R | operator* (const SSVectorBase< S > &w) |
template<class S , class T > | |
SSVectorBase< R > & | multAdd (S xx, const SVectorBase< T > &vec) |
Addition of a scaled vector. More... | |
template<class S , class T > | |
SSVectorBase< R > & | multAdd (S x, const VectorBase< T > &vec) |
Addition of a scaled vector. More... | |
template<class S , class T > | |
SSVectorBase< R > & | assignPWproduct4setup (const SSVectorBase< S > &x, const SSVectorBase< T > &y) |
Assigns pair wise vector product to SSVectorBase. More... | |
template<class S , class T > | |
SSVectorBase< R > & | assign2product (const SSVectorBase< S > &x, const SVSetBase< T > &A) |
Assigns \(x^T \cdot A\) to SSVectorBase. More... | |
template<class S , class T > | |
SSVectorBase< R > & | assign2product4setup (const SVSetBase< S > &A, const SSVectorBase< T > &x, Timer *timeSparse, Timer *timeFull, int &nCallsSparse, int &nCallsFull) |
Assigns SSVectorBase to \(A \cdot x\) for a setup x . More... | |
template<class S , class T > | |
SSVectorBase< R > & | assign2productAndSetup (const SVSetBase< S > &A, SSVectorBase< T > &x) |
Assigns SSVectorBase to \(A \cdot x\) thereby setting up x . More... | |
R | maxAbs () const |
Maximum absolute value, i.e., infinity norm. More... | |
R | length2 () const |
Squared euclidian norm. More... | |
R | length () const |
Floating point approximation of euclidian norm (without any approximation guarantee). More... | |
Miscellaneous | |
int | dim () const |
Dimension of VectorBase. More... | |
void | reDim (int newdim) |
Resets dimension to newdim . More... | |
void | setSize (int n) |
Sets number of nonzeros (thereby unSetup SSVectorBase). More... | |
void | reMem (int newsize) |
Resets memory consumption to newsize . More... | |
void | clear () |
Clears vector. More... | |
bool | isConsistent () const |
consistency check. More... | |
Constructors / Destructors | |
SSVectorBase (int p_dim, std::shared_ptr< Tolerances > tol=nullptr) | |
Default constructor. More... | |
template<class S > | |
SSVectorBase (const SSVectorBase< S > &vec) | |
Copy constructor. More... | |
SSVectorBase (const SSVectorBase< R > &vec) | |
Copy constructor. More... | |
template<class S > | |
SSVectorBase (const VectorBase< S > &vec) | |
Constructs nonsetup copy of vec . More... | |
template<class S > | |
void | setup_and_assign (SSVectorBase< S > &rhs) |
Sets up rhs vector, and assigns it. More... | |
template<class S > | |
SSVectorBase< R > & | assign (const SVectorBase< S > &rhs) |
Assigns only the elements of rhs . More... | |
template<class S > | |
SSVectorBase< R > & | operator= (const SSVectorBase< S > &rhs) |
Assignment operator. More... | |
SSVectorBase< R > & | operator= (const SSVectorBase< R > &rhs) |
Assignment operator. More... | |
template<class S > | |
SSVectorBase< R > & | operator= (const SVectorBase< S > &rhs) |
Assignment operator. More... | |
template<class S > | |
SSVectorBase< R > & | operator= (const VectorBase< S > &rhs) |
Assignment operator. More... | |
~SSVectorBase () | |
destructor More... | |
Public Member Functions inherited from VectorBase< R > | |
bool | isConsistent () const |
Consistency check. More... | |
Rational | operator* (const VectorBase< Rational > &vec) const |
Inner product. More... | |
VectorBase () | |
Constructor. More... | |
VectorBase (int dimen, R *p_val) | |
VectorBase (int p_dimen) | |
template<typename S > | |
VectorBase (const VectorBase< S > &vec) | |
VectorBase (const VectorBase< R > &&vec) noexcept | |
VectorBase (const VectorBase< R > &vec) | |
template<class S > | |
VectorBase< R > & | operator= (const VectorBase< S > &vec) |
Assignment operator. More... | |
VectorBase< R > & | operator= (const VectorBase< R > &vec) |
Assignment operator. More... | |
VectorBase< R > & | operator= (const VectorBase< R > &&vec) |
Move assignment operator. More... | |
VectorBase< R > & | scaleAssign (int scaleExp, const VectorBase< R > &vec) |
scale and assign More... | |
VectorBase< R > & | scaleAssign (const int *scaleExp, const VectorBase< R > &vec, bool negateExp=false) |
scale and assign More... | |
template<class S > | |
VectorBase< R > & | operator= (const SVectorBase< S > &vec) |
Assignment operator. More... | |
template<class S > | |
VectorBase< R > & | operator= (const SSVectorBase< S > &vec) |
Assignment operator. More... | |
template<class S > | |
VectorBase< R > & | assign (const SVectorBase< S > &vec) |
Assign values of vec . More... | |
template<class S > | |
VectorBase< R > & | assign (const SSVectorBase< S > &vec) |
Assign values of vec . More... | |
void | clear () |
Set vector to contain all-zeros (keeping the same length) More... | |
template<class S > | |
VectorBase< R > & | operator+= (const VectorBase< S > &vec) |
Addition. More... | |
template<class S > | |
VectorBase< R > & | operator+= (const SVectorBase< S > &vec) |
Addition. More... | |
template<class S > | |
VectorBase< R > & | operator+= (const SSVectorBase< S > &vec) |
Addition. More... | |
template<class S > | |
VectorBase< R > & | operator-= (const VectorBase< S > &vec) |
Subtraction. More... | |
template<class S > | |
VectorBase< R > & | operator-= (const SVectorBase< S > &vec) |
Subtraction. More... | |
template<class S > | |
VectorBase< R > & | operator-= (const SSVectorBase< S > &vec) |
Subtraction. More... | |
template<class S > | |
VectorBase< R > & | operator*= (const S &x) |
Scaling. More... | |
template<class S > | |
VectorBase< R > & | operator/= (const S &x) |
Division. More... | |
R | operator* (const VectorBase< R > &vec) const |
Inner product. More... | |
R | operator* (const SVectorBase< R > &vec) const |
Inner product. More... | |
R | operator* (const SSVectorBase< R > &vec) const |
Inner product. More... | |
R | maxAbs () const |
Maximum absolute value, i.e., infinity norm. More... | |
R | minAbs () const |
Minimum absolute value. More... | |
R | length () const |
Floating point approximation of euclidian norm (without any approximation guarantee). More... | |
R | length2 () const |
Squared norm. More... | |
template<class S , class T > | |
VectorBase< R > & | multAdd (const S &x, const VectorBase< T > &vec) |
Addition of scaled vector. More... | |
template<class S , class T > | |
VectorBase< R > & | multAdd (const S &x, const SVectorBase< T > &vec) |
Addition of scaled vector. More... | |
template<class S , class T > | |
VectorBase< R > & | multSub (const S &x, const SVectorBase< T > &vec) |
Subtraction of scaled vector. More... | |
template<class S , class T > | |
VectorBase< R > & | multAdd (const S &x, const SSVectorBase< T > &vec) |
Addition of scaled vector. More... | |
int | dim () const |
Dimension of vector. More... | |
R & | operator[] (int n) |
Return n 'th value by reference. More... | |
const R & | operator[] (int n) const |
Return n 'th value. More... | |
const std::vector< R > & | vec () |
Return underlying std::vector. More... | |
R * | get_ptr () |
Conversion to C-style pointer. More... | |
const R * | get_const_ptr () const |
Conversion to C-style pointer. More... | |
std::vector< R >::const_iterator | begin () const |
std::vector< R >::iterator | begin () |
std::vector< R >::const_iterator | end () const |
std::vector< R >::iterator | end () |
int | memSize () const |
void | reDim (int newdim, const bool setZero=true) |
Resets VectorBase's dimension to newdim . More... | |
void | reSize (int newsize) |
Resets VectorBase's memory size to newsize . More... | |
const VectorBase< R > | operator- (const VectorBase< R > &vec) const |
const VectorBase< R > | operator+ (const VectorBase< R > &v) const |
Protected Attributes | |
std::shared_ptr< Tolerances > | _tolerances |
Protected Attributes inherited from VectorBase< R > | |
std::vector< R > | val |
Values of vector. More... | |
Protected Attributes inherited from IdxSet | |
int | num |
number of used indices More... | |
int | len |
length of array idx More... | |
int * | idx |
array of indices More... | |
bool | freeArray |
true iff idx should be freed inside of this object More... | |
Private Member Functions | |
Private helpers | |
template<class S , class T > | |
SSVectorBase< R > & | assign2product1 (const SVSetBase< S > &A, const SSVectorBase< T > &x) |
Assignment helper. More... | |
template<class S , class T > | |
SSVectorBase< R > & | assign2productShort (const SVSetBase< S > &A, const SSVectorBase< T > &x) |
Assignment helper. More... | |
template<class S , class T > | |
SSVectorBase< R > & | assign2productFull (const SVSetBase< S > &A, const SSVectorBase< T > &x) |
Assignment helper. More... | |
Friends | |
class | VectorBase< R > |
template<class S > | |
class | DSVectorBase |
Data | |
bool | setupStatus |
Is the SSVectorBase set up? More... | |
void | setMax (int newmax) |
Allocates enough space to accommodate newmax values. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from IdxSet | |
IdxSet (int n, int imem[], int l=0) | |
constructor. More... | |
IdxSet () | |
default constructor. More... | |
virtual | ~IdxSet () |
destructor. More... | |
IdxSet & | operator= (const IdxSet &set) |
assignment operator. More... | |
IdxSet (const IdxSet &) | |
copy constructor. More... | |
int | index (int n) const |
access n 'th index. More... | |
int | size () const |
returns the number of used indices. More... | |
int | max () const |
returns the maximal number of indices which can be stored in IdxSet. More... | |
int | dim () const |
returns the maximal index. More... | |
int | pos (int i) const |
returns the position of index i . More... | |
void | add (int n) |
appends n uninitialized indices. More... | |
void | add (const IdxSet &set) |
appends all indices of set . More... | |
void | add (int n, const int i[]) |
appends n indices in i . More... | |
void | addIdx (int i) |
appends index i . More... | |
void | remove (int n, int m) |
removes indices at position numbers n through m . More... | |
void | remove (int n) |
removes n 'th index. More... | |
void | clear () |
removes all indices. More... | |
bool | isConsistent () const |
consistency check. More... | |
Semi sparse vector.
This class implements semi-sparse vectors. Such are VectorBases where the indices of its nonzero elements can be stored in an extra IdxSet. Only elements with absolute value > getEpsilon() are considered to be nonzero. Since really storing the nonzeros is not always convenient, an SSVectorBase provides two different stati: setup and not setup. An SSVectorBase being setup means that the nonzero indices are available, otherwise an SSVectorBase is just an ordinary VectorBase with an empty IdxSet. Note that due to arithmetic operation, zeros can slip in, i.e., it is only guaranteed that at least every non-zero is in the IdxSet.
Definition at line 56 of file ssvectorbase.h.
|
explicit |
Default constructor.
Definition at line 674 of file ssvectorbase.h.
References SSVectorBase< R >::_tolerances, VectorBase< R >::clear(), IdxSet::idx, SSVectorBase< R >::isConsistent(), IdxSet::len, and soplex::spx_alloc().
SSVectorBase | ( | const SSVectorBase< S > & | vec | ) |
Copy constructor.
Definition at line 689 of file ssvectorbase.h.
References SSVectorBase< R >::_tolerances, IdxSet::idx, SSVectorBase< R >::isConsistent(), IdxSet::len, IdxSet::operator=(), soplex::spx_alloc(), and VectorBase< R >::vec().
SSVectorBase | ( | const SSVectorBase< R > & | vec | ) |
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 706 of file ssvectorbase.h.
References SSVectorBase< R >::_tolerances, IdxSet::idx, SSVectorBase< R >::isConsistent(), IdxSet::len, IdxSet::operator=(), soplex::spx_alloc(), and VectorBase< R >::vec().
|
explicit |
Constructs nonsetup copy of vec
.
Definition at line 721 of file ssvectorbase.h.
References IdxSet::idx, SSVectorBase< R >::isConsistent(), IdxSet::len, soplex::spx_alloc(), and VectorBase< R >::vec().
~SSVectorBase | ( | ) |
destructor
Definition at line 895 of file ssvectorbase.h.
References IdxSet::idx, and soplex::spx_free().
void add | ( | int | i, |
R | x | ||
) |
Adds nonzero (i
, x
) to SSVectorBase.
No nonzero with index i
must exist in the SSVectorBase.
Definition at line 221 of file ssvectorbase.h.
References IdxSet::addIdx(), and SSVectorBase< R >::pos().
int * altIndexMem | ( | ) |
Returns array indices.
Definition at line 324 of file ssvectorbase.h.
References IdxSet::idx, and SSVectorBase< R >::unSetup().
IdxSet & altIndices | ( | ) |
Returns indices.
Definition at line 338 of file ssvectorbase.h.
References SSVectorBase< R >::unSetup().
R * altValues | ( | ) |
Returns array values.
Definition at line 331 of file ssvectorbase.h.
References SSVectorBase< R >::unSetup().
SSVectorBase< Rational > & assign | ( | const SVectorBase< Rational > & | rhs | ) |
Assigns only the elements of rhs
.
Definition at line 898 of file basevectors.h.
References SVectorBase< R >::dim(), SVectorBase< R >::index(), SVectorBase< R >::size(), and SVectorBase< R >::value().
SSVectorBase< R > & assign | ( | const SVectorBase< S > & | rhs | ) |
Assigns only the elements of rhs
.
Definition at line 864 of file basevectors.h.
References SVectorBase< R >::dim(), SVectorBase< R >::index(), SVectorBase< R >::size(), and SVectorBase< R >::value().
SSVectorBase< R > & assign2product | ( | const SSVectorBase< S > & | x, |
const SVSetBase< T > & | A | ||
) |
Assigns \(x^T \cdot A\) to SSVectorBase.
Definition at line 519 of file basevectors.h.
References SVSetBase< R >::num().
|
private |
Assignment helper.
Definition at line 612 of file basevectors.h.
References SVectorBase< R >::element(), IdxSet::idx, Nonzero< R >::idx, SSVectorBase< R >::isSetup(), SSVectorBase< R >::size(), SVectorBase< R >::size(), Nonzero< R >::val, and VectorBase< R >::val.
SSVectorBase< R > & assign2product4setup | ( | const SVSetBase< S > & | A, |
const SSVectorBase< T > & | x, | ||
Timer * | timeSparse, | ||
Timer * | timeFull, | ||
int & | nCallsSparse, | ||
int & | nCallsFull | ||
) |
Assigns SSVectorBase to \(A \cdot x\) for a setup x
.
Definition at line 550 of file basevectors.h.
References SSVectorBase< R >::dim(), SSVectorBase< R >::isSetup(), and SVSetBase< R >::num().
SSVectorBase< R > & assign2productAndSetup | ( | const SVSetBase< S > & | A, |
SSVectorBase< T > & | x | ||
) |
Assigns SSVectorBase to \(A \cdot x\) thereby setting up x
.
Definition at line 806 of file basevectors.h.
References SSVectorBase< R >::dim(), SVectorBase< R >::element(), IdxSet::idx, Nonzero< R >::idx, SSVectorBase< R >::isSetup(), IdxSet::num, SSVectorBase< R >::setupStatus, SVectorBase< R >::size(), Nonzero< R >::val, and VectorBase< R >::val.
|
private |
Assignment helper.
Definition at line 762 of file basevectors.h.
References IdxSet::idx, SSVectorBase< R >::isSetup(), SSVectorBase< R >::size(), SVectorBase< R >::size(), and VectorBase< R >::val.
|
private |
Assignment helper.
Definition at line 648 of file basevectors.h.
References SVectorBase< R >::element(), IdxSet::idx, Nonzero< R >::idx, SSVectorBase< R >::isSetup(), SSVectorBase< R >::size(), SVectorBase< R >::size(), SOPLEX_VECTOR_MARKER, Nonzero< R >::val, and VectorBase< R >::val.
SSVectorBase< R > & assignPWproduct4setup | ( | const SSVectorBase< S > & | x, |
const SSVectorBase< T > & | y | ||
) |
Assigns pair wise vector product to SSVectorBase.
Assigns pair wise vector product of setup x and setup y to SSVectorBase.
Definition at line 458 of file basevectors.h.
References SSVectorBase< R >::dim(), SSVectorBase< R >::isSetup(), and SSVectorBase< R >::size().
void clear | ( | ) |
Clears vector.
Definition at line 616 of file ssvectorbase.h.
References IdxSet::clear(), VectorBase< R >::clear(), IdxSet::idx, SSVectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), IdxSet::num, and SSVectorBase< R >::setupStatus.
Referenced by SPxBasisBase< R >::coSolve(), SLUFactorRational::operator=(), SSVectorBase< R >::operator=(), SSVectorBase< R >::setup_and_assign(), SPxBasisBase< R >::solve(), and SPxBasisBase< R >::solve4update().
void clearIdx | ( | int | i | ) |
Clears element i
.
Definition at line 266 of file ssvectorbase.h.
References SSVectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), SSVectorBase< R >::pos(), and IdxSet::remove().
void clearNum | ( | int | n | ) |
Sets n
'th nonzero element to 0 (index n
must exist).
Definition at line 282 of file ssvectorbase.h.
References SSVectorBase< R >::index(), SSVectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), and IdxSet::remove().
Referenced by SSVectorBase< R >::setValue().
int dim | ( | ) | const |
Dimension of VectorBase.
Definition at line 576 of file ssvectorbase.h.
References VectorBase< R >::dim().
Referenced by VectorBase< R >::assign(), SSVectorBase< R >::assign2product4setup(), SSVectorBase< R >::assign2productAndSetup(), SSVectorBase< R >::assignPWproduct4setup(), VectorBase< R >::multAdd(), VectorBase< R >::operator*(), VectorBase< R >::operator+=(), VectorBase< R >::operator-=(), SSVectorBase< R >::operator=(), SSVectorBase< R >::setup(), and SSVectorBase< R >::setup_and_assign().
void forceSetup | ( | ) |
Forces setup status.
Definition at line 175 of file ssvectorbase.h.
References SSVectorBase< R >::setupStatus.
R * get_ptr | ( | ) |
Only used in slufactor.hpp.
Definition at line 108 of file ssvectorbase.h.
References VectorBase< R >::get_ptr().
R getEpsilon | ( | ) | const |
Definition at line 132 of file ssvectorbase.h.
References SSVectorBase< R >::tolerances().
Referenced by SSVectorBase< R >::setup(), and SSVectorBase< R >::setValue().
int index | ( | int | n | ) | const |
Returns index of the n
'th nonzero element.
Definition at line 187 of file ssvectorbase.h.
References IdxSet::index(), and SSVectorBase< R >::isSetup().
Referenced by SSVectorBase< R >::clearNum(), VectorBase< Rational >::multAdd(), VectorBase< Rational >::multSub(), SSVectorBase< R >::operator*(), SSVectorBase< R >::operator*=(), VectorBase< R >::operator+=(), VectorBase< R >::operator-=(), SSVectorBase< R >::operator=(), SVectorBase< R >::operator=(), SSVectorBase< R >::reDim(), and SSVectorBase< R >::setup_and_assign().
const int * indexMem | ( | ) | const |
Returns array indices.
Definition at line 306 of file ssvectorbase.h.
References IdxSet::idx.
Referenced by VectorBase< R >::assign(), VectorBase< Rational >::assign(), and VectorBase< R >::multAdd().
const IdxSet & indices | ( | ) | const |
Returns indices.
Definition at line 318 of file ssvectorbase.h.
bool isConsistent | ( | ) | const |
consistency check.
Definition at line 633 of file ssvectorbase.h.
References IdxSet::dim(), IdxSet::isConsistent(), VectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), IdxSet::max(), SSVectorBase< R >::pos(), SPX_MSG_ERROR, SPX_MSG_INCONSISTENT, and soplex::spxAbs().
Referenced by SSVectorBase< R >::clear(), SSVectorBase< R >::clearIdx(), SSVectorBase< R >::clearNum(), SSVectorBase< R >::operator*=(), SSVectorBase< R >::operator=(), SSVectorBase< R >::reDim(), SSVectorBase< R >::reMem(), SSVectorBase< R >::scaleValue(), SSVectorBase< R >::setup(), SSVectorBase< R >::setup_and_assign(), SSVectorBase< R >::setValue(), and SSVectorBase< R >::SSVectorBase().
bool isSetup | ( | ) | const |
Returns setup status.
Definition at line 127 of file ssvectorbase.h.
References SSVectorBase< R >::setupStatus.
Referenced by VectorBase< R >::assign(), SSVectorBase< R >::assign2product1(), SSVectorBase< R >::assign2product4setup(), SSVectorBase< R >::assign2productAndSetup(), SSVectorBase< R >::assign2productFull(), SSVectorBase< R >::assign2productShort(), SSVectorBase< R >::assignPWproduct4setup(), SSVectorBase< R >::clear(), SSVectorBase< R >::clearIdx(), SSVectorBase< R >::clearNum(), SSVectorBase< R >::index(), SSVectorBase< R >::isConsistent(), SSVectorBase< R >::length2(), SSVectorBase< R >::maxAbs(), VectorBase< R >::multAdd(), SSVectorBase< R >::multAdd(), SSVectorBase< R >::operator*=(), VectorBase< R >::operator+=(), SSVectorBase< R >::operator+=(), VectorBase< R >::operator-=(), SSVectorBase< R >::operator-=(), SSVectorBase< R >::operator=(), SVectorBase< R >::operator=(), VectorBase< R >::operator=(), SSVectorBase< R >::pos(), SSVectorBase< R >::setup(), SSVectorBase< R >::setup_and_assign(), SSVectorBase< R >::setValue(), SSVectorBase< R >::size(), SPxBasisBase< R >::solve4update(), and SSVectorBase< R >::value().
R length | ( | ) | const |
Floating point approximation of euclidian norm (without any approximation guarantee).
Definition at line 564 of file ssvectorbase.h.
References SSVectorBase< R >::length2(), and soplex::spxSqrt().
R length2 | ( | ) | const |
Squared euclidian norm.
Definition at line 548 of file ssvectorbase.h.
References IdxSet::idx, SSVectorBase< R >::isSetup(), VectorBase< R >::length2(), and IdxSet::num.
Referenced by SSVectorBase< R >::length().
R maxAbs | ( | ) | const |
Maximum absolute value, i.e., infinity norm.
Definition at line 527 of file ssvectorbase.h.
References IdxSet::idx, SSVectorBase< R >::isSetup(), VectorBase< R >::maxAbs(), IdxSet::num, and soplex::spxAbs().
SSVectorBase< R > & multAdd | ( | S | x, |
const VectorBase< T > & | vec | ||
) |
Addition of a scaled vector.
Definition at line 494 of file ssvectorbase.h.
References SSVectorBase< R >::isSetup(), VectorBase< R >::multAdd(), SSVectorBase< R >::setup(), SSVectorBase< R >::setupStatus, and VectorBase< R >::vec().
SSVectorBase< R > & multAdd | ( | S | xx, |
const SVectorBase< T > & | vec | ||
) |
Addition of a scaled vector.
Definition at line 389 of file basevectors.h.
References SVectorBase< R >::size().
R operator* | ( | const SSVectorBase< S > & | w | ) |
Definition at line 444 of file ssvectorbase.h.
References SSVectorBase< R >::index(), SSVectorBase< R >::setup(), SSVectorBase< R >::size(), and VectorBase< R >::val.
SSVectorBase< R > & operator*= | ( | S | x | ) |
Scaling.
Definition at line 429 of file ssvectorbase.h.
References SSVectorBase< R >::index(), SSVectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), and SSVectorBase< R >::size().
SSVectorBase< R > & operator+= | ( | const SSVectorBase< S > & | vec | ) |
Addition.
Definition at line 371 of file ssvectorbase.h.
References SSVectorBase< R >::isSetup(), SSVectorBase< R >::setup(), SSVectorBase< R >::setupStatus, and VectorBase< R >::vec().
SSVectorBase< R > & operator+= | ( | const SVectorBase< S > & | vec | ) |
Addition.
Definition at line 350 of file basevectors.h.
SSVectorBase< R > & operator+= | ( | const VectorBase< S > & | vec | ) |
Addition.
Definition at line 352 of file ssvectorbase.h.
References SSVectorBase< R >::isSetup(), VectorBase< R >::operator+=(), SSVectorBase< R >::setup(), SSVectorBase< R >::setupStatus, and VectorBase< R >::vec().
SSVectorBase< R > & operator-= | ( | const SSVectorBase< S > & | vec | ) |
Subtraction.
Definition at line 408 of file ssvectorbase.h.
References SSVectorBase< R >::isSetup(), VectorBase< R >::operator-=(), SSVectorBase< R >::setup(), SSVectorBase< R >::setupStatus, and VectorBase< R >::vec().
SSVectorBase< R > & operator-= | ( | const SVectorBase< S > & | vec | ) |
Subtraction.
Definition at line 369 of file basevectors.h.
References VectorBase< R >::operator-=().
SSVectorBase< R > & operator-= | ( | const VectorBase< S > & | vec | ) |
Subtraction.
Definition at line 389 of file ssvectorbase.h.
References SSVectorBase< R >::isSetup(), VectorBase< R >::operator-=(), SSVectorBase< R >::setup(), SSVectorBase< R >::setupStatus, and VectorBase< R >::vec().
SSVectorBase< R > & operator= | ( | const SSVectorBase< R > & | rhs | ) |
Assignment operator.
Definition at line 834 of file ssvectorbase.h.
References SSVectorBase< R >::_tolerances, SSVectorBase< R >::clear(), SSVectorBase< R >::dim(), IdxSet::idx, SSVectorBase< R >::index(), SSVectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), IdxSet::max(), IdxSet::num, IdxSet::operator=(), VectorBase< R >::reDim(), SSVectorBase< R >::setMax(), SSVectorBase< R >::setupStatus, SSVectorBase< R >::size(), soplex::spxAbs(), and VectorBase< R >::val.
SSVectorBase< R > & operator= | ( | const SSVectorBase< S > & | rhs | ) |
Assignment operator.
Definition at line 788 of file ssvectorbase.h.
References SSVectorBase< R >::_tolerances, SSVectorBase< R >::clear(), SSVectorBase< R >::dim(), IdxSet::idx, SSVectorBase< R >::index(), SSVectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), IdxSet::max(), IdxSet::num, IdxSet::operator=(), VectorBase< R >::reDim(), SSVectorBase< R >::setMax(), SSVectorBase< R >::setupStatus, SSVectorBase< R >::size(), soplex::spxAbs(), and VectorBase< R >::val.
SSVectorBase< R > & operator= | ( | const SVectorBase< S > & | rhs | ) |
Assignment operator.
Definition at line 932 of file basevectors.h.
SSVectorBase< R > & operator= | ( | const VectorBase< S > & | rhs | ) |
Assignment operator.
Definition at line 884 of file ssvectorbase.h.
References SSVectorBase< R >::isConsistent(), VectorBase< R >::operator=(), and SSVectorBase< R >::unSetup().
R operator[] | ( | int | i | ) | const |
Returns i
'th value.
Definition at line 300 of file ssvectorbase.h.
int pos | ( | int | i | ) | const |
Finds the position of index i
in the IdxSet, or -1 if i
doesn't exist.
Definition at line 204 of file ssvectorbase.h.
References SSVectorBase< R >::isSetup(), and IdxSet::pos().
Referenced by SSVectorBase< R >::add(), SSVectorBase< R >::clearIdx(), SSVectorBase< R >::isConsistent(), and SSVectorBase< R >::setValue().
void reDim | ( | int | newdim | ) |
Resets dimension to newdim
.
Definition at line 582 of file ssvectorbase.h.
References SSVectorBase< R >::index(), SSVectorBase< R >::isConsistent(), VectorBase< R >::reDim(), IdxSet::remove(), SSVectorBase< R >::setMax(), and IdxSet::size().
void reMem | ( | int | newsize | ) |
Resets memory consumption to newsize
.
Definition at line 607 of file ssvectorbase.h.
References SSVectorBase< R >::isConsistent(), VectorBase< R >::reSize(), and SSVectorBase< R >::setMax().
void scaleValue | ( | int | i, |
int | scaleExp | ||
) |
Scale i
'th element by a.
Definition at line 255 of file ssvectorbase.h.
References SSVectorBase< R >::isConsistent(), and soplex::spxLdexp().
|
private |
Allocates enough space to accommodate newmax
values.
Definition at line 71 of file ssvectorbase.h.
References IdxSet::idx, IdxSet::len, IdxSet::size(), and soplex::spx_realloc().
Referenced by SSVectorBase< R >::operator=(), SSVectorBase< R >::reDim(), SSVectorBase< R >::reMem(), and SSVectorBase< R >::setup_and_assign().
void setSize | ( | int | n | ) |
Sets number of nonzeros (thereby unSetup SSVectorBase).
Definition at line 597 of file ssvectorbase.h.
References IdxSet::max(), IdxSet::num, and SSVectorBase< R >::unSetup().
|
virtual |
set the _tolerances member variable
Definition at line 114 of file ssvectorbase.h.
Referenced by SLUFactor< R >::setTolerances().
void setup | ( | ) |
Initializes nonzero indices for elements with absolute values above epsilon and sets all other elements to 0.
Definition at line 145 of file ssvectorbase.h.
References IdxSet::clear(), SSVectorBase< R >::dim(), SSVectorBase< R >::getEpsilon(), IdxSet::idx, SSVectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), IdxSet::num, SSVectorBase< R >::setupStatus, and soplex::spxAbs().
Referenced by SSVectorBase< R >::multAdd(), SSVectorBase< R >::operator*(), SSVectorBase< R >::operator+=(), and SSVectorBase< R >::operator-=().
void setup_and_assign | ( | SSVectorBase< S > & | rhs | ) |
Sets up rhs
vector, and assigns it.
Definition at line 734 of file ssvectorbase.h.
References SSVectorBase< R >::_tolerances, SSVectorBase< R >::clear(), SSVectorBase< R >::dim(), IdxSet::idx, SSVectorBase< R >::index(), SSVectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), IdxSet::max(), IdxSet::num, IdxSet::operator=(), VectorBase< R >::reDim(), SSVectorBase< R >::setMax(), SSVectorBase< R >::setupStatus, SSVectorBase< R >::size(), soplex::spxAbs(), SSVectorBase< R >::tolerances(), and VectorBase< R >::val.
void setValue | ( | int | i, |
R | x | ||
) |
Sets i
'th element to x
.
Definition at line 231 of file ssvectorbase.h.
References IdxSet::add(), SSVectorBase< R >::clearNum(), SSVectorBase< R >::getEpsilon(), SSVectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), SSVectorBase< R >::pos(), and soplex::spxAbs().
int size | ( | ) | const |
Returns the number of nonzeros.
Definition at line 212 of file ssvectorbase.h.
References SSVectorBase< R >::isSetup(), and IdxSet::size().
Referenced by VectorBase< R >::assign(), SSVectorBase< R >::assign2product1(), SSVectorBase< R >::assign2productFull(), SSVectorBase< R >::assign2productShort(), SSVectorBase< R >::assignPWproduct4setup(), DSVectorBase< R >::DSVectorBase(), VectorBase< R >::multAdd(), SSVectorBase< R >::operator*(), SSVectorBase< R >::operator*=(), VectorBase< R >::operator+=(), VectorBase< R >::operator-=(), SSVectorBase< R >::operator=(), SVectorBase< R >::operator=(), DSVectorBase< R >::operator=(), SSVectorBase< R >::setup_and_assign(), and SSVectorBase< R >::value().
const std::shared_ptr< Tolerances > & tolerances | ( | ) | const |
returns current tolerances
Definition at line 120 of file ssvectorbase.h.
References SSVectorBase< R >::_tolerances.
Referenced by SSVectorBase< R >::getEpsilon(), and SSVectorBase< R >::setup_and_assign().
void unSetup | ( | ) |
Makes SSVectorBase not setup.
Definition at line 139 of file ssvectorbase.h.
References SSVectorBase< R >::setupStatus.
Referenced by SSVectorBase< R >::altIndexMem(), SSVectorBase< R >::altIndices(), SSVectorBase< R >::altValues(), SSVectorBase< R >::operator=(), SSVectorBase< R >::setSize(), SLUFactor< R >::solveLeft(), and SLUFactor< R >::solveRight().
R value | ( | int | n | ) | const |
Returns value of the n
'th nonzero element.
Definition at line 195 of file ssvectorbase.h.
References IdxSet::idx, SSVectorBase< R >::isSetup(), and SSVectorBase< R >::size().
Referenced by VectorBase< R >::operator+=(), VectorBase< R >::operator-=(), and SVectorBase< R >::operator=().
const R * values | ( | ) | const |
Returns array values.
Definition at line 312 of file ssvectorbase.h.
|
friend |
Definition at line 61 of file ssvectorbase.h.
|
friend |
Definition at line 1 of file ssvectorbase.h.
|
protected |
Definition at line 84 of file ssvectorbase.h.
Referenced by SSVectorBase< R >::operator=(), SSVectorBase< R >::setup_and_assign(), SSVectorBase< R >::SSVectorBase(), and SSVectorBase< R >::tolerances().
|
private |
Is the SSVectorBase set up?
Definition at line 68 of file ssvectorbase.h.
Referenced by SSVectorBase< R >::assign2productAndSetup(), SSVectorBase< R >::clear(), SSVectorBase< R >::forceSetup(), SSVectorBase< R >::isSetup(), SSVectorBase< R >::multAdd(), SSVectorBase< R >::operator+=(), SSVectorBase< R >::operator-=(), SSVectorBase< R >::operator=(), SSVectorBase< R >::setup(), SSVectorBase< R >::setup_and_assign(), and SSVectorBase< R >::unSetup().