Class documentation of Concepts

Loading...
Searching...
No Matches
concepts::HashedSparseMatrix< T > Class Template Reference

#include <hashedSMatrix.hh>

Classes

struct  Value
 

Public Types

typedefvalue_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)
 
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.
 

Detailed Description

template<class T>
class concepts::HashedSparseMatrix< T >

A matrix in sparse storage using hashes.

Definition at line 40 of file hashedSMatrix.hh.

Member Typedef Documentation

◆ c_type

template<class T >
typedef Cmplxtype<T>::type concepts::HashedSparseMatrix< T >::c_type

Complex type of data type.

Definition at line 46 of file hashedSMatrix.hh.

◆ const_iterator

template<class T >
typedef _HashedSMatrix_iterator<T, const T&, const T*> concepts::HashedSparseMatrix< T >::const_iterator

Definition at line 52 of file hashedSMatrix.hh.

◆ d_type

template<class T >
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.

◆ iterator

template<class T >
typedef _HashedSMatrix_iterator<T, T&, T*> concepts::HashedSparseMatrix< T >::iterator

Definition at line 51 of file hashedSMatrix.hh.

◆ r_type

template<class T >
typedef Realtype<T>::type concepts::HashedSparseMatrix< T >::r_type

Real type of data type.

Definition at line 44 of file hashedSMatrix.hh.

◆ value_type

template<class T >
typedef T concepts::HashedSparseMatrix< T >::value_type

Definition at line 42 of file hashedSMatrix.hh.

Constructor & Destructor Documentation

◆ HashedSparseMatrix()

template<class T >
concepts::HashedSparseMatrix< T >::HashedSparseMatrix ( uint  r,
uint  c,
uint  h 
)

Constructor.

Parameters
rNumber of rows
cNumber of columns
hNumber of hash bits

Member Function Documentation

◆ begin() [1/2]

template<class T >
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).

◆ begin() [2/2]

template<class T >
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).

◆ cols()

template<class T >
const uint concepts::HashedSparseMatrix< T >::cols ( ) const
inline

Number of columns.

Definition at line 106 of file hashedSMatrix.hh.

◆ compress()

template<class T >
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.

◆ HashBits()

template<class T >
uint concepts::HashedSparseMatrix< T >::HashBits ( ) const
inline

Definition at line 92 of file hashedSMatrix.hh.

◆ Matrix()

template<class T >
Value ** concepts::HashedSparseMatrix< T >::Matrix ( ) const
inline

Definition at line 91 of file hashedSMatrix.hh.

◆ memory()

template<class T >
float concepts::HashedSparseMatrix< T >::memory ( ) const
inline

Definition at line 124 of file hashedSMatrix.hh.

◆ multiply() [1/2]

template<class T >
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.

◆ multiply() [2/2]

template<class T >
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.

◆ operator()() [1/2]

template<class T >
template<class F , class G >
void concepts::HashedSparseMatrix< T >::operator() ( const F  f[],
g[] 
) const

Multiplies the matrix with f. The result is g.

Definition at line 258 of file hashedSMatrix.hh.

◆ operator()() [2/2]

template<class T >
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.

Parameters
rRow index
cColumn index

◆ rows()

template<class T >
const uint concepts::HashedSparseMatrix< T >::rows ( ) const
inline

Number of rows.

Definition at line 104 of file hashedSMatrix.hh.

◆ transpMult()

template<class T >
template<class F , class G >
void concepts::HashedSparseMatrix< T >::transpMult ( const F  f[],
g[] 
) const

Multiplies the transpose of the matrix with f and adds the results to g.

Precondition
g is set to 0

Definition at line 205 of file hashedSMatrix.hh.

◆ used()

template<class T >
uint concepts::HashedSparseMatrix< T >::used ( ) const
inline

Returns the number of used entries in the matrix.

Definition at line 123 of file hashedSMatrix.hh.


The documentation for this class was generated from the following files: