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 > #epsilon 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. More...
#include <dsvectorbase.h>
Public Member Functions | |
template<> | |
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... | |
template<> | |
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 > #epsilon 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 38 of file dsvectorbase.h.
|
explicit |
Default constructor.
Definition at line 674 of file ssvectorbase.h.
SSVectorBase | ( | const SSVectorBase< S > & | vec | ) |
Copy constructor.
Definition at line 689 of file ssvectorbase.h.
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.
|
explicit |
Constructs nonsetup copy of vec
.
Definition at line 721 of file ssvectorbase.h.
~SSVectorBase | ( | ) |
destructor
Definition at line 895 of file ssvectorbase.h.
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.
int* altIndexMem | ( | ) |
Returns array indices.
Definition at line 324 of file ssvectorbase.h.
IdxSet& altIndices | ( | ) |
Returns indices.
Definition at line 338 of file ssvectorbase.h.
R* altValues | ( | ) |
Returns array values.
Definition at line 331 of file ssvectorbase.h.
SSVectorBase< R > & assign | ( | const SVectorBase< S > & | rhs | ) |
Assigns only the elements of rhs
.
Definition at line 864 of file basevectors.h.
Referenced by SSVectorBase< BP >::setup_and_assign().
SSVectorBase< Rational > & assign | ( | const SVectorBase< Rational > & | rhs | ) |
Assigns only the elements of rhs
.
Definition at line 898 of file basevectors.h.
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.
Referenced by SSVectorBase< BP >::multAdd().
|
private |
Assignment helper.
Definition at line 612 of file basevectors.h.
Referenced by SSVectorBase< BP >::~SSVectorBase().
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.
Referenced by SSVectorBase< BP >::multAdd().
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.
Referenced by SSVectorBase< BP >::multAdd().
|
private |
Assignment helper.
Definition at line 762 of file basevectors.h.
Referenced by SSVectorBase< BP >::~SSVectorBase().
|
private |
Assignment helper.
Definition at line 648 of file basevectors.h.
Referenced by SSVectorBase< BP >::~SSVectorBase().
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.
Referenced by SSVectorBase< BP >::multAdd().
void clear | ( | ) |
Clears vector.
Definition at line 616 of file ssvectorbase.h.
Referenced by UpdateVector< BP >::clearUpdate(), SPxBasisBase< BP >::coSolve(), SLUFactorRational::operator=(), SSVectorBase< BP >::operator=(), SSVectorBase< BP >::setup_and_assign(), SPxBasisBase< BP >::solve(), and SPxBasisBase< BP >::solve4update().
void clearIdx | ( | int | i | ) |
Clears element i
.
Definition at line 266 of file ssvectorbase.h.
void clearNum | ( | int | n | ) |
Sets n
'th nonzero element to 0 (index n
must exist).
Definition at line 282 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::setValue().
int dim | ( | ) | const |
Dimension of VectorBase.
Definition at line 576 of file ssvectorbase.h.
Referenced by VectorBase< BP >::assign(), SSVectorBase< BP >::assign2product4setup(), SSVectorBase< BP >::assign2productAndSetup(), SSVectorBase< BP >::assignPWproduct4setup(), VectorBase< BP >::multAdd(), VectorBase< BP >::operator*(), VectorBase< BP >::operator+=(), VectorBase< BP >::operator-=(), SSVectorBase< BP >::operator=(), SSVectorBase< BP >::setup(), SSVectorBase< BP >::setup_and_assign(), and SSVectorBase< BP >::SSVectorBase().
void forceSetup | ( | ) |
Forces setup status.
Definition at line 175 of file ssvectorbase.h.
R* get_ptr | ( | ) |
Only used in slufactor.hpp.
Definition at line 108 of file ssvectorbase.h.
R getEpsilon | ( | ) | const |
Definition at line 132 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::operator=(), SSVectorBase< BP >::setup(), and SSVectorBase< BP >::setValue().
int index | ( | int | n | ) | const |
Returns index of the n
'th nonzero element.
Definition at line 187 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::assignPWproduct4setup(), SSVectorBase< BP >::clearNum(), SSVectorBase< BP >::operator*(), SSVectorBase< BP >::operator*=(), VectorBase< BP >::operator+=(), SSVectorBase< BP >::operator+=(), VectorBase< BP >::operator-=(), SSVectorBase< BP >::operator-=(), SVectorBase< BP >::operator=(), SSVectorBase< BP >::operator=(), SSVectorBase< BP >::reDim(), and SSVectorBase< BP >::setup_and_assign().
const int* indexMem | ( | ) | const |
Returns array indices.
Definition at line 306 of file ssvectorbase.h.
Referenced by VectorBase< BP >::assign(), VectorBase< BP >::multAdd(), and VectorBase< BP >::operator*().
const IdxSet& indices | ( | ) | const |
Returns indices.
Definition at line 318 of file ssvectorbase.h.
Referenced by UpdateVector< BP >::idx().
bool isConsistent | ( | ) | const |
consistency check.
Definition at line 633 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::clear(), SSVectorBase< BP >::clearIdx(), SSVectorBase< BP >::clearNum(), SSVectorBase< BP >::operator*=(), SSVectorBase< BP >::operator=(), SSVectorBase< BP >::reDim(), SSVectorBase< BP >::reMem(), SSVectorBase< BP >::scaleValue(), SSVectorBase< BP >::setup(), SSVectorBase< BP >::setup_and_assign(), SSVectorBase< BP >::setValue(), and SSVectorBase< BP >::SSVectorBase().
bool isSetup | ( | ) | const |
Returns setup status.
Definition at line 127 of file ssvectorbase.h.
Referenced by VectorBase< BP >::assign(), SSVectorBase< BP >::assign2product1(), SSVectorBase< BP >::assign2product4setup(), SSVectorBase< BP >::assign2productAndSetup(), SSVectorBase< BP >::assign2productFull(), SSVectorBase< BP >::assign2productShort(), SSVectorBase< BP >::assignPWproduct4setup(), SSVectorBase< BP >::clear(), SSVectorBase< BP >::clearIdx(), SSVectorBase< BP >::clearNum(), SSVectorBase< BP >::index(), SSVectorBase< BP >::isConsistent(), SSVectorBase< BP >::length2(), SSVectorBase< BP >::maxAbs(), VectorBase< BP >::multAdd(), SSVectorBase< BP >::multAdd(), VectorBase< BP >::operator*(), SSVectorBase< BP >::operator*=(), VectorBase< BP >::operator+=(), SSVectorBase< BP >::operator+=(), VectorBase< BP >::operator-=(), SSVectorBase< BP >::operator-=(), VectorBase< BP >::operator=(), SVectorBase< BP >::operator=(), SSVectorBase< BP >::operator=(), SSVectorBase< BP >::pos(), SSVectorBase< BP >::setup(), SSVectorBase< BP >::setup_and_assign(), SSVectorBase< BP >::setValue(), SSVectorBase< BP >::size(), SPxBasisBase< BP >::solve4update(), and SSVectorBase< BP >::value().
R length | ( | ) | const |
Floating point approximation of euclidian norm (without any approximation guarantee).
Definition at line 564 of file ssvectorbase.h.
R length2 | ( | ) | const |
Squared euclidian norm.
Definition at line 548 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::length().
R maxAbs | ( | ) | const |
Maximum absolute value, i.e., infinity norm.
Definition at line 527 of file ssvectorbase.h.
SSVectorBase< R > & multAdd | ( | S | xx, |
const SVectorBase< T > & | vec | ||
) |
Addition of a scaled vector.
Definition at line 389 of file basevectors.h.
Referenced by SSVectorBase< BP >::operator*().
SSVectorBase<R>& multAdd | ( | S | x, |
const VectorBase< T > & | vec | ||
) |
Addition of a scaled vector.
Definition at line 494 of file ssvectorbase.h.
R operator* | ( | const SSVectorBase< S > & | w | ) |
Definition at line 444 of file ssvectorbase.h.
SSVectorBase<R>& operator*= | ( | S | x | ) |
Scaling.
Definition at line 429 of file ssvectorbase.h.
SSVectorBase<R>& operator+= | ( | const VectorBase< S > & | vec | ) |
Addition.
Definition at line 352 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::operator+=().
SSVectorBase< R > & operator+= | ( | const SVectorBase< S > & | vec | ) |
Addition.
Definition at line 350 of file basevectors.h.
SSVectorBase<R>& operator+= | ( | const SSVectorBase< S > & | vec | ) |
Addition.
Definition at line 371 of file ssvectorbase.h.
SSVectorBase<R>& operator-= | ( | const VectorBase< S > & | vec | ) |
Subtraction.
Definition at line 389 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::operator-=().
SSVectorBase< R > & operator-= | ( | const SVectorBase< S > & | vec | ) |
Subtraction.
Definition at line 369 of file basevectors.h.
SSVectorBase<R>& operator-= | ( | const SSVectorBase< S > & | vec | ) |
Subtraction.
Definition at line 408 of file ssvectorbase.h.
SSVectorBase<R>& operator= | ( | const SSVectorBase< S > & | rhs | ) |
Assignment operator.
Definition at line 788 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::operator=().
SSVectorBase<R>& operator= | ( | const SSVectorBase< R > & | rhs | ) |
Assignment operator.
Definition at line 834 of file ssvectorbase.h.
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.
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.
Referenced by SSVectorBase< BP >::add(), SSVectorBase< BP >::clearIdx(), SSVectorBase< BP >::isConsistent(), and SSVectorBase< BP >::setValue().
void reDim | ( | int | newdim | ) |
Resets dimension to newdim
.
Definition at line 582 of file ssvectorbase.h.
Referenced by UpdateVector< BP >::reDim().
void reMem | ( | int | newsize | ) |
Resets memory consumption to newsize
.
Definition at line 607 of file ssvectorbase.h.
void scaleValue | ( | int | i, |
int | scaleExp | ||
) |
Scale i
'th element by a.
Definition at line 255 of file ssvectorbase.h.
|
private |
Allocates enough space to accommodate newmax
values.
Definition at line 71 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::operator=(), SSVectorBase< BP >::reDim(), SSVectorBase< BP >::reMem(), and SSVectorBase< BP >::setup_and_assign().
void setSize | ( | int | n | ) |
Sets number of nonzeros (thereby unSetup SSVectorBase).
Definition at line 597 of file ssvectorbase.h.
|
virtual |
set the _tolerances member variable
Definition at line 114 of file ssvectorbase.h.
Referenced by UpdateVector< BP >::setTolerances(), and SLUFactor< BP >::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.
Referenced by SSVectorBase< BP >::multAdd(), SSVectorBase< BP >::operator*(), SSVectorBase< BP >::operator+=(), and SSVectorBase< BP >::operator-=().
void setup_and_assign | ( | SSVectorBase< S > & | rhs | ) |
Sets up rhs
vector, and assigns it.
Definition at line 734 of file ssvectorbase.h.
void setValue | ( | int | i, |
R | x | ||
) |
Sets i
'th element to x
.
Definition at line 231 of file ssvectorbase.h.
int size | ( | ) | const |
Returns the number of nonzeros.
Definition at line 212 of file ssvectorbase.h.
Referenced by VectorBase< BP >::assign(), SSVectorBase< BP >::assign2product1(), SSVectorBase< BP >::assign2product4setup(), SSVectorBase< BP >::assign2productFull(), SSVectorBase< BP >::assign2productShort(), SSVectorBase< BP >::assignPWproduct4setup(), DSVectorBase< BP >::DSVectorBase(), VectorBase< BP >::multAdd(), VectorBase< BP >::operator*(), SSVectorBase< BP >::operator*(), SSVectorBase< BP >::operator*=(), VectorBase< BP >::operator+=(), SSVectorBase< BP >::operator+=(), VectorBase< BP >::operator-=(), SSVectorBase< BP >::operator-=(), DSVectorBase< BP >::operator=(), SVectorBase< BP >::operator=(), SSVectorBase< BP >::operator=(), SSVectorBase< BP >::setup_and_assign(), and SSVectorBase< BP >::value().
const std::shared_ptr<Tolerances>& tolerances | ( | ) | const |
returns current tolerances
Definition at line 120 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::getEpsilon(), and SSVectorBase< BP >::setup_and_assign().
void unSetup | ( | ) |
Makes SSVectorBase not setup.
Definition at line 139 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::altIndexMem(), SSVectorBase< BP >::altIndices(), SSVectorBase< BP >::altValues(), SSVectorBase< BP >::operator=(), SSVectorBase< BP >::setSize(), SLUFactor< BP >::solveLeft(), and SLUFactor< BP >::solveRight().
R value | ( | int | n | ) | const |
Returns value of the n
'th nonzero element.
Definition at line 195 of file ssvectorbase.h.
Referenced by VectorBase< BP >::operator+=(), SSVectorBase< BP >::operator+=(), VectorBase< BP >::operator-=(), SSVectorBase< BP >::operator-=(), and SVectorBase< BP >::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 60 of file ssvectorbase.h.
|
protected |
Definition at line 84 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::operator=(), SSVectorBase< BP >::SSVectorBase(), and SSVectorBase< BP >::tolerances().
|
private |
Is the SSVectorBase set up?
Definition at line 68 of file ssvectorbase.h.
Referenced by SSVectorBase< BP >::assign2productAndSetup(), SSVectorBase< BP >::isSetup(), and SSVectorBase< BP >::setup_and_assign().