All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 // ------------------------------------------------------------------------------------------------------------------
|