mat::Matrix< Treal > Class Template Reference

#include <Matrix.h>

Inheritance diagram for mat::Matrix< Treal >:
mat::MatrixHierarchicBase< Treal >

List of all members.

Public Types

typedef Vector< Treal, Treal > VectorType

Public Member Functions

 Matrix ()
void allocate ()
void assignFromFull (std::vector< Treal > const &fullMat)
void fullMatrix (std::vector< Treal > &fullMat) const
void syFullMatrix (std::vector< Treal > &fullMat) const
void syUpTriFullMatrix (std::vector< Treal > &fullMat) const
void assignFromSparse (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > const &values)
void assignFromSparse (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > const &values, std::vector< int > const &indexes)
void addValues (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > const &values)
void addValues (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > const &values, std::vector< int > const &indexes)
void syAssignFromSparse (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > const &values)
void syAddValues (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > const &values)
void getValues (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > &values) const
void getValues (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > &values, std::vector< int > const &indexes) const
void syGetValues (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > &values) const
void getAllValues (std::vector< int > &rowind, std::vector< int > &colind, std::vector< Treal > &values) const
void syGetAllValues (std::vector< int > &rowind, std::vector< int > &colind, std::vector< Treal > &values) const
Matrix< Treal > & operator= (const Matrix< Treal > &mat)
void clear ()
 Set matrix to zero and delete all arrays.
 ~Matrix ()
void writeToFile (std::ofstream &file) const
void readFromFile (std::ifstream &file)
void random ()
void syRandom ()
void randomZeroStructure (Treal probabilityBeingZero)
void syRandomZeroStructure (Treal probabilityBeingZero)
template<typename TRule >
void setElementsByRule (TRule &rule)
template<typename TRule >
void sySetElementsByRule (TRule &rule)
void addIdentity (Treal alpha)
void symToNosym ()
void nosymToSym ()
Matrix< Treal > & operator= (int const k)
Matrix< Treal > & operator*= (const Treal alpha)
Treal frob () const
Treal frobSquared () const
Treal syFrob () const
Treal syFrobSquared () const
Treal trace () const
void assign (Treal const alpha, Matrix< Treal > const &A)
void getFrobSqLowestLevel (std::vector< Treal > &frobsq) const
void frobThreshLowestLevel (Treal const threshold, Matrix< Treal > *ErrorMatrix)
void getFrobSqElementLevel (std::vector< Treal > &frobsq) const
void frobThreshElementLevel (Treal const threshold, Matrix< Treal > *ErrorMatrix)
void assignFrobNormsLowestLevel (Matrix< Treal, Matrix< Treal > > const &A)
void syAssignFrobNormsLowestLevel (Matrix< Treal, Matrix< Treal > > const &A)
void assignDiffFrobNormsLowestLevel (Matrix< Treal, Matrix< Treal > > const &A, Matrix< Treal, Matrix< Treal > > const &B)
void syAssignDiffFrobNormsLowestLevel (Matrix< Treal, Matrix< Treal > > const &A, Matrix< Treal, Matrix< Treal > > const &B)
void truncateAccordingToSparsityPattern (Matrix< Treal, Matrix< Treal > > &A) const
Treal frob_thresh (Treal const threshold, Matrix< Treal > *ErrorMatrix=0)
Treal frob_squared_thresh (Treal const threshold, Matrix< Treal > *ErrorMatrix=0)
void gersgorin (Treal &lmin, Treal &lmax) const
void sy_gersgorin (Treal &lmin, Treal &lmax) const
void add_abs_col_sums (Treal *abscolsums) const
void get_diagonal (Treal *diag) const
size_t memory_usage () const
size_t nnz () const
 Returns number of nonzeros in matrix.
size_t sy_nnz () const
 Returns number of nonzeros in matrix including lower triangle elements.
size_t nvalues () const
 Returns number of stored values in matrix.
size_t sy_nvalues () const
 Returns number of stored values in matrix.
template<class Top >
Treal syAccumulateWith (Top &op)
template<class Top >
Treal geAccumulateWith (Top &op)
Treal maxAbsValue () const

Static Public Member Functions

static void transpose (Matrix< Treal > const &A, Matrix< Treal > &AT)
static void gemm (const bool tA, const bool tB, const Treal alpha, const Matrix< Treal > &A, const Matrix< Treal > &B, const Treal beta, Matrix< Treal > &C)
static void symm (const char side, const char uplo, const Treal alpha, const Matrix< Treal > &A, const Matrix< Treal > &B, const Treal beta, Matrix< Treal > &C)
static void syrk (const char uplo, const bool tA, const Treal alpha, const Matrix< Treal > &A, const Treal beta, Matrix< Treal > &C)
static void sysq (const char uplo, const Treal alpha, const Matrix< Treal > &A, const Treal beta, Matrix< Treal > &C)
static void ssmm (const Treal alpha, const Matrix< Treal > &A, const Matrix< Treal > &B, const Treal beta, Matrix< Treal > &C)
static void ssmm_upper_tr_only (const Treal alpha, const Matrix< Treal > &A, const Matrix< Treal > &B, const Treal beta, Matrix< Treal > &C)
static void trmm (const char side, const char uplo, const bool tA, const Treal alpha, const Matrix< Treal > &A, Matrix< Treal > &B)
static Treal frobDiff (const Matrix< Treal > &A, const Matrix< Treal > &B)
static Treal frobSquaredDiff (const Matrix< Treal > &A, const Matrix< Treal > &B)
static Treal syFrobDiff (const Matrix< Treal > &A, const Matrix< Treal > &B)
static Treal syFrobSquaredDiff (const Matrix< Treal > &A, const Matrix< Treal > &B)
static Treal trace_ab (const Matrix< Treal > &A, const Matrix< Treal > &B)
static Treal trace_aTb (const Matrix< Treal > &A, const Matrix< Treal > &B)
static Treal sy_trace_ab (const Matrix< Treal > &A, const Matrix< Treal > &B)
static void add (const Treal alpha, const Matrix< Treal > &A, Matrix< Treal > &B)
static void gemm_upper_tr_only (const bool tA, const bool tB, const Treal alpha, const Matrix< Treal > &A, const Matrix< Treal > &B, const Treal beta, Matrix< Treal > &C)
static void sytr_upper_tr_only (char const side, const Treal alpha, Matrix< Treal > &A, const Matrix< Treal > &Z)
static void trmm_upper_tr_only (const char side, const char uplo, const bool tA, const Treal alpha, const Matrix< Treal > &A, Matrix< Treal > &B)
static void trsytriplemm (char const side, const Matrix< Treal > &Z, Matrix< Treal > &A)
static void inch (const Matrix< Treal > &A, Matrix< Treal > &Z, const Treal threshold=0, const side looking=left, const inchversion version=unstable)
static void syInch (const Matrix< Treal > &A, Matrix< Treal > &Z, const Treal threshold=0, const side looking=left, const inchversion version=unstable)
static unsigned int level ()

Static Private Attributes

static const Treal ZERO = 0
static const Treal ONE = 1

Friends

class Vector< Treal, Treal >

template<class Treal>
class mat::Matrix< Treal >


Member Typedef Documentation

template<class Treal >
typedef Vector<Treal, Treal> mat::Matrix< Treal >::VectorType

Constructor & Destructor Documentation

template<class Treal >
mat::Matrix< Treal >::Matrix (  )  [inline]
template<class Treal >
mat::Matrix< Treal >::~Matrix (  )  [inline]

Member Function Documentation

template<class Treal >
void mat::Matrix< Treal >::add ( const Treal  alpha,
const Matrix< Treal > &  A,
Matrix< Treal > &  B 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::add_abs_col_sums ( Treal *  abscolsums  )  const [inline]
template<class Treal >
void mat::Matrix< Treal >::addIdentity ( Treal  alpha  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::addValues ( std::vector< int > const &  rowind,
std::vector< int > const &  colind,
std::vector< Treal > const &  values,
std::vector< int > const &  indexes 
) [inline]
template<class Treal >
void mat::Matrix< Treal >::addValues ( std::vector< int > const &  rowind,
std::vector< int > const &  colind,
std::vector< Treal > const &  values 
) [inline]
template<class Treal >
void mat::Matrix< Treal >::allocate (  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::assign ( Treal const   alpha,
Matrix< Treal > const &  A 
) [inline]
template<class Treal >
void mat::Matrix< Treal >::assignDiffFrobNormsLowestLevel ( Matrix< Treal, Matrix< Treal > > const &  A,
Matrix< Treal, Matrix< Treal > > const &  B 
) [inline]
template<class Treal >
void mat::Matrix< Treal >::assignFrobNormsLowestLevel ( Matrix< Treal, Matrix< Treal > > const &  A  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::assignFromFull ( std::vector< Treal > const &  fullMat  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::assignFromSparse ( std::vector< int > const &  rowind,
std::vector< int > const &  colind,
std::vector< Treal > const &  values,
std::vector< int > const &  indexes 
) [inline]
template<class Treal >
void mat::Matrix< Treal >::assignFromSparse ( std::vector< int > const &  rowind,
std::vector< int > const &  colind,
std::vector< Treal > const &  values 
) [inline]
template<class Treal >
void mat::Matrix< Treal >::clear (  )  [inline]

Set matrix to zero and delete all arrays.

References mat::MatrixHierarchicBase< Treal, Telement >::elements.

Referenced by frobThreshElementLevel(), and truncateAccordingToSparsityPattern().

template<class Treal >
Treal mat::Matrix< Treal >::frob (  )  const [inline]
template<class Treal >
Treal mat::Matrix< Treal >::frob_squared_thresh ( Treal const   threshold,
Matrix< Treal > *  ErrorMatrix = 0 
) [inline]
template<class Treal >
Treal mat::Matrix< Treal >::frob_thresh ( Treal const   threshold,
Matrix< Treal > *  ErrorMatrix = 0 
) [inline]
template<class Treal >
static Treal mat::Matrix< Treal >::frobDiff ( const Matrix< Treal > &  A,
const Matrix< Treal > &  B 
) [inline, static]
template<class Treal >
Treal mat::Matrix< Treal >::frobSquared (  )  const [inline]
template<class Treal >
Treal mat::Matrix< Treal >::frobSquaredDiff ( const Matrix< Treal > &  A,
const Matrix< Treal > &  B 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::frobThreshElementLevel ( Treal const   threshold,
Matrix< Treal > *  ErrorMatrix 
) [inline]
template<class Treal >
void mat::Matrix< Treal >::frobThreshLowestLevel ( Treal const   threshold,
Matrix< Treal > *  ErrorMatrix 
) [inline]
template<class Treal >
void mat::Matrix< Treal >::fullMatrix ( std::vector< Treal > &  fullMat  )  const [inline]
template<class Treal >
template<class Top >
Treal mat::Matrix< Treal >::geAccumulateWith ( Top &  op  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::gemm ( const bool  tA,
const bool  tB,
const Treal  alpha,
const Matrix< Treal > &  A,
const Matrix< Treal > &  B,
const Treal  beta,
Matrix< Treal > &  C 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::gemm_upper_tr_only ( const bool  tA,
const bool  tB,
const Treal  alpha,
const Matrix< Treal > &  A,
const Matrix< Treal > &  B,
const Treal  beta,
Matrix< Treal > &  C 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::gersgorin ( Treal &  lmin,
Treal &  lmax 
) const [inline]
template<class Treal >
void mat::Matrix< Treal >::get_diagonal ( Treal *  diag  )  const [inline]
template<class Treal >
void mat::Matrix< Treal >::getAllValues ( std::vector< int > &  rowind,
std::vector< int > &  colind,
std::vector< Treal > &  values 
) const [inline]
template<class Treal >
void mat::Matrix< Treal >::getFrobSqElementLevel ( std::vector< Treal > &  frobsq  )  const [inline]
template<class Treal >
void mat::Matrix< Treal >::getFrobSqLowestLevel ( std::vector< Treal > &  frobsq  )  const [inline]
template<class Treal >
void mat::Matrix< Treal >::getValues ( std::vector< int > const &  rowind,
std::vector< int > const &  colind,
std::vector< Treal > &  values,
std::vector< int > const &  indexes 
) const [inline]
template<class Treal >
void mat::Matrix< Treal >::getValues ( std::vector< int > const &  rowind,
std::vector< int > const &  colind,
std::vector< Treal > &  values 
) const [inline]
template<class Treal >
void mat::Matrix< Treal >::inch ( const Matrix< Treal > &  A,
Matrix< Treal > &  Z,
const Treal  threshold = 0,
const side  looking = left,
const inchversion  version = unstable 
) [inline, static]
template<class Treal >
static unsigned int mat::Matrix< Treal >::level (  )  [inline, static]
template<class Treal >
Treal mat::Matrix< Treal >::maxAbsValue (  )  const [inline]
template<class Treal >
size_t mat::Matrix< Treal >::memory_usage (  )  const [inline]
template<class Treal >
size_t mat::Matrix< Treal >::nnz (  )  const [inline]

Returns number of nonzeros in matrix.

template<class Treal >
void mat::Matrix< Treal >::nosymToSym (  )  [inline]
template<class Treal >
size_t mat::Matrix< Treal >::nvalues (  )  const [inline]

Returns number of stored values in matrix.

Returns same number as nnz()

References mat::Matrix< Treal, Telement >::nnz().

template<class Treal >
Matrix< Treal > & mat::Matrix< Treal >::operator*= ( const Treal  alpha  )  [inline]
template<class Treal >
Matrix< Treal > & mat::Matrix< Treal >::operator= ( int const   k  )  [inline]
template<class Treal >
Matrix<Treal>& mat::Matrix< Treal >::operator= ( const Matrix< Treal > &  mat  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::random (  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::randomZeroStructure ( Treal  probabilityBeingZero  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::readFromFile ( std::ifstream &  file  )  [inline]
template<class Treal >
template<typename TRule >
void mat::Matrix< Treal >::setElementsByRule ( TRule &  rule  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::ssmm ( const Treal  alpha,
const Matrix< Treal > &  A,
const Matrix< Treal > &  B,
const Treal  beta,
Matrix< Treal > &  C 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::ssmm_upper_tr_only ( const Treal  alpha,
const Matrix< Treal > &  A,
const Matrix< Treal > &  B,
const Treal  beta,
Matrix< Treal > &  C 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::sy_gersgorin ( Treal &  lmin,
Treal &  lmax 
) const [inline]

References gersgorin(), and symToNosym().

template<class Treal >
size_t mat::Matrix< Treal >::sy_nnz (  )  const [inline]

Returns number of nonzeros in matrix including lower triangle elements.

template<class Treal >
size_t mat::Matrix< Treal >::sy_nvalues (  )  const [inline]
template<class Treal >
Treal mat::Matrix< Treal >::sy_trace_ab ( const Matrix< Treal > &  A,
const Matrix< Treal > &  B 
) [inline, static]
template<class Treal >
template<class Top >
Treal mat::Matrix< Treal >::syAccumulateWith ( Top &  op  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::syAddValues ( std::vector< int > const &  rowind,
std::vector< int > const &  colind,
std::vector< Treal > const &  values 
) [inline]
template<class Treal >
void mat::Matrix< Treal >::syAssignDiffFrobNormsLowestLevel ( Matrix< Treal, Matrix< Treal > > const &  A,
Matrix< Treal, Matrix< Treal > > const &  B 
) [inline]
template<class Treal >
void mat::Matrix< Treal >::syAssignFrobNormsLowestLevel ( Matrix< Treal, Matrix< Treal > > const &  A  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::syAssignFromSparse ( std::vector< int > const &  rowind,
std::vector< int > const &  colind,
std::vector< Treal > const &  values 
) [inline]
template<class Treal >
Treal mat::Matrix< Treal >::syFrob (  )  const [inline]
template<class Treal >
static Treal mat::Matrix< Treal >::syFrobDiff ( const Matrix< Treal > &  A,
const Matrix< Treal > &  B 
) [inline, static]
template<class Treal >
Treal mat::Matrix< Treal >::syFrobSquared (  )  const [inline]
template<class Treal >
Treal mat::Matrix< Treal >::syFrobSquaredDiff ( const Matrix< Treal > &  A,
const Matrix< Treal > &  B 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::syFullMatrix ( std::vector< Treal > &  fullMat  )  const [inline]
template<class Treal >
void mat::Matrix< Treal >::syGetAllValues ( std::vector< int > &  rowind,
std::vector< int > &  colind,
std::vector< Treal > &  values 
) const [inline]
template<class Treal >
void mat::Matrix< Treal >::syGetValues ( std::vector< int > const &  rowind,
std::vector< int > const &  colind,
std::vector< Treal > &  values 
) const [inline]
template<class Treal >
static void mat::Matrix< Treal >::syInch ( const Matrix< Treal > &  A,
Matrix< Treal > &  Z,
const Treal  threshold = 0,
const side  looking = left,
const inchversion  version = unstable 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::symm ( const char  side,
const char  uplo,
const Treal  alpha,
const Matrix< Treal > &  A,
const Matrix< Treal > &  B,
const Treal  beta,
Matrix< Treal > &  C 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::symToNosym (  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::syRandom (  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::syRandomZeroStructure ( Treal  probabilityBeingZero  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::syrk ( const char  uplo,
const bool  tA,
const Treal  alpha,
const Matrix< Treal > &  A,
const Treal  beta,
Matrix< Treal > &  C 
) [inline, static]
template<class Treal >
template<typename TRule >
void mat::Matrix< Treal >::sySetElementsByRule ( TRule &  rule  )  [inline]
template<class Treal >
void mat::Matrix< Treal >::sysq ( const char  uplo,
const Treal  alpha,
const Matrix< Treal > &  A,
const Treal  beta,
Matrix< Treal > &  C 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::sytr_upper_tr_only ( char const   side,
const Treal  alpha,
Matrix< Treal > &  A,
const Matrix< Treal > &  Z 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::syUpTriFullMatrix ( std::vector< Treal > &  fullMat  )  const [inline]
template<class Treal >
Treal mat::Matrix< Treal >::trace (  )  const [inline]
template<class Treal >
Treal mat::Matrix< Treal >::trace_ab ( const Matrix< Treal > &  A,
const Matrix< Treal > &  B 
) [inline, static]
template<class Treal >
Treal mat::Matrix< Treal >::trace_aTb ( const Matrix< Treal > &  A,
const Matrix< Treal > &  B 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::transpose ( Matrix< Treal > const &  A,
Matrix< Treal > &  AT 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::trmm ( const char  side,
const char  uplo,
const bool  tA,
const Treal  alpha,
const Matrix< Treal > &  A,
Matrix< Treal > &  B 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::trmm_upper_tr_only ( const char  side,
const char  uplo,
const bool  tA,
const Treal  alpha,
const Matrix< Treal > &  A,
Matrix< Treal > &  B 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::trsytriplemm ( char const   side,
const Matrix< Treal > &  Z,
Matrix< Treal > &  A 
) [inline, static]
template<class Treal >
void mat::Matrix< Treal >::truncateAccordingToSparsityPattern ( Matrix< Treal, Matrix< Treal > > &  A  )  const [inline]
template<class Treal >
void mat::Matrix< Treal >::writeToFile ( std::ofstream &  file  )  const [inline]

Friends And Related Function Documentation

template<class Treal >
friend class Vector< Treal, Treal > [friend]

Member Data Documentation

template<class Treal >
const Treal mat::Matrix< Treal >::ONE = 1 [inline, static, private]
template<class Treal >
const Treal mat::Matrix< Treal >::ZERO = 0 [inline, static, private]

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

Generated on 21 Nov 2012 for ergo by  doxygen 1.6.1