ergo
mat::Matrix< Treal > Class Template Reference

#include <Matrix.h>

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

Public Types

typedef Vector< Treal, Treal > VectorType
 
typedef Treal ElementType
 
typedef Vector< Treal, typename ElementType::VectorType > 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 gershgorin (Treal &lmin, Treal &lmax) const
 
void sy_gershgorin (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
 
 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 > &, 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 > &) const
 
void syGetAllValues (std::vector< int > &rowind, std::vector< int > &colind, std::vector< Treal > &) const
 
Matrix< Treal, Treal > & operator= (const Matrix< Treal, Treal > &mat)
 
Matrix< Treal, Treal > & operator= (int const k)
 
void clear ()
 
 ~Matrix ()
 
void writeToFile (std::ofstream &file) const
 
void readFromFile (std::ifstream &file)
 
void random ()
 
void syRandom ()
 
void randomZeroStructure (Treal probabilityBeingZero)
 Get a random zero structure with a specified probability that each submatrix is zero.
 
void syRandomZeroStructure (Treal probabilityBeingZero)
 
void setElementsByRule (TRule &rule)
 
void sySetElementsByRule (TRule &rule)
 
void trSetElementsByRule (TRule &rule)
 
void addIdentity (Treal alpha)
 
void symToNosym ()
 
void nosymToSym ()
 
Matrix< Treal, 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, Treal > const &A)
 
void getFrobSqLowestLevel (std::vector< Treal > &frobsq) const
 
void frobThreshLowestLevel (Treal const threshold, Matrix< Treal, Treal > *ErrorMatrix)
 
void getFrobSqElementLevel (std::vector< Treal > &frobsq) const
 
void frobThreshElementLevel (Treal const threshold, Matrix< Treal, Treal > *ErrorMatrix)
 
void assignFrobNormsLowestLevel (Matrix< Treal, Matrix< Treal, Treal > > const &A)
 Build a matrix with single matrix elements at the lowest level containing the Frobenius norms of the submatrices of A.
 
void syAssignFrobNormsLowestLevel (Matrix< Treal, Matrix< Treal, Treal > > const &A)
 Version of assignFrobNormsLowestLevelToMatrix for symmetric matrices.
 
void assignDiffFrobNormsLowestLevel (Matrix< Treal, Matrix< Treal, Treal > > const &A, Matrix< Treal, Matrix< Treal, Treal > > const &B)
 Same as assignFrobNormsLowestLevel except that the Frobenius norms of the differences between submatrices of A and B are assigned.
 
void syAssignDiffFrobNormsLowestLevel (Matrix< Treal, Matrix< Treal, Treal > > const &A, Matrix< Treal, Matrix< Treal, Treal > > const &B)
 Same as syAssignFrobNormsLowestLevel except that the Frobenius norms of the differences between submatrices of A and B are assigned.
 
void truncateAccordingToSparsityPattern (Matrix< Treal, Matrix< Treal, Treal > > &A) const
 Truncate matrix A according to the sparsity pattern of the this matrix (frobNormMat).
 
Treal frob_thresh (Treal const threshold, Matrix< Treal, Treal > *ErrorMatrix=0)
 Removes small elements so that the introduced error is smaller than the threshold in the Frobenius norm Returns the Frobenius norm of the introduced error.
 
Treal frob_squared_thresh (Treal const threshold, Matrix< Treal, Treal > *ErrorMatrix=0)
 Removes small elements so that the introduced error is smaller than threshold in the squared Frobenius norm, returns squared frobenius norm of the introduced error added to ErrorMatrix.
 
void gershgorin (Treal &lmin, Treal &lmax) const
 
void sy_gershgorin (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.
 
Treal syAccumulateWith (Top &op)
 
Treal geAccumulateWith (Top &op)
 Accumulation algorithm for general matrices.
 
Treal maxAbsValue () const
 
- Public Member Functions inherited from mat::MatrixHierarchicBase< Treal, Treal >
bool operator== (int k) const
 
const int & nScalarsRows () const
 
const int & nScalarsCols () const
 
const int & nrows () const
 
const int & ncols () const
 
Treal & operator ()(int row
 
const Treal & operator ()(int row
 
 assert (row >=0)
 
 assert (col >=0)
 
 assert (row< nrows())
 
 assert (col< ncols())
 
 assert (row >=0)
 
 assert (col >=0)
 
 assert (row< nrows())
 
 assert (col< ncols())
 
Treal & operator[] (int index)
 
Treal constoperator[] (int index) const
 
bool is_zero () const
 
int nElements () const
 
void resetRows (SizesAndBlocks const &newRows)
 
void resetCols (SizesAndBlocks const &newCols)
 
void getRows (SizesAndBlocks &rowsCopy) const
 
void getCols (SizesAndBlocks &colsCopy) const
 
bool highestLevel () const
 
bool is_empty () const
 Check if matrix is empty Empty is different from zero, a zero matrix contains information about blocksizes etc.
 
- Public Member Functions inherited from mat::MatrixHierarchicBase< Treal, Telement >
bool operator== (int k) const
 
const int & nScalarsRows () const
 
const int & nScalarsCols () const
 
const int & nrows () const
 
const int & ncols () const
 
Telement & operator ()(int row
 
 assert (row >=0)
 
 assert (col >=0)
 
 assert (row< nrows())
 
 assert (col< ncols())
 
const Telement & operator ()(int row
 
 assert (row >=0)
 
 assert (col >=0)
 
 assert (row< nrows())
 
 assert (col< ncols())
 
Telement & operator[] (int index)
 
Telement constoperator[] (int index) const
 
bool is_zero () const
 
int nElements () const
 
void resetRows (SizesAndBlocks const &newRows)
 
void resetCols (SizesAndBlocks const &newCols)
 
void getRows (SizesAndBlocks &rowsCopy) const
 
void getCols (SizesAndBlocks &colsCopy) const
 
bool highestLevel () const
 
bool is_empty () const
 Check if matrix is empty Empty is different from zero, a zero matrix contains information about blocksizes etc.
 

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 void transpose (Matrix< Treal, Treal > const &A, Matrix< Treal, Treal > &AT)
 
static void gemm (const bool tA, const bool tB, const Treal alpha, const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B, const Treal beta, Matrix< Treal, Treal > &C)
 
static void symm (const char side, const char uplo, const Treal alpha, const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B, const Treal beta, Matrix< Treal, Treal > &C)
 
static void syrk (const char uplo, const bool tA, const Treal alpha, const Matrix< Treal, Treal > &A, const Treal beta, Matrix< Treal, Treal > &C)
 
static void sysq (const char uplo, const Treal alpha, const Matrix< Treal, Treal > &A, const Treal beta, Matrix< Treal, Treal > &C)
 
static void ssmm (const Treal alpha, const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B, const Treal beta, Matrix< Treal, Treal > &C)
 
static void ssmm_upper_tr_only (const Treal alpha, const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B, const Treal beta, Matrix< Treal, Treal > &C)
 
static void trmm (const char side, const char uplo, const bool tA, const Treal alpha, const Matrix< Treal, Treal > &A, Matrix< Treal, Treal > &B)
 
static Treal frobDiff (const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B)
 
static Treal frobSquaredDiff (const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B)
 
static Treal syFrobDiff (const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B)
 
static Treal syFrobSquaredDiff (const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B)
 
static Treal trace_ab (const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B)
 
static Treal trace_aTb (const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B)
 
static Treal sy_trace_ab (const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B)
 
static void add (const Treal alpha, const Matrix< Treal, Treal > &A, Matrix< Treal, Treal > &B)
 
static void gemm_upper_tr_only (const bool tA, const bool tB, const Treal alpha, const Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &B, const Treal beta, Matrix< Treal, Treal > &C)
 
static void sytr_upper_tr_only (char const side, const Treal alpha, Matrix< Treal, Treal > &A, const Matrix< Treal, Treal > &Z)
 
static void trmm_upper_tr_only (const char side, const char uplo, const bool tA, const Treal alpha, const Matrix< Treal, Treal > &A, Matrix< Treal, Treal > &B)
 
static void trsytriplemm (char const side, const Matrix< Treal, Treal > &Z, Matrix< Treal, Treal > &A)
 
static void syInch (const Matrix< Treal, Treal > &A, Matrix< Treal, 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
 
static const Treal ONE
 

Friends

class Vector< Treal, Treal >
 
class Vector< Treal, Telement >
 

Additional Inherited Members

- Public Attributes inherited from mat::MatrixHierarchicBase< Treal, Treal >
Treal int col
 
return elements [row+col *nrows()]
 
const Treal int col const
 
- Public Attributes inherited from mat::MatrixHierarchicBase< Treal, Telement >
Telement int col
 
return elements [row+col *nrows()]
 
const Telement int col const
 
- Protected Member Functions inherited from mat::MatrixHierarchicBase< Treal, Treal >
 MatrixHierarchicBase ()
 
 MatrixHierarchicBase (SizesAndBlocks const &rowsInp, SizesAndBlocks const &colsInp)
 
 MatrixHierarchicBase (const MatrixHierarchicBase< Treal, Treal > &mat)
 
MatrixHierarchicBase< Treal, Treal > & operator= (const MatrixHierarchicBase< Treal, Treal > &mat)
 
virtual ~MatrixHierarchicBase ()
 
- Protected Member Functions inherited from mat::MatrixHierarchicBase< Treal, Telement >
 MatrixHierarchicBase ()
 
 MatrixHierarchicBase (SizesAndBlocks const &rowsInp, SizesAndBlocks const &colsInp)
 
 MatrixHierarchicBase (const MatrixHierarchicBase< Treal, Telement > &mat)
 
MatrixHierarchicBase< Treal, Telement > & operator= (const MatrixHierarchicBase< Treal, Telement > &mat)
 
virtual ~MatrixHierarchicBase ()
 
- Static Protected Member Functions inherited from mat::MatrixHierarchicBase< Treal, Treal >
static void swap (MatrixHierarchicBase< Treal, Treal > &A, MatrixHierarchicBase< Treal, Treal > &B)
 
- Static Protected Member Functions inherited from mat::MatrixHierarchicBase< Treal, Telement >
static void swap (MatrixHierarchicBase< Treal, Telement > &A, MatrixHierarchicBase< Treal, Telement > &B)
 
- Protected Attributes inherited from mat::MatrixHierarchicBase< Treal, Treal >
Treal * elements
 
SizesAndBlocks rows
 
SizesAndBlocks cols
 
- Protected Attributes inherited from mat::MatrixHierarchicBase< Treal, Telement >
SizesAndBlocks rows
 
SizesAndBlocks cols
 
Telement * elements
 

Member Typedef Documentation

◆ ElementType

typedef Treal mat::Matrix< Treal, Treal >::ElementType

◆ VectorType [1/2]

typedef Vector<Treal, typename ElementType::VectorType> mat::Matrix< Treal, Treal >::VectorType

◆ VectorType [2/2]

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

Constructor & Destructor Documentation

◆ Matrix() [1/2]

◆ ~Matrix() [1/2]

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

◆ Matrix() [2/2]

mat::Matrix< Treal, Treal >::Matrix ( )
inline

◆ ~Matrix() [2/2]

mat::Matrix< Treal, Treal >::~Matrix ( )
inline

Member Function Documentation

◆ add() [1/2]

template<class Treal>
void mat::Matrix< Treal >::add ( const Treal alpha,
const Matrix< Treal > & A,
Matrix< Treal > & B )
static

◆ add() [2/2]

void mat::Matrix< Treal, Treal >::add ( const Treal alpha,
const Matrix< Treal, Treal > & A,
Matrix< Treal, Treal > & B )
static

◆ add_abs_col_sums() [1/2]

void mat::Matrix< Treal, Treal >::add_abs_col_sums ( Treal * abscolsums) const

◆ add_abs_col_sums() [2/2]

◆ addIdentity() [1/2]

void mat::Matrix< Treal, Treal >::addIdentity ( Treal alpha)

◆ addIdentity() [2/2]

◆ addValues() [1/4]

void mat::Matrix< Treal, Treal >::addValues ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > const & values )

◆ addValues() [2/4]

template<class Treal>
void mat::Matrix< Treal >::addValues ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > const & values )

◆ addValues() [3/4]

void mat::Matrix< Treal, Treal >::addValues ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > const & values,
std::vector< int > const & indexes )

◆ addValues() [4/4]

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 )

◆ allocate() [1/2]

void mat::Matrix< Treal, Treal >::allocate ( )
inline

◆ allocate() [2/2]

◆ assign() [1/2]

◆ assign() [2/2]

void mat::Matrix< Treal, Treal >::assign ( Treal const alpha,
Matrix< Treal, Treal > const & A )

◆ assignDiffFrobNormsLowestLevel() [1/2]

◆ assignDiffFrobNormsLowestLevel() [2/2]

void mat::Matrix< Treal, Treal >::assignDiffFrobNormsLowestLevel ( Matrix< Treal, Matrix< Treal, Treal > > const & A,
Matrix< Treal, Matrix< Treal, Treal > > const & B )

Same as assignFrobNormsLowestLevel except that the Frobenius norms of the differences between submatrices of A and B are assigned.

◆ assignFrobNormsLowestLevel() [1/2]

◆ assignFrobNormsLowestLevel() [2/2]

void mat::Matrix< Treal, Treal >::assignFrobNormsLowestLevel ( Matrix< Treal, Matrix< Treal, Treal > > const & A)

Build a matrix with single matrix elements at the lowest level containing the Frobenius norms of the submatrices of A.

◆ assignFromFull() [1/2]

void mat::Matrix< Treal, Treal >::assignFromFull ( std::vector< Treal > const & fullMat)

◆ assignFromFull() [2/2]

◆ assignFromSparse() [1/4]

void mat::Matrix< Treal, Treal >::assignFromSparse ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > const & values )

◆ assignFromSparse() [2/4]

template<class Treal>
void mat::Matrix< Treal >::assignFromSparse ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > const & values )

◆ assignFromSparse() [3/4]

void mat::Matrix< Treal, Treal >::assignFromSparse ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > const & values,
std::vector< int > const & indexes )

◆ assignFromSparse() [4/4]

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 )

◆ clear() [1/2]

void mat::Matrix< Treal, Treal >::clear ( )

◆ clear() [2/2]

◆ frob() [1/2]

Treal mat::Matrix< Treal, Treal >::frob ( ) const
inline

◆ frob() [2/2]

template<class Treal>
Treal mat::Matrix< Treal >::frob ( ) const
inline

◆ frob_squared_thresh() [1/2]

◆ frob_squared_thresh() [2/2]

Treal mat::Matrix< Treal, Treal >::frob_squared_thresh ( Treal const threshold,
Matrix< Treal, Treal > * ErrorMatrix = 0 )

Removes small elements so that the introduced error is smaller than threshold in the squared Frobenius norm, returns squared frobenius norm of the introduced error added to ErrorMatrix.

◆ frob_thresh() [1/2]

template<class Treal>
Treal mat::Matrix< Treal >::frob_thresh ( Treal const threshold,
Matrix< Treal > * ErrorMatrix = 0 )
inline

◆ frob_thresh() [2/2]

Treal mat::Matrix< Treal, Treal >::frob_thresh ( Treal const threshold,
Matrix< Treal, Treal > * ErrorMatrix = 0 )
inline

Removes small elements so that the introduced error is smaller than the threshold in the Frobenius norm Returns the Frobenius norm of the introduced error.

◆ frobDiff() [1/2]

template<class Treal>
static Treal mat::Matrix< Treal >::frobDiff ( const Matrix< Treal > & A,
const Matrix< Treal > & B )
inlinestatic

◆ frobDiff() [2/2]

static Treal mat::Matrix< Treal, Treal >::frobDiff ( const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B )
inlinestatic

◆ frobSquared() [1/2]

Treal mat::Matrix< Treal, Treal >::frobSquared ( ) const

◆ frobSquared() [2/2]

◆ frobSquaredDiff() [1/2]

template<class Treal>
Treal mat::Matrix< Treal >::frobSquaredDiff ( const Matrix< Treal > & A,
const Matrix< Treal > & B )
static

◆ frobSquaredDiff() [2/2]

Treal mat::Matrix< Treal, Treal >::frobSquaredDiff ( const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B )
static

◆ frobThreshElementLevel() [1/2]

◆ frobThreshElementLevel() [2/2]

void mat::Matrix< Treal, Treal >::frobThreshElementLevel ( Treal const threshold,
Matrix< Treal, Treal > * ErrorMatrix )

◆ frobThreshLowestLevel() [1/2]

template<class Treal>
void mat::Matrix< Treal >::frobThreshLowestLevel ( Treal const threshold,
Matrix< Treal > * ErrorMatrix )

◆ frobThreshLowestLevel() [2/2]

void mat::Matrix< Treal, Treal >::frobThreshLowestLevel ( Treal const threshold,
Matrix< Treal, Treal > * ErrorMatrix )

◆ fullMatrix() [1/2]

void mat::Matrix< Treal, Treal >::fullMatrix ( std::vector< Treal > & fullMat) const

◆ fullMatrix() [2/2]

◆ geAccumulateWith() [1/2]

Treal mat::Matrix< Treal, Treal >::geAccumulateWith ( Top & op)
inline

Accumulation algorithm for general matrices.

◆ geAccumulateWith() [2/2]

◆ gemm() [1/2]

◆ gemm() [2/2]

void mat::Matrix< Treal, Treal >::gemm ( const bool tA,
const bool tB,
const Treal alpha,
const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B,
const Treal beta,
Matrix< Treal, Treal > & C )
static

◆ gemm_upper_tr_only() [1/2]

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

◆ gemm_upper_tr_only() [2/2]

void mat::Matrix< Treal, Treal >::gemm_upper_tr_only ( const bool tA,
const bool tB,
const Treal alpha,
const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B,
const Treal beta,
Matrix< Treal, Treal > & C )
static

◆ gershgorin() [1/2]

void mat::Matrix< Treal, Treal >::gershgorin ( Treal & lmin,
Treal & lmax ) const

◆ gershgorin() [2/2]

◆ get_diagonal() [1/2]

void mat::Matrix< Treal, Treal >::get_diagonal ( Treal * diag) const

◆ get_diagonal() [2/2]

◆ getAllValues() [1/2]

void mat::Matrix< Treal, Treal >::getAllValues ( std::vector< int > & rowind,
std::vector< int > & colind,
std::vector< Treal > & values ) const

◆ getAllValues() [2/2]

◆ getFrobSqElementLevel() [1/2]

void mat::Matrix< Treal, Treal >::getFrobSqElementLevel ( std::vector< Treal > & frobsq) const

◆ getFrobSqElementLevel() [2/2]

template<class Treal>
void mat::Matrix< Treal >::getFrobSqElementLevel ( std::vector< Treal > & frobsq) const

◆ getFrobSqLowestLevel() [1/2]

void mat::Matrix< Treal, Treal >::getFrobSqLowestLevel ( std::vector< Treal > & frobsq) const

◆ getFrobSqLowestLevel() [2/2]

template<class Treal>
void mat::Matrix< Treal >::getFrobSqLowestLevel ( std::vector< Treal > & frobsq) const

◆ getValues() [1/4]

void mat::Matrix< Treal, Treal >::getValues ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > & values,
std::vector< int > const & indexes ) const

◆ getValues() [2/4]

void mat::Matrix< Treal, Treal >::getValues ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > & values ) const

◆ getValues() [3/4]

template<class Treal>
void mat::Matrix< Treal >::getValues ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > & values ) const

◆ getValues() [4/4]

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

◆ inch()

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

◆ level() [1/2]

static unsigned int mat::Matrix< Treal, Treal >::level ( )
inlinestatic

◆ level() [2/2]

template<class Treal>
static unsigned int mat::Matrix< Treal >::level ( )
inlinestatic

◆ maxAbsValue() [1/2]

Treal mat::Matrix< Treal, Treal >::maxAbsValue ( ) const
inline

◆ maxAbsValue() [2/2]

◆ memory_usage() [1/2]

size_t mat::Matrix< Treal, Treal >::memory_usage ( ) const

◆ memory_usage() [2/2]

◆ nnz() [1/2]

size_t mat::Matrix< Treal, Treal >::nnz ( ) const

Returns number of nonzeros in matrix.

◆ nnz() [2/2]

template<class Treal>
size_t mat::Matrix< Treal >::nnz ( ) const
inline

◆ nosymToSym() [1/2]

void mat::Matrix< Treal, Treal >::nosymToSym ( )

◆ nosymToSym() [2/2]

◆ nvalues() [1/2]

size_t mat::Matrix< Treal, Treal >::nvalues ( ) const
inline

Returns number of stored values in matrix.

Returns same number as nnz()

◆ nvalues() [2/2]

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

◆ operator*=() [1/2]

Matrix< Treal, Treal > & mat::Matrix< Treal, Treal >::operator*= ( const Treal alpha)

◆ operator*=() [2/2]

◆ operator=() [1/4]

template<class Treal>
Matrix< Treal > & mat::Matrix< Treal >::operator= ( const Matrix< Treal > & mat)
inline

◆ operator=() [2/4]

Matrix< Treal, Treal > & mat::Matrix< Treal, Treal >::operator= ( const Matrix< Treal, Treal > & mat)
inline

◆ operator=() [3/4]

Matrix< Treal, Treal > & mat::Matrix< Treal, Treal >::operator= ( int const k)

◆ operator=() [4/4]

◆ random() [1/2]

void mat::Matrix< Treal, Treal >::random ( )

◆ random() [2/2]

◆ randomZeroStructure() [1/2]

void mat::Matrix< Treal, Treal >::randomZeroStructure ( Treal probabilityBeingZero)

Get a random zero structure with a specified probability that each submatrix is zero.

◆ randomZeroStructure() [2/2]

template<class Treal>
void mat::Matrix< Treal >::randomZeroStructure ( Treal probabilityBeingZero)

◆ readFromFile() [1/2]

void mat::Matrix< Treal, Treal >::readFromFile ( std::ifstream & file)

◆ readFromFile() [2/2]

◆ setElementsByRule() [1/2]

void mat::Matrix< Treal, Treal >::setElementsByRule ( TRule & rule)

◆ setElementsByRule() [2/2]

◆ ssmm() [1/2]

◆ ssmm() [2/2]

void mat::Matrix< Treal, Treal >::ssmm ( const Treal alpha,
const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B,
const Treal beta,
Matrix< Treal, Treal > & C )
static

◆ ssmm_upper_tr_only() [1/2]

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

◆ ssmm_upper_tr_only() [2/2]

void mat::Matrix< Treal, Treal >::ssmm_upper_tr_only ( const Treal alpha,
const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B,
const Treal beta,
Matrix< Treal, Treal > & C )
static

◆ sy_gershgorin() [1/2]

void mat::Matrix< Treal, Treal >::sy_gershgorin ( Treal & lmin,
Treal & lmax ) const
inline

◆ sy_gershgorin() [2/2]

template<class Treal>
void mat::Matrix< Treal >::sy_gershgorin ( Treal & lmin,
Treal & lmax ) const
inline

◆ sy_nnz() [1/2]

size_t mat::Matrix< Treal, Treal >::sy_nnz ( ) const

Returns number of nonzeros in matrix including lower triangle elements.

◆ sy_nnz() [2/2]

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

Returns number of nonzeros in matrix including lower triangle elements.

References mat::MatrixHierarchicBase< Treal, Treal >::is_zero(), and mat::MatrixHierarchicBase< Treal, Treal >::nElements().

◆ sy_nvalues() [1/2]

size_t mat::Matrix< Treal, Treal >::sy_nvalues ( ) const

Returns number of stored values in matrix.

Lower triangle is not included. Lower triangle in diagonal submatrices is not included as well. Different from sy_nnz().

◆ sy_nvalues() [2/2]

◆ sy_trace_ab() [1/2]

template<class Treal>
Treal mat::Matrix< Treal >::sy_trace_ab ( const Matrix< Treal > & A,
const Matrix< Treal > & B )
static

◆ sy_trace_ab() [2/2]

Treal mat::Matrix< Treal, Treal >::sy_trace_ab ( const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B )
static

◆ syAccumulateWith() [1/2]

Treal mat::Matrix< Treal, Treal >::syAccumulateWith ( Top & op)
inline

◆ syAccumulateWith() [2/2]

◆ syAddValues() [1/2]

void mat::Matrix< Treal, Treal >::syAddValues ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > const & values )

◆ syAddValues() [2/2]

template<class Treal>
void mat::Matrix< Treal >::syAddValues ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > const & values )

◆ syAssignDiffFrobNormsLowestLevel() [1/2]

◆ syAssignDiffFrobNormsLowestLevel() [2/2]

void mat::Matrix< Treal, Treal >::syAssignDiffFrobNormsLowestLevel ( Matrix< Treal, Matrix< Treal, Treal > > const & A,
Matrix< Treal, Matrix< Treal, Treal > > const & B )

Same as syAssignFrobNormsLowestLevel except that the Frobenius norms of the differences between submatrices of A and B are assigned.

◆ syAssignFrobNormsLowestLevel() [1/2]

◆ syAssignFrobNormsLowestLevel() [2/2]

void mat::Matrix< Treal, Treal >::syAssignFrobNormsLowestLevel ( Matrix< Treal, Matrix< Treal, Treal > > const & A)

Version of assignFrobNormsLowestLevelToMatrix for symmetric matrices.

◆ syAssignFromSparse() [1/2]

void mat::Matrix< Treal, Treal >::syAssignFromSparse ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > const & values )

◆ syAssignFromSparse() [2/2]

template<class Treal>
void mat::Matrix< Treal >::syAssignFromSparse ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > const & values )

◆ syFrob() [1/2]

Treal mat::Matrix< Treal, Treal >::syFrob ( ) const
inline

◆ syFrob() [2/2]

template<class Treal>
Treal mat::Matrix< Treal >::syFrob ( ) const
inline

◆ syFrobDiff() [1/2]

template<class Treal>
static Treal mat::Matrix< Treal >::syFrobDiff ( const Matrix< Treal > & A,
const Matrix< Treal > & B )
inlinestatic

◆ syFrobDiff() [2/2]

static Treal mat::Matrix< Treal, Treal >::syFrobDiff ( const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B )
inlinestatic

◆ syFrobSquared() [1/2]

Treal mat::Matrix< Treal, Treal >::syFrobSquared ( ) const

◆ syFrobSquared() [2/2]

◆ syFrobSquaredDiff() [1/2]

template<class Treal>
Treal mat::Matrix< Treal >::syFrobSquaredDiff ( const Matrix< Treal > & A,
const Matrix< Treal > & B )
static

◆ syFrobSquaredDiff() [2/2]

Treal mat::Matrix< Treal, Treal >::syFrobSquaredDiff ( const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B )
static

◆ syFullMatrix() [1/2]

void mat::Matrix< Treal, Treal >::syFullMatrix ( std::vector< Treal > & fullMat) const

◆ syFullMatrix() [2/2]

◆ syGetAllValues() [1/2]

void mat::Matrix< Treal, Treal >::syGetAllValues ( std::vector< int > & rowind,
std::vector< int > & colind,
std::vector< Treal > & values ) const

◆ syGetAllValues() [2/2]

◆ syGetValues() [1/2]

void mat::Matrix< Treal, Treal >::syGetValues ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > & values ) const

◆ syGetValues() [2/2]

template<class Treal>
void mat::Matrix< Treal >::syGetValues ( std::vector< int > const & rowind,
std::vector< int > const & colind,
std::vector< Treal > & values ) const

◆ syInch() [1/2]

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

References A, inch(), mat::left, Matrix(), and mat::unstable.

◆ syInch() [2/2]

void mat::Matrix< Treal, Treal >::syInch ( const Matrix< Treal, Treal > & A,
Matrix< Treal, Treal > & Z,
const Treal threshold = 0,
const side looking = left,
const inchversion version = unstable )
static

◆ symm() [1/2]

◆ symm() [2/2]

void mat::Matrix< Treal, Treal >::symm ( const char side,
const char uplo,
const Treal alpha,
const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B,
const Treal beta,
Matrix< Treal, Treal > & C )
static

◆ symToNosym() [1/2]

void mat::Matrix< Treal, Treal >::symToNosym ( )

◆ symToNosym() [2/2]

◆ syRandom() [1/2]

void mat::Matrix< Treal, Treal >::syRandom ( )

◆ syRandom() [2/2]

◆ syRandomZeroStructure() [1/2]

void mat::Matrix< Treal, Treal >::syRandomZeroStructure ( Treal probabilityBeingZero)

◆ syRandomZeroStructure() [2/2]

template<class Treal>
void mat::Matrix< Treal >::syRandomZeroStructure ( Treal probabilityBeingZero)

◆ syrk() [1/2]

◆ syrk() [2/2]

void mat::Matrix< Treal, Treal >::syrk ( const char uplo,
const bool tA,
const Treal alpha,
const Matrix< Treal, Treal > & A,
const Treal beta,
Matrix< Treal, Treal > & C )
static

◆ sySetElementsByRule() [1/2]

void mat::Matrix< Treal, Treal >::sySetElementsByRule ( TRule & rule)

◆ sySetElementsByRule() [2/2]

template<class Treal>
template<typename TRule>
void mat::Matrix< Treal >::sySetElementsByRule ( TRule & rule)

◆ sysq() [1/2]

◆ sysq() [2/2]

void mat::Matrix< Treal, Treal >::sysq ( const char uplo,
const Treal alpha,
const Matrix< Treal, Treal > & A,
const Treal beta,
Matrix< Treal, Treal > & C )
static

◆ sytr_upper_tr_only() [1/2]

template<class Treal>
void mat::Matrix< Treal >::sytr_upper_tr_only ( char const side,
const Treal alpha,
Matrix< Treal > & A,
const Matrix< Treal > & Z )
static

◆ sytr_upper_tr_only() [2/2]

void mat::Matrix< Treal, Treal >::sytr_upper_tr_only ( char const side,
const Treal alpha,
Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & Z )
static

◆ syUpTriFullMatrix() [1/2]

void mat::Matrix< Treal, Treal >::syUpTriFullMatrix ( std::vector< Treal > & fullMat) const

◆ syUpTriFullMatrix() [2/2]

◆ trace() [1/2]

Treal mat::Matrix< Treal, Treal >::trace ( ) const

◆ trace() [2/2]

◆ trace_ab() [1/2]

template<class Treal>
Treal mat::Matrix< Treal >::trace_ab ( const Matrix< Treal > & A,
const Matrix< Treal > & B )
static

◆ trace_ab() [2/2]

Treal mat::Matrix< Treal, Treal >::trace_ab ( const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B )
static

◆ trace_aTb() [1/2]

template<class Treal>
Treal mat::Matrix< Treal >::trace_aTb ( const Matrix< Treal > & A,
const Matrix< Treal > & B )
static

◆ trace_aTb() [2/2]

Treal mat::Matrix< Treal, Treal >::trace_aTb ( const Matrix< Treal, Treal > & A,
const Matrix< Treal, Treal > & B )
static

◆ transpose() [1/2]

◆ transpose() [2/2]

void mat::Matrix< Treal, Treal >::transpose ( Matrix< Treal, Treal > const & A,
Matrix< Treal, Treal > & AT )
static

◆ trmm() [1/2]

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

◆ trmm() [2/2]

void mat::Matrix< Treal, Treal >::trmm ( const char side,
const char uplo,
const bool tA,
const Treal alpha,
const Matrix< Treal, Treal > & A,
Matrix< Treal, Treal > & B )
static

◆ trmm_upper_tr_only() [1/2]

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

◆ trmm_upper_tr_only() [2/2]

void mat::Matrix< Treal, Treal >::trmm_upper_tr_only ( const char side,
const char uplo,
const bool tA,
const Treal alpha,
const Matrix< Treal, Treal > & A,
Matrix< Treal, Treal > & B )
static

◆ trSetElementsByRule()

void mat::Matrix< Treal, Treal >::trSetElementsByRule ( TRule & rule)
inline

◆ trsytriplemm() [1/2]

◆ trsytriplemm() [2/2]

void mat::Matrix< Treal, Treal >::trsytriplemm ( char const side,
const Matrix< Treal, Treal > & Z,
Matrix< Treal, Treal > & A )
static

◆ truncateAccordingToSparsityPattern() [1/2]

◆ truncateAccordingToSparsityPattern() [2/2]

void mat::Matrix< Treal, Treal >::truncateAccordingToSparsityPattern ( Matrix< Treal, Matrix< Treal, Treal > > & A) const

Truncate matrix A according to the sparsity pattern of the this matrix (frobNormMat).

◆ writeToFile() [1/2]

void mat::Matrix< Treal, Treal >::writeToFile ( std::ofstream & file) const

◆ writeToFile() [2/2]

Friends And Related Symbol Documentation

◆ Vector< Treal, Telement >

friend class Vector< Treal, Treal >
friend

◆ Vector< Treal, Treal >

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

Member Data Documentation

◆ ONE

template<class Treal>
const Treal mat::Matrix< Treal >::ONE
staticprivate

Referenced by readFromFile(), and writeToFile().

◆ ZERO

template<class Treal>
const Treal mat::Matrix< Treal >::ZERO
staticprivate

Referenced by readFromFile(), and writeToFile().


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