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... | |
R | getEpsilon () const |
Returns the non-zero epsilon used. More... | |
void | setEpsilon (R eps) |
Changes the non-zero epsilon, invalidating the setup. */. More... | |
bool | isSetup () const |
Returns setup status. More... | |
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, R p_eps=Param::epsilon()) | |
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, R eps=Param::epsilon()) | |
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 |
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... | |
R | epsilon |
A value x with |x| < epsilon is considered zero. 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... | |
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... | |
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 29 of file dsvectorbase.h.
|
explicit |
Default constructor.
Definition at line 662 of file ssvectorbase.h.
SSVectorBase | ( | const SSVectorBase< S > & | vec | ) |
Copy constructor.
Definition at line 677 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 694 of file ssvectorbase.h.
|
explicit |
Constructs nonsetup copy of vec
.
Definition at line 709 of file ssvectorbase.h.
~SSVectorBase | ( | ) |
destructor
Definition at line 884 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 209 of file ssvectorbase.h.
int* altIndexMem | ( | ) |
Returns array indices.
Definition at line 312 of file ssvectorbase.h.
IdxSet& altIndices | ( | ) |
Returns indices.
Definition at line 326 of file ssvectorbase.h.
R* altValues | ( | ) |
Returns array values.
Definition at line 319 of file ssvectorbase.h.
SSVectorBase< R > & assign | ( | const SVectorBase< S > & | rhs | ) |
Assigns only the elements of rhs
.
Definition at line 855 of file basevectors.h.
Referenced by SSVectorBase< Rational >::setup_and_assign().
SSVectorBase< Rational > & assign | ( | const SVectorBase< Rational > & | rhs | ) |
Assigns only the elements of rhs
.
Definition at line 889 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 511 of file basevectors.h.
Referenced by SSVectorBase< Rational >::multAdd().
|
private |
Assignment helper.
Definition at line 603 of file basevectors.h.
Referenced by SSVectorBase< Rational >::~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 542 of file basevectors.h.
Referenced by SSVectorBase< Rational >::multAdd().
SSVectorBase< R > & assign2productAndSetup | ( | const SVSetBase< S > & | A, |
SSVectorBase< T > & | x | ||
) |
Assigns SSVectorBase to \(A \cdot x\) thereby setting up x
.
Definition at line 797 of file basevectors.h.
Referenced by SSVectorBase< Rational >::multAdd().
|
private |
Assignment helper.
Definition at line 753 of file basevectors.h.
Referenced by SSVectorBase< Rational >::~SSVectorBase().
|
private |
Assignment helper.
Definition at line 639 of file basevectors.h.
Referenced by SSVectorBase< Rational >::~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 450 of file basevectors.h.
Referenced by SSVectorBase< Rational >::multAdd().
void clear | ( | ) |
Clears vector.
Definition at line 604 of file ssvectorbase.h.
Referenced by UpdateVector< R >::clearUpdate(), SPxBasisBase< R >::coSolve(), SLUFactorRational::operator=(), SSVectorBase< Rational >::operator=(), SSVectorBase< Rational >::setup_and_assign(), SPxBasisBase< R >::solve(), and SPxBasisBase< R >::solve4update().
void clearIdx | ( | int | i | ) |
Clears element i
.
Definition at line 254 of file ssvectorbase.h.
void clearNum | ( | int | n | ) |
Sets n
'th nonzero element to 0 (index n
must exist).
Definition at line 270 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::setValue().
int dim | ( | ) | const |
Dimension of VectorBase.
Definition at line 564 of file ssvectorbase.h.
Referenced by VectorBase< Rational >::assign(), SSVectorBase< Rational >::assign2product4setup(), SSVectorBase< Rational >::assign2productAndSetup(), SSVectorBase< Rational >::assignPWproduct4setup(), VectorBase< Rational >::multAdd(), VectorBase< Rational >::operator*(), VectorBase< Rational >::operator+=(), VectorBase< Rational >::operator-=(), SSVectorBase< Rational >::operator=(), SSVectorBase< Rational >::setup(), SSVectorBase< Rational >::setup_and_assign(), and SSVectorBase< Rational >::SSVectorBase().
void forceSetup | ( | ) |
Forces setup status.
Definition at line 163 of file ssvectorbase.h.
R* get_ptr | ( | ) |
Only used in slufactor.hpp.
Definition at line 100 of file ssvectorbase.h.
R getEpsilon | ( | ) | const |
Returns the non-zero epsilon used.
Definition at line 105 of file ssvectorbase.h.
int index | ( | int | n | ) | const |
Returns index of the n
'th nonzero element.
Definition at line 175 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::assignPWproduct4setup(), SSVectorBase< Rational >::clearNum(), SSVectorBase< Rational >::operator*(), SSVectorBase< Rational >::operator*=(), VectorBase< Rational >::operator+=(), SSVectorBase< Rational >::operator+=(), VectorBase< Rational >::operator-=(), SSVectorBase< Rational >::operator-=(), SVectorBase< Rational >::operator=(), SSVectorBase< Rational >::operator=(), SSVectorBase< Rational >::reDim(), and SSVectorBase< Rational >::setup_and_assign().
const int* indexMem | ( | ) | const |
Returns array indices.
Definition at line 294 of file ssvectorbase.h.
Referenced by VectorBase< Rational >::assign(), VectorBase< Rational >::multAdd(), and VectorBase< Rational >::operator*().
const IdxSet& indices | ( | ) | const |
Returns indices.
Definition at line 306 of file ssvectorbase.h.
Referenced by UpdateVector< R >::idx().
bool isConsistent | ( | ) | const |
consistency check.
Definition at line 621 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::clear(), SSVectorBase< Rational >::clearIdx(), SSVectorBase< Rational >::clearNum(), SSVectorBase< Rational >::operator*=(), SSVectorBase< Rational >::operator=(), SSVectorBase< Rational >::reDim(), SSVectorBase< Rational >::reMem(), SSVectorBase< Rational >::scaleValue(), SSVectorBase< Rational >::setup(), SSVectorBase< Rational >::setup_and_assign(), SSVectorBase< Rational >::setValue(), and SSVectorBase< Rational >::SSVectorBase().
bool isSetup | ( | ) | const |
Returns setup status.
Definition at line 121 of file ssvectorbase.h.
Referenced by VectorBase< Rational >::assign(), SSVectorBase< Rational >::assign2product1(), SSVectorBase< Rational >::assign2product4setup(), SSVectorBase< Rational >::assign2productAndSetup(), SSVectorBase< Rational >::assign2productFull(), SSVectorBase< Rational >::assign2productShort(), SSVectorBase< Rational >::assignPWproduct4setup(), SSVectorBase< Rational >::clear(), SSVectorBase< Rational >::clearIdx(), SSVectorBase< Rational >::clearNum(), SSVectorBase< Rational >::index(), SSVectorBase< Rational >::isConsistent(), SSVectorBase< Rational >::length2(), SSVectorBase< Rational >::maxAbs(), VectorBase< Rational >::multAdd(), SSVectorBase< Rational >::multAdd(), VectorBase< Rational >::operator*(), SSVectorBase< Rational >::operator*=(), VectorBase< Rational >::operator+=(), SSVectorBase< Rational >::operator+=(), VectorBase< Rational >::operator-=(), SSVectorBase< Rational >::operator-=(), VectorBase< Rational >::operator=(), SVectorBase< Rational >::operator=(), SSVectorBase< Rational >::operator=(), SSVectorBase< Rational >::pos(), SSVectorBase< Rational >::setup(), SSVectorBase< Rational >::setup_and_assign(), SSVectorBase< Rational >::setValue(), SSVectorBase< Rational >::size(), SPxBasisBase< R >::solve4update(), and SSVectorBase< Rational >::value().
R length | ( | ) | const |
Floating point approximation of euclidian norm (without any approximation guarantee).
Definition at line 552 of file ssvectorbase.h.
R length2 | ( | ) | const |
Squared euclidian norm.
Definition at line 536 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::length().
R maxAbs | ( | ) | const |
Maximum absolute value, i.e., infinity norm.
Definition at line 515 of file ssvectorbase.h.
SSVectorBase< R > & multAdd | ( | S | xx, |
const SVectorBase< T > & | vec | ||
) |
Addition of a scaled vector.
Definition at line 381 of file basevectors.h.
Referenced by SSVectorBase< Rational >::operator*().
SSVectorBase<R>& multAdd | ( | S | x, |
const VectorBase< T > & | vec | ||
) |
Addition of a scaled vector.
Definition at line 482 of file ssvectorbase.h.
R operator* | ( | const SSVectorBase< S > & | w | ) |
Definition at line 432 of file ssvectorbase.h.
SSVectorBase<R>& operator*= | ( | S | x | ) |
Scaling.
Definition at line 417 of file ssvectorbase.h.
SSVectorBase<R>& operator+= | ( | const VectorBase< S > & | vec | ) |
Addition.
Definition at line 340 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::operator+=().
SSVectorBase< R > & operator+= | ( | const SVectorBase< S > & | vec | ) |
Addition.
Definition at line 342 of file basevectors.h.
SSVectorBase<R>& operator+= | ( | const SSVectorBase< S > & | vec | ) |
Addition.
Definition at line 359 of file ssvectorbase.h.
SSVectorBase<R>& operator-= | ( | const VectorBase< S > & | vec | ) |
Subtraction.
Definition at line 377 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::operator-=().
SSVectorBase< R > & operator-= | ( | const SVectorBase< S > & | vec | ) |
Subtraction.
Definition at line 361 of file basevectors.h.
SSVectorBase<R>& operator-= | ( | const SSVectorBase< S > & | vec | ) |
Subtraction.
Definition at line 396 of file ssvectorbase.h.
SSVectorBase<R>& operator= | ( | const SSVectorBase< S > & | rhs | ) |
Assignment operator.
Definition at line 777 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::operator=().
SSVectorBase<R>& operator= | ( | const SSVectorBase< R > & | rhs | ) |
Assignment operator.
Definition at line 823 of file ssvectorbase.h.
SSVectorBase< R > & operator= | ( | const SVectorBase< S > & | rhs | ) |
Assignment operator.
Definition at line 923 of file basevectors.h.
SSVectorBase<R>& operator= | ( | const VectorBase< S > & | rhs | ) |
Assignment operator.
Definition at line 873 of file ssvectorbase.h.
R operator[] | ( | int | i | ) | const |
Returns i
'th value.
Definition at line 288 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 192 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::add(), SSVectorBase< Rational >::clearIdx(), SSVectorBase< Rational >::isConsistent(), and SSVectorBase< Rational >::setValue().
void reDim | ( | int | newdim | ) |
Resets dimension to newdim
.
Definition at line 570 of file ssvectorbase.h.
Referenced by UpdateVector< R >::reDim().
void reMem | ( | int | newsize | ) |
Resets memory consumption to newsize
.
Definition at line 595 of file ssvectorbase.h.
void scaleValue | ( | int | i, |
int | scaleExp | ||
) |
Scale i
'th element by a.
Definition at line 243 of file ssvectorbase.h.
void setEpsilon | ( | R | eps | ) |
Changes the non-zero epsilon, invalidating the setup. */.
Definition at line 111 of file ssvectorbase.h.
|
private |
Allocates enough space to accommodate newmax
values.
Definition at line 66 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::operator=(), SSVectorBase< Rational >::reDim(), SSVectorBase< Rational >::reMem(), and SSVectorBase< Rational >::setup_and_assign().
void setSize | ( | int | n | ) |
Sets number of nonzeros (thereby unSetup SSVectorBase).
Definition at line 585 of file ssvectorbase.h.
void setup | ( | ) |
Initializes nonzero indices for elements with absolute values above epsilon and sets all other elements to 0.
Definition at line 133 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::multAdd(), SSVectorBase< Rational >::operator*(), SSVectorBase< Rational >::operator+=(), and SSVectorBase< Rational >::operator-=().
void setup_and_assign | ( | SSVectorBase< S > & | rhs | ) |
Sets up rhs
vector, and assigns it.
Definition at line 723 of file ssvectorbase.h.
void setValue | ( | int | i, |
R | x | ||
) |
Sets i
'th element to x
.
Definition at line 219 of file ssvectorbase.h.
int size | ( | ) | const |
Returns the number of nonzeros.
Definition at line 200 of file ssvectorbase.h.
Referenced by VectorBase< Rational >::assign(), SSVectorBase< Rational >::assign2product1(), SSVectorBase< Rational >::assign2product4setup(), SSVectorBase< Rational >::assign2productFull(), SSVectorBase< Rational >::assign2productShort(), SSVectorBase< Rational >::assignPWproduct4setup(), DSVectorBase< Rational >::DSVectorBase(), VectorBase< Rational >::multAdd(), VectorBase< Rational >::operator*(), SSVectorBase< Rational >::operator*(), SSVectorBase< Rational >::operator*=(), VectorBase< Rational >::operator+=(), SSVectorBase< Rational >::operator+=(), VectorBase< Rational >::operator-=(), SSVectorBase< Rational >::operator-=(), DSVectorBase< Rational >::operator=(), SVectorBase< Rational >::operator=(), SSVectorBase< Rational >::operator=(), SSVectorBase< Rational >::setup_and_assign(), and SSVectorBase< Rational >::value().
void unSetup | ( | ) |
Makes SSVectorBase not setup.
Definition at line 127 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::altIndexMem(), SSVectorBase< Rational >::altIndices(), SSVectorBase< Rational >::altValues(), SSVectorBase< Rational >::operator=(), SSVectorBase< Rational >::setSize(), SLUFactor< R >::solveLeft(), and SLUFactor< R >::solveRight().
R value | ( | int | n | ) | const |
Returns value of the n
'th nonzero element.
Definition at line 183 of file ssvectorbase.h.
Referenced by VectorBase< Rational >::operator+=(), SSVectorBase< Rational >::operator+=(), VectorBase< Rational >::operator-=(), SSVectorBase< Rational >::operator-=(), and SVectorBase< Rational >::operator=().
const R* values | ( | ) | const |
Returns array values.
Definition at line 300 of file ssvectorbase.h.
|
friend |
Definition at line 53 of file ssvectorbase.h.
|
friend |
Definition at line 52 of file ssvectorbase.h.
|
private |
A value x with |x| < epsilon is considered zero.
Definition at line 63 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::getEpsilon(), SSVectorBase< Rational >::operator=(), and SSVectorBase< Rational >::setup_and_assign().
|
private |
Is the SSVectorBase set up?
Definition at line 60 of file ssvectorbase.h.
Referenced by SSVectorBase< Rational >::assign2productAndSetup(), SSVectorBase< Rational >::isSetup(), and SSVectorBase< Rational >::setup_and_assign().