Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
concepts::HashedSparseMatrix< T > Class Template Reference

A matrix in sparse storage using hashes. More...

#include <hashedSMatrix.hh>

Inheritance diagram for concepts::HashedSparseMatrix< T >:
Inheritance graph
[legend]
Collaboration diagram for concepts::HashedSparseMatrix< T >:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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

A matrix in sparse storage using hashes.

Definition at line 36 of file hashedSMatrix.hh.


Member Typedef Documentation

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

Real type of data type.

Definition at line 42 of file hashedSMatrix.hh.

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

Definition at line 45 of file hashedSMatrix.hh.

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

Definition at line 44 of file hashedSMatrix.hh.

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

Real type of data type.

Definition at line 40 of file hashedSMatrix.hh.

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

Definition at line 38 of file hashedSMatrix.hh.


Constructor & Destructor Documentation

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
template<class T>
concepts::HashedSparseMatrix< T >::~HashedSparseMatrix ( )
template<class T>
concepts::HashedSparseMatrix< T >::HashedSparseMatrix ( const HashedSparseMatrix< T > &  ) [private]

Member Function Documentation

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

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

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

Number of columns.

Definition at line 99 of file hashedSMatrix.hh.

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.

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

Parameters:
vPointer to the entry which should be removed
vPrevPointer to the entry before the one to be removed
rRow index
cColumn index
template<class T>
static iterator concepts::HashedSparseMatrix< T >::end ( ) [static]

Last entrance of the particular order.

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

Definition at line 85 of file hashedSMatrix.hh.

template<class T>
std::ostream& concepts::HashedSparseMatrix< T >::info ( std::ostream &  os) const
template<class T>
Value** concepts::HashedSparseMatrix< T >::Matrix ( ) const [inline]

Definition at line 84 of file hashedSMatrix.hh.

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

Definition at line 117 of file hashedSMatrix.hh.

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 231 of file hashedSMatrix.hh.

Here is the call graph for this function:

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 207 of file hashedSMatrix.hh.

Here is the call graph for this function:

template<class T>
T concepts::HashedSparseMatrix< T >::operator() ( const uint  r,
const uint  c 
) const
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
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 251 of file hashedSMatrix.hh.

Here is the call graph for this function:

template<class T>
HashedSparseMatrix<T>& concepts::HashedSparseMatrix< T >::operator*= ( const T  factor)

Multiplies all entrices with a certain constant.

template<class T>
void concepts::HashedSparseMatrix< T >::operator= ( const HashedSparseMatrix< T > &  ) [private]
template<class T>
void concepts::HashedSparseMatrix< T >::outputMatlab ( std::ostream &  ofs) const
template<class T>
void concepts::HashedSparseMatrix< T >::outputSparseQR ( std::ostream &  ofs) const
template<class T>
const uint concepts::HashedSparseMatrix< T >::rows ( ) const [inline]

Number of rows.

Definition at line 97 of file hashedSMatrix.hh.

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 198 of file hashedSMatrix.hh.

Here is the call graph for this function:

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

Returns the number of used entries in the matrix.

Definition at line 116 of file hashedSMatrix.hh.

template<class T>
void concepts::HashedSparseMatrix< T >::write ( std::ostream &  ofs) const

Member Data Documentation

template<class T>
uint concepts::HashedSparseMatrix< T >::_used [private]

Definition at line 161 of file hashedSMatrix.hh.

template<class T>
uint concepts::HashedSparseMatrix< T >::hashBits [private]

Definition at line 169 of file hashedSMatrix.hh.

template<class T>
uint concepts::HashedSparseMatrix< T >::hashMsk [private]

Definition at line 170 of file hashedSMatrix.hh.

template<class T>
Value** concepts::HashedSparseMatrix< T >::matrix [private]

Definition at line 160 of file hashedSMatrix.hh.

template<class T>
uint concepts::HashedSparseMatrix< T >::nofCols [private]

Number of columns.

Definition at line 167 of file hashedSMatrix.hh.

template<class T>
uint concepts::HashedSparseMatrix< T >::nofRows [private]

Number of rows.

Definition at line 164 of file hashedSMatrix.hh.

template<class T>
Pool<Value> concepts::HashedSparseMatrix< T >::pool [private]

Definition at line 159 of file hashedSMatrix.hh.


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

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)