#include <hashedSMatrix.hh>
Classes | |
struct | Value |
Public Types | |
typedef T | value_type |
typedef Realtype< T >::type | r_type |
Real type of data type. | |
typedef Cmplxtype< T >::type | c_type |
Complex type of data type. | |
typedef std::conditional< std::is_same< typenameRealtype< T >::type, T >::value, typenameRealtype< T >::type, typenameCmplxtype< T >::type >::type | d_type |
Data type, depending if F is real or complex. | |
typedef _HashedSMatrix_iterator< T, T &, T * > | iterator |
typedef _HashedSMatrix_iterator< T, const T &, const T * > | const_iterator |
Public Member Functions | |
HashedSparseMatrix (uint r, uint c, uint h) | |
Value ** | Matrix () const |
uint | HashBits () const |
T & | operator() (const uint r, const uint c) |
T | operator() (const uint r, const uint c) const |
const uint | rows () const |
Number of rows. | |
const uint | cols () const |
Number of columns. | |
template<typename F , typename G > | |
void | operator() (const F f[], G g[]) const |
Multiplies the matrix with f . The result is g . | |
HashedSparseMatrix< T > & | operator*= (const T factor) |
Multiplies all entrices with a certain constant. | |
template<typename F , typename G > | |
void | transpMult (const F f[], G g[]) const |
uint | used () const |
Returns the number of used entries in the matrix. | |
float | memory () const |
void | write (std::ostream &ofs) const |
void | outputMatlab (std::ostream &ofs) const |
void | outputSparseQR (std::ostream &ofs) 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 . | |
const_iterator | begin (uint row=0) const |
iterator | begin (uint row=0) |
std::ostream & | info (std::ostream &os) const |
void | compress (Real threshold=EPS) |
Static Public Member Functions | |
static iterator | end () |
Last entrance of the particular order. | |
A matrix in sparse storage using hashes.
Definition at line 40 of file hashedSMatrix.hh.
typedef Cmplxtype<T>::type concepts::HashedSparseMatrix< T >::c_type |
Complex type of data type.
Definition at line 46 of file hashedSMatrix.hh.
typedef _HashedSMatrix_iterator<T, const T&, const T*> concepts::HashedSparseMatrix< T >::const_iterator |
Definition at line 52 of file hashedSMatrix.hh.
typedef std::conditional<std::is_same<typenameRealtype<T>::type,T>::value,typenameRealtype<T>::type,typenameCmplxtype<T>::type>::type concepts::HashedSparseMatrix< T >::d_type |
Data type, depending if F is real or complex.
Definition at line 49 of file hashedSMatrix.hh.
typedef _HashedSMatrix_iterator<T, T&, T*> concepts::HashedSparseMatrix< T >::iterator |
Definition at line 51 of file hashedSMatrix.hh.
typedef Realtype<T>::type concepts::HashedSparseMatrix< T >::r_type |
Real type of data type.
Definition at line 44 of file hashedSMatrix.hh.
typedef T concepts::HashedSparseMatrix< T >::value_type |
Definition at line 42 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 |
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_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).
|
inline |
Number of columns.
Definition at line 106 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.
|
inline |
Definition at line 92 of file hashedSMatrix.hh.
|
inline |
Definition at line 91 of file hashedSMatrix.hh.
|
inline |
Definition at line 124 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 238 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 214 of file hashedSMatrix.hh.
void concepts::HashedSparseMatrix< T >::operator() | ( | const F | f[], |
G | g[] | ||
) | const |
Multiplies the matrix with f
. The result is g
.
Definition at line 258 of file hashedSMatrix.hh.
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 |
|
inline |
Number of rows.
Definition at line 104 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 205 of file hashedSMatrix.hh.
|
inline |
Returns the number of used entries in the matrix.
Definition at line 123 of file hashedSMatrix.hh.