A matrix in sparse storage using hashes. More...
#include <hashedSMatrix.hh>


Classes | |
| struct | Value |
| Values of a matrix in sparse notation. More... | |
Public Types | |
| typedef Cmplxtype< T >::type | c_type |
| Real type of data type. | |
| typedef _HashedSMatrix_iterator< T, const T &, const T * > | const_iterator |
| typedef _HashedSMatrix_iterator< T, T &, T * > | iterator |
| typedef Realtype< T >::type | r_type |
| Real type of data type. | |
| typedef T | value_type |
Public Member Functions | |
| const_iterator | begin (uint row=0) const |
| Returns constant iterator over the entrances. | |
| iterator | begin (uint row=0) |
| Returns iterator over the entrances. | |
| const uint | cols () const |
| Number of columns. | |
| void | compress (Real threshold=EPS) |
| Compresses the matrix by dropping small entries. | |
| uint | HashBits () const |
| HashedSparseMatrix (uint r, uint c, uint h) | |
| Constructor. | |
| std::ostream & | info (std::ostream &os) const |
| Value ** | Matrix () const |
| float | memory () const |
| void | multiply (const HashedSparseMatrix< T > *const fact, concepts::Matrix< T > &dest) const |
Multiplies this matrix and fact and adds the result to dest. | |
| void | multiply (const concepts::Matrix< T > *const fact, concepts::Matrix< T > &dest) const |
Multiplies this matrix and fact and adds the result to dest. | |
| template<typename F , typename G > | |
| void | operator() (const F f[], G g[]) const |
Multiplies the matrix with f. The result is g. | |
| T & | operator() (const uint r, const uint c) |
| Returns the entry with index (r,c). | |
| T | operator() (const uint r, const uint c) const |
| HashedSparseMatrix< T > & | operator*= (const T factor) |
| Multiplies all entrices with a certain constant. | |
| void | outputMatlab (std::ostream &ofs) const |
| void | outputSparseQR (std::ostream &ofs) const |
| const uint | rows () const |
| Number of rows. | |
| template<typename F , typename G > | |
| void | transpMult (const F f[], G g[]) const |
Multiplies the transpose of the matrix with f and adds the results to g. | |
| uint | used () const |
| Returns the number of used entries in the matrix. | |
| void | write (std::ostream &ofs) const |
| ~HashedSparseMatrix () | |
Static Public Member Functions | |
| static iterator | end () |
| Last entrance of the particular order. | |
Private Member Functions | |
| void | dropEntry_ (Value *&v, Value *&vPrev, const uint r, const uint c) |
| Removes entry (r,c) from the matrix. | |
| HashedSparseMatrix (const HashedSparseMatrix< T > &) | |
| void | operator= (const HashedSparseMatrix< T > &) |
Private Attributes | |
| uint | _used |
| uint | hashBits |
| uint | hashMsk |
| Value ** | matrix |
| uint | nofCols |
| Number of columns. | |
| uint | nofRows |
| Number of rows. | |
| Pool< Value > | pool |
A matrix in sparse storage using hashes.
Definition at line 36 of file hashedSMatrix.hh.
| typedef Cmplxtype<T>::type concepts::HashedSparseMatrix< T >::c_type |
Real type of data type.
Definition at line 42 of file hashedSMatrix.hh.
| typedef _HashedSMatrix_iterator<T, const T&, const T*> concepts::HashedSparseMatrix< T >::const_iterator |
Definition at line 45 of file hashedSMatrix.hh.
| typedef _HashedSMatrix_iterator<T, T&, T*> concepts::HashedSparseMatrix< T >::iterator |
Definition at line 44 of file hashedSMatrix.hh.
| typedef Realtype<T>::type concepts::HashedSparseMatrix< T >::r_type |
Real type of data type.
Definition at line 40 of file hashedSMatrix.hh.
| typedef T concepts::HashedSparseMatrix< T >::value_type |
Definition at line 38 of file hashedSMatrix.hh.
| concepts::HashedSparseMatrix< T >::HashedSparseMatrix | ( | uint | r, |
| uint | c, | ||
| uint | h | ||
| ) |
Constructor.
| r | Number of rows |
| c | Number of columns |
| h | Number of hash bits |
| concepts::HashedSparseMatrix< T >::~HashedSparseMatrix | ( | ) |
| concepts::HashedSparseMatrix< T >::HashedSparseMatrix | ( | const HashedSparseMatrix< T > & | ) | [private] |
| const_iterator concepts::HashedSparseMatrix< T >::begin | ( | uint | row = 0 | ) | const |
Returns constant iterator over the entrances.
The order is row-wise, but unsorted inside the row. The iterator stands at the first entrance in row (in the particular order).
| iterator concepts::HashedSparseMatrix< T >::begin | ( | uint | row = 0 | ) |
Returns iterator over the entrances.
The order is row-wise, but unsorted inside the row. The iterator stands at the first entrance in row (in the particular order).
| const uint concepts::HashedSparseMatrix< T >::cols | ( | ) | const [inline] |
Number of columns.
Definition at line 99 of file hashedSMatrix.hh.
| void concepts::HashedSparseMatrix< T >::compress | ( | Real | threshold = EPS | ) |
Compresses the matrix by dropping small entries.
All matrix entries which are smaller than a certain threshold times the largest entry of the matrix are deleted from the matrix. To delete a small entry, dropEntry_ is used.
| void concepts::HashedSparseMatrix< T >::dropEntry_ | ( | Value *& | v, |
| Value *& | vPrev, | ||
| const uint | r, | ||
| const uint | c | ||
| ) | [private] |
Removes entry (r,c) from the matrix.
The storage of the matrix entry is not released and will only be released on destruction of the whole matrix. Trying to remove a non-existing entry simply does nothing.
| v | Pointer to the entry which should be removed |
| vPrev | Pointer to the entry before the one to be removed |
| r | Row index |
| c | Column index |
| static iterator concepts::HashedSparseMatrix< T >::end | ( | ) | [static] |
Last entrance of the particular order.
| uint concepts::HashedSparseMatrix< T >::HashBits | ( | ) | const [inline] |
Definition at line 85 of file hashedSMatrix.hh.
| std::ostream& concepts::HashedSparseMatrix< T >::info | ( | std::ostream & | os | ) | const |
| Value** concepts::HashedSparseMatrix< T >::Matrix | ( | ) | const [inline] |
Definition at line 84 of file hashedSMatrix.hh.
| float concepts::HashedSparseMatrix< T >::memory | ( | ) | const [inline] |
Definition at line 117 of file hashedSMatrix.hh.
| void concepts::HashedSparseMatrix< T >::multiply | ( | const concepts::Matrix< T > *const | fact, |
| concepts::Matrix< T > & | dest | ||
| ) | const |
Multiplies this matrix and fact and adds the result to dest.
Definition at line 231 of file hashedSMatrix.hh.

| void concepts::HashedSparseMatrix< T >::multiply | ( | const HashedSparseMatrix< T > *const | fact, |
| concepts::Matrix< T > & | dest | ||
| ) | const |
Multiplies this matrix and fact and adds the result to dest.
Definition at line 207 of file hashedSMatrix.hh.

| T concepts::HashedSparseMatrix< T >::operator() | ( | const uint | r, |
| const uint | c | ||
| ) | const |
| T& concepts::HashedSparseMatrix< T >::operator() | ( | const uint | r, |
| const uint | c | ||
| ) |
Returns the entry with index (r,c).
If this entry does not yet exist, it is created.
| r | Row index |
| c | Column index |
| void concepts::HashedSparseMatrix< T >::operator() | ( | const F | f[], |
| G | g[] | ||
| ) | const |
Multiplies the matrix with f. The result is g.
Definition at line 251 of file hashedSMatrix.hh.

| HashedSparseMatrix<T>& concepts::HashedSparseMatrix< T >::operator*= | ( | const T | factor | ) |
Multiplies all entrices with a certain constant.
| void concepts::HashedSparseMatrix< T >::operator= | ( | const HashedSparseMatrix< T > & | ) | [private] |
| void concepts::HashedSparseMatrix< T >::outputMatlab | ( | std::ostream & | ofs | ) | const |
| void concepts::HashedSparseMatrix< T >::outputSparseQR | ( | std::ostream & | ofs | ) | const |
| const uint concepts::HashedSparseMatrix< T >::rows | ( | ) | const [inline] |
Number of rows.
Definition at line 97 of file hashedSMatrix.hh.
| void concepts::HashedSparseMatrix< T >::transpMult | ( | const F | f[], |
| G | g[] | ||
| ) | const |
Multiplies the transpose of the matrix with f and adds the results to g.
g is set to 0 Definition at line 198 of file hashedSMatrix.hh.

| uint concepts::HashedSparseMatrix< T >::used | ( | ) | const [inline] |
Returns the number of used entries in the matrix.
Definition at line 116 of file hashedSMatrix.hh.
| void concepts::HashedSparseMatrix< T >::write | ( | std::ostream & | ofs | ) | const |
uint concepts::HashedSparseMatrix< T >::_used [private] |
Definition at line 161 of file hashedSMatrix.hh.
uint concepts::HashedSparseMatrix< T >::hashBits [private] |
Definition at line 169 of file hashedSMatrix.hh.
uint concepts::HashedSparseMatrix< T >::hashMsk [private] |
Definition at line 170 of file hashedSMatrix.hh.
Value** concepts::HashedSparseMatrix< T >::matrix [private] |
Definition at line 160 of file hashedSMatrix.hh.
uint concepts::HashedSparseMatrix< T >::nofCols [private] |
Number of columns.
Definition at line 167 of file hashedSMatrix.hh.
uint concepts::HashedSparseMatrix< T >::nofRows [private] |
Number of rows.
Definition at line 164 of file hashedSMatrix.hh.
Pool<Value> concepts::HashedSparseMatrix< T >::pool [private] |
Definition at line 159 of file hashedSMatrix.hh.