Loading...
Searching...
No Matches
ssvectorbase.h
Go to the documentation of this file.
48 * This class implements semi-sparse vectors. Such are #VectorBase%s where the indices of its nonzero elements can be
49 * stored in an extra IdxSet. Only elements with absolute value > #getEpsilon() are considered to be nonzero. Since really
50 * storing the nonzeros is not always convenient, an SSVectorBase provides two different stati: setup and not setup.
51 * An SSVectorBase being setup means that the nonzero indices are available, otherwise an SSVectorBase is just an
52 * ordinary VectorBase with an empty IdxSet. Note that due to arithmetic operation, zeros can slip in, i.e., it is
63 // ------------------------------------------------------------------------------------------------------------------
88 // ------------------------------------------------------------------------------------------------------------------
91 * An SSVectorBase can be set up or not. In case it is set up, its IdxSet correctly contains all indices of nonzero
92 * elements of the SSVectorBase. Otherwise, it does not contain any useful data. Whether or not an SSVectorBase is
99 * - setup(): This method initializes the IdxSet to the SSVectorBase's nonzero indices and sets the status to
102 * - forceSetup(): This method sets the status to ``setup'' without verifying that the IdxSet correctly contains all
144 /// Initializes nonzero indices for elements with absolute values above epsilon and sets all other elements to 0.
182 // ------------------------------------------------------------------------------------------------------------------
295 // ------------------------------------------------------------------------------------------------------------------
346 // ------------------------------------------------------------------------------------------------------------------
571 // ------------------------------------------------------------------------------------------------------------------
669 // ------------------------------------------------------------------------------------------------------------------
703 /** The redundancy with the copy constructor below is necessary since otherwise the compiler doesn't realize that it
905 // ------------------------------------------------------------------------------------------------------------------
int max() const returns the maximal number of indices which can be stored in IdxSet. Definition idxset.h:138 SSVectorBase< R > & assign2productShort(const SVSetBase< S > &A, const SSVectorBase< T > &x) Assignment helper. Definition basevectors.h:648 SSVectorBase< R > & assign2product1(const SVSetBase< S > &A, const SSVectorBase< T > &x) Assignment helper. Definition basevectors.h:612 SSVectorBase< R > & multAdd(S xx, const SVectorBase< T > &vec) Addition of a scaled vector. Definition basevectors.h:389 R length() const Floating point approximation of euclidian norm (without any approximation guarantee). Definition ssvectorbase.h:564 SSVectorBase< R > & assign(const SVectorBase< S > &rhs) Assigns only the elements of rhs. Definition basevectors.h:864 SSVectorBase< R > & assign2product4setup(const SVSetBase< S > &A, const SSVectorBase< T > &x, Timer *timeSparse, Timer *timeFull, int &nCallsSparse, int &nCallsFull) Assigns SSVectorBase to for a setup x. Definition basevectors.h:550 SSVectorBase(const VectorBase< S > &vec) Constructs nonsetup copy of vec. Definition ssvectorbase.h:721 SSVectorBase(int p_dim, std::shared_ptr< Tolerances > tol=nullptr) Default constructor. Definition ssvectorbase.h:674 virtual void setTolerances(std::shared_ptr< Tolerances > newTolerances) set the _tolerances member variable Definition ssvectorbase.h:114 void setup() Initializes nonzero indices for elements with absolute values above epsilon and sets all other elemen... Definition ssvectorbase.h:145 SSVectorBase< R > & assign2product(const SSVectorBase< S > &x, const SVSetBase< T > &A) Assigns to SSVectorBase. Definition basevectors.h:519 SSVectorBase< R > & operator-=(const SSVectorBase< S > &vec) Subtraction. Definition ssvectorbase.h:408 int pos(int i) const Finds the position of index i in the IdxSet, or -1 if i doesn't exist. Definition ssvectorbase.h:204 std::shared_ptr< Tolerances > _tolerances Definition ssvectorbase.h:84 SSVectorBase< R > & assignPWproduct4setup(const SSVectorBase< S > &x, const SSVectorBase< T > &y) Assigns pair wise vector product to SSVectorBase. Definition basevectors.h:458 SSVectorBase< R > & operator=(const SSVectorBase< S > &rhs) Assignment operator. Definition ssvectorbase.h:788 SSVectorBase< R > & operator=(const SSVectorBase< R > &rhs) Assignment operator. Definition ssvectorbase.h:834 SSVectorBase< R > & multAdd(S x, const VectorBase< T > &vec) Addition of a scaled vector. Definition ssvectorbase.h:494 void setSize(int n) Sets number of nonzeros (thereby unSetup SSVectorBase). Definition ssvectorbase.h:597 void setup_and_assign(SSVectorBase< S > &rhs) Sets up rhs vector, and assigns it. Definition ssvectorbase.h:734 void setMax(int newmax) Allocates enough space to accommodate newmax values. Definition ssvectorbase.h:71 SSVectorBase< R > & assign2productFull(const SVSetBase< S > &A, const SSVectorBase< T > &x) Assignment helper. Definition basevectors.h:762 SSVectorBase< R > & operator=(const VectorBase< S > &rhs) Assignment operator. Definition ssvectorbase.h:884 const std::shared_ptr< Tolerances > & tolerances() const returns current tolerances Definition ssvectorbase.h:120 void clearNum(int n) Sets n 'th nonzero element to 0 (index n must exist). Definition ssvectorbase.h:282 SSVectorBase< R > & assign2productAndSetup(const SVSetBase< S > &A, SSVectorBase< T > &x) Assigns SSVectorBase to thereby setting up x. Definition basevectors.h:806 Definition stablesum.h:36 VectorBase< R > & operator=(const VectorBase< S > &vec) Assignment operator. Definition vectorbase.h:157 void reDim(int newdim, const bool setZero=true) Resets VectorBase's dimension to newdim. Definition vectorbase.h:541 VectorBase< R > & multAdd(const S &x, const VectorBase< T > &vec) Addition of scaled vector. Definition vectorbase.h:458 Set of indices. Everything should be within this namespace. Memory allocation routines. Debugging, floating point type and parameter definitions. #define SPX_MSG_ERROR(x) Prints out message x if the verbosity level is at least SPxOut::ERROR. Definition spxdefines.h:163 Timer class. Dense vector.
|