svectorbase.h
Go to the documentation of this file.
32 /** SVectorBase keeps its nonzeros in an array of Nonzero%s providing members for saving the index and value. 80 * Class SVectorBase provides packed sparse vectors. Such are a sparse vectors, with a storage scheme that keeps all 81 * data in one contiguous block of memory. This is best suited for using them for parallel computing on a distributed 84 * SVectorBase does not provide any memory management (this will be done by class DSVectorBase). This means, that the 85 * constructor of SVectorBase expects memory where to save the nonzeros. Further, adding nonzeros to an SVectorBase may 88 * When nonzeros are added to an SVectorBase, they are appended to the set of nonzeros, i.e., they recieve numbers 89 * size(), size()+1 ... . An SVectorBase can hold atmost max() nonzeros, where max() is given in the constructor. When 90 * removing nonzeros, the remaining nonzeros are renumbered. However, only the numbers greater than the number of the 93 * The following mathematical operations are provided by class SVectorBase (SVectorBase \p a, \p b, \p c; R \p x): 110 * Operators \c += and \c -= should be used with caution, since no efficient implementation is available. One should 111 * think of assigning the left handside vector to a dense VectorBase first and perform the addition on it. The same 114 * There are two numberings of the nonzeros of an SVectorBase. First, an SVectorBase is supposed to act like a linear 115 * algebra VectorBase. An \em index refers to this view of an SVectorBase: operator[]() is provided which returns the 116 * value at the given index of the vector, i.e., 0 for all indices which are not in the set of nonzeros. The other view 117 * of SVectorBase%s is that of a set of nonzeros. The nonzeros are numbered from 0 to size()-1. The methods index(int 118 * n) and value(int n) allow to access the index and value of the \p n 'th nonzero. \p n is referred to as the \em 121 * @todo SVectorBase should get a new implementation. There maybe a lot of memory lost due to padding the Nonzero 122 * structure. A better idea seems to be class SVectorBase { int size; int used; int* idx; R* val; }; which for 123 * several reasons could be faster or slower. If SVectorBase is changed, also DSVectorBase and SVSet have to be 133 // ------------------------------------------------------------------------------------------------------------------ 147 // ------------------------------------------------------------------------------------------------------------------ 182 /** @return The number of the first index \p i. If no index \p i is available in the IdxSet, -1 is 434 // ------------------------------------------------------------------------------------------------------------------ 559 // ------------------------------------------------------------------------------------------------------------------ 564 /** The constructor expects one memory block where to store the nonzero elements. This must be passed to the 565 * constructor, where the \em number of Nonzero%s needs that fit into the memory must be given and a pointer to the 566 * beginning of the memory block. Once this memory has been passed, it shall not be modified until the SVectorBase 649 // ------------------------------------------------------------------------------------------------------------------ 686 // ------------------------------------------------------------------------------------------------------------------
Dense vector.Class VectorBase provides dense linear algebra vectors. It does not provide memory manag... Definition: dsvectorbase.h:28 void setMem(int n, Nonzero< R > *elmem) Set the memory area where the nonzeros will be stored. Definition: svectorbase.h:674 SVectorBase< R > & operator=(const SVectorBase< R > &sv) Assignment operator. Definition: svectorbase.h:579 Nonzero< R > & element(int n) Reference to the n 'th nonzero element. Definition: svectorbase.h:218 SVectorBase< R > & operator=(const SVectorBase< S > &sv) Assignment operator. Definition: svectorbase.h:603 Semi sparse vector.This class implements semi-sparse vectors. Such are DVectorBases where the indices... Definition: dsvectorbase.h:29 R operator*(const SVectorBase< S > &w) const inner product for sparse vectors Definition: svectorbase.h:514 Real length() const Floating point approximation of euclidian norm (without any approximation guarantee). Definition: svectorbase.h:471 Everything should be within this namespace. Nonzero< R > & operator=(const Nonzero< S > &vec) Definition: svectorbase.h:43 const Nonzero< R > & element(int n) const The n 'th nonzero element. Definition: svectorbase.h:227 SVectorBase< R > & assignArray(const S *rowValues, const int *rowIndices, int rowSize) Assignment operator. Definition: svectorbase.h:627 Sparse vectors.Class SVectorBase provides packed sparse vectors. Such are a sparse vectors... Definition: dvectorbase.h:31 |