Matrix class and heart of the matrix library. More...
#include <Matrix.h>
Public Types | |
| typedef Telement | 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 > &, 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, Telement > & | operator= (const Matrix< Treal, Telement > &mat) |
| 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) |
| template<typename TRule > | |
| void | setElementsByRule (TRule &rule) |
| template<typename TRule > | |
| void | sySetElementsByRule (TRule &rule) |
| template<typename TRule > | |
| void | trSetElementsByRule (TRule &rule) |
| void | addIdentity (Treal alpha) |
| void | symToNosym () |
| void | nosymToSym () |
| Matrix< Treal, Telement > & | operator= (int const k) |
| Matrix< Treal, Telement > & | 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, Telement > const &A) |
| void | getFrobSqLowestLevel (std::vector< Treal > &frobsq) const |
| void | frobThreshLowestLevel (Treal const threshold, Matrix< Treal, Telement > *ErrorMatrix) |
| void | getFrobSqElementLevel (std::vector< Treal > &frobsq) const |
| void | frobThreshElementLevel (Treal const threshold, Matrix< Treal, Telement > *ErrorMatrix) |
| void | assignFrobNormsLowestLevel (Matrix< Treal, Matrix< Treal, Telement > > 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, Telement > > const &A) |
| Version of assignFrobNormsLowestLevelToMatrix for symmetric matrices. | |
| void | assignDiffFrobNormsLowestLevel (Matrix< Treal, Matrix< Treal, Telement > > const &A, Matrix< Treal, Matrix< Treal, Telement > > 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, Telement > > const &A, Matrix< Treal, Matrix< Treal, Telement > > 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, Telement > > &A) const |
| Truncate matrix A according to the sparsity pattern of the this matrix (frobNormMat). | |
| Treal | frob_thresh (Treal const threshold, Matrix< Treal, Telement > *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, Telement > *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. | |
| template<typename Top > | |
| Treal | syAccumulateWith (Top &op) |
| template<typename Top > | |
| Treal | geAccumulateWith (Top &op) |
| Accumulation algorithm for general matrices. | |
| Treal | maxAbsValue () const |
Static Public Member Functions | |
| static void | transpose (Matrix< Treal, Telement > const &A, Matrix< Treal, Telement > &AT) |
| static void | gemm (const bool tA, const bool tB, const Treal alpha, const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B, const Treal beta, Matrix< Treal, Telement > &C) |
| static void | symm (const char side, const char uplo, const Treal alpha, const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B, const Treal beta, Matrix< Treal, Telement > &C) |
| static void | syrk (const char uplo, const bool tA, const Treal alpha, const Matrix< Treal, Telement > &A, const Treal beta, Matrix< Treal, Telement > &C) |
| static void | sysq (const char uplo, const Treal alpha, const Matrix< Treal, Telement > &A, const Treal beta, Matrix< Treal, Telement > &C) |
| static void | ssmm (const Treal alpha, const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B, const Treal beta, Matrix< Treal, Telement > &C) |
| static void | ssmm_upper_tr_only (const Treal alpha, const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B, const Treal beta, Matrix< Treal, Telement > &C) |
| static void | trmm (const char side, const char uplo, const bool tA, const Treal alpha, const Matrix< Treal, Telement > &A, Matrix< Treal, Telement > &B) |
| static Treal | frobDiff (const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B) |
| static Treal | frobSquaredDiff (const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B) |
| static Treal | syFrobDiff (const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B) |
| static Treal | syFrobSquaredDiff (const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B) |
| static Treal | trace_ab (const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B) |
| static Treal | trace_aTb (const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B) |
| static Treal | sy_trace_ab (const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B) |
| static void | add (const Treal alpha, const Matrix< Treal, Telement > &A, Matrix< Treal, Telement > &B) |
| static void | gemm_upper_tr_only (const bool tA, const bool tB, const Treal alpha, const Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &B, const Treal beta, Matrix< Treal, Telement > &C) |
| static void | sytr_upper_tr_only (char const side, const Treal alpha, Matrix< Treal, Telement > &A, const Matrix< Treal, Telement > &Z) |
| static void | trmm_upper_tr_only (const char side, const char uplo, const bool tA, const Treal alpha, const Matrix< Treal, Telement > &A, Matrix< Treal, Telement > &B) |
| static void | trsytriplemm (char const side, const Matrix< Treal, Telement > &Z, Matrix< Treal, Telement > &A) |
| static void | syInch (const Matrix< Treal, Telement > &A, Matrix< Treal, Telement > &Z, const Treal threshold=0, const side looking=left, const inchversion version=unstable) |
| static unsigned int | level () |
Friends | |
| class | Vector< Treal, Telement > |
Matrix class and heart of the matrix library.
This class is used to obtain the hierarchic data structure.
| typedef Telement mat::Matrix< Treal, Telement >::ElementType |
| typedef Vector<Treal, typename ElementType::VectorType> mat::Matrix< Treal, Telement >::VectorType |
| mat::Matrix< Treal, Telement >::Matrix | ( | ) | [inline] |
| mat::Matrix< Treal, Telement >::~Matrix | ( | ) | [inline] |
References mat::Matrix< Treal, Telement >::clear().
| void mat::Matrix< Treal, Telement >::add | ( | const Treal | alpha, | |
| const Matrix< Treal, Telement > & | A, | |||
| Matrix< Treal, Telement > & | B | |||
| ) | [inline, static] |
References mat::Matrix< Treal, Telement >::allocate(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::elements, mat::MatrixHierarchicBase< Treal, Telement >::ncols(), and mat::MatrixHierarchicBase< Treal, Telement >::nrows().
Referenced by mat::Matrix< Treal >::assign(), mat::Matrix< Treal, Telement >::assign(), mat::Matrix< Treal >::assignDiffFrobNormsLowestLevel(), mat::Matrix< Treal >::syAssignDiffFrobNormsLowestLevel(), and mat::Matrix< Treal, Telement >::syInch().
| void mat::Matrix< Treal, Telement >::add_abs_col_sums | ( | Treal * | abscolsums | ) | const [inline] |
References mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), and mat::MatrixHierarchicBase< Treal, Telement >::nScalarsCols().
Referenced by mat::Matrix< Treal >::gershgorin(), and mat::Matrix< Treal, Telement >::gershgorin().
| void mat::Matrix< Treal, Telement >::addIdentity | ( | Treal | alpha | ) | [inline] |
| void mat::Matrix< Treal, Telement >::addValues | ( | std::vector< int > const & | rowind, | |
| std::vector< int > const & | colind, | |||
| std::vector< Treal > const & | values, | |||
| std::vector< int > const & | indexes | |||
| ) | [inline] |
References mat::Matrix< Treal, Telement >::addValues(), mat::Matrix< Treal, Telement >::allocate(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::SizesAndBlocks::getNBlocks(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::MatrixHierarchicBase< Treal, Telement >::rows, and mat::SizesAndBlocks::whichBlock().
| void mat::Matrix< Treal, Telement >::addValues | ( | std::vector< int > const & | rowind, | |
| std::vector< int > const & | colind, | |||
| std::vector< Treal > const & | values | |||
| ) | [inline] |
| void mat::Matrix< Treal, Telement >::allocate | ( | ) | [inline] |
References mat::SingletonForTimings::addTime(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::MatrixHierarchicBase< Treal, Telement >::elements, mat::SizesAndBlocks::getNBlocks(), mat::SizesAndBlocks::getSizesAndBlocksForLowerLevel(), mat::SingletonForTimings::instance(), mat::MatrixHierarchicBase< Treal, Telement >::rows, mat::Time::tic(), and mat::Time::toc().
Referenced by mat::Matrix< Treal, Telement >::add(), mat::Matrix< Treal >::addIdentity(), mat::Matrix< Treal, Telement >::addIdentity(), mat::Matrix< Treal >::addValues(), mat::Matrix< Treal, Telement >::addValues(), mat::Matrix< Treal >::assignDiffFrobNormsLowestLevel(), mat::Matrix< Treal >::assignFrobNormsLowestLevel(), mat::Matrix< Treal >::assignFromFull(), mat::Matrix< Treal, Telement >::assignFromFull(), mat::Matrix< Treal >::assignFromSparse(), mat::Matrix< Treal, Telement >::assignFromSparse(), mat::Matrix< Treal, Telement >::frobThreshElementLevel(), mat::Matrix< Treal, Telement >::frobThreshLowestLevel(), mat::Matrix< Treal, Telement >::gemm(), mat::Matrix< Treal, Telement >::gemm_upper_tr_only(), mat::Matrix< Treal >::operator=(), mat::Matrix< Treal, Telement >::operator=(), mat::Matrix< Treal >::random(), mat::Matrix< Treal, Telement >::random(), mat::Matrix< Treal, Telement >::randomZeroStructure(), mat::Matrix< Treal >::readFromFile(), mat::Matrix< Treal, Telement >::readFromFile(), mat::Matrix< Treal >::setElementsByRule(), mat::Matrix< Treal, Telement >::setElementsByRule(), mat::Matrix< Treal, Telement >::ssmm(), mat::Matrix< Treal, Telement >::ssmm_upper_tr_only(), mat::Matrix< Treal >::syAssignDiffFrobNormsLowestLevel(), mat::Matrix< Treal >::syAssignFrobNormsLowestLevel(), mat::Matrix< Treal, Telement >::syInch(), mat::Matrix< Treal, Telement >::symm(), mat::Matrix< Treal >::syRandom(), mat::Matrix< Treal, Telement >::syRandom(), mat::Matrix< Treal, Telement >::syRandomZeroStructure(), mat::Matrix< Treal, Telement >::syrk(), mat::Matrix< Treal >::sySetElementsByRule(), mat::Matrix< Treal, Telement >::sySetElementsByRule(), and mat::Matrix< Treal, Telement >::sysq().
| void mat::Matrix< Treal, Telement >::assign | ( | Treal const | alpha, | |
| Matrix< Treal, Telement > const & | A | |||
| ) | [inline] |
| void mat::Matrix< Treal, Telement >::assignDiffFrobNormsLowestLevel | ( | Matrix< Treal, Matrix< Treal, Telement > > const & | A, | |
| Matrix< Treal, Matrix< Treal, Telement > > const & | B | |||
| ) | [inline] |
Same as assignFrobNormsLowestLevel except that the Frobenius norms of the differences between submatrices of A and B are assigned.
| void mat::Matrix< Treal, Telement >::assignFrobNormsLowestLevel | ( | Matrix< Treal, Matrix< Treal, Telement > > const & | A | ) | [inline] |
Build a matrix with single matrix elements at the lowest level containing the Frobenius norms of the submatrices of A.
Referenced by mat::Matrix< Treal >::assignDiffFrobNormsLowestLevel().
| void mat::Matrix< Treal, Telement >::assignFromFull | ( | std::vector< Treal > const & | fullMat | ) | [inline] |
References mat::Matrix< Treal, Telement >::allocate(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::SizesAndBlocks::getNTotalScalars(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), and mat::MatrixHierarchicBase< Treal, Telement >::rows.
| void mat::Matrix< Treal, Telement >::assignFromSparse | ( | std::vector< int > const & | rowind, | |
| std::vector< int > const & | colind, | |||
| std::vector< Treal > const & | values, | |||
| std::vector< int > const & | indexes | |||
| ) | [inline] |
References mat::Matrix< Treal, Telement >::allocate(), mat::Matrix< Treal, Telement >::assignFromSparse(), mat::Matrix< Treal, Telement >::clear(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::SizesAndBlocks::getNBlocks(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::MatrixHierarchicBase< Treal, Telement >::rows, and mat::SizesAndBlocks::whichBlock().
| void mat::Matrix< Treal, Telement >::assignFromSparse | ( | std::vector< int > const & | rowind, | |
| std::vector< int > const & | colind, | |||
| std::vector< Treal > const & | values | |||
| ) | [inline] |
| void mat::Matrix< Treal, Telement >::clear | ( | ) | [inline] |
References mat::MatrixHierarchicBase< Treal, Telement >::elements, and mat::freeElements().
Referenced by mat::Matrix< Treal >::assignDiffFrobNormsLowestLevel(), mat::Matrix< Treal >::assignFrobNormsLowestLevel(), mat::Matrix< Treal >::assignFromSparse(), mat::Matrix< Treal, Telement >::assignFromSparse(), mat::Matrix< Treal, Telement >::frobThreshElementLevel(), mat::Matrix< Treal, Telement >::frobThreshLowestLevel(), mat::Matrix< Treal, Telement >::nosymToSym(), mat::Matrix< Treal >::operator=(), mat::Matrix< Treal, Telement >::operator=(), mat::Matrix< Treal >::randomZeroStructure(), mat::Matrix< Treal, Telement >::randomZeroStructure(), mat::Matrix< Treal >::readFromFile(), mat::Matrix< Treal, Telement >::readFromFile(), mat::Matrix< Treal >::syAssignDiffFrobNormsLowestLevel(), mat::Matrix< Treal >::syAssignFrobNormsLowestLevel(), mat::Matrix< Treal >::syRandomZeroStructure(), mat::Matrix< Treal, Telement >::syRandomZeroStructure(), mat::Matrix< Treal, Telement >::truncateAccordingToSparsityPattern(), mat::Matrix< Treal >::~Matrix(), and mat::Matrix< Treal, Telement >::~Matrix().
| Treal mat::Matrix< Treal, Telement >::frob | ( | ) | const [inline] |
References mat::Matrix< Treal, Telement >::frobSquared(), and template_blas_sqrt().
Referenced by mat::Matrix< Treal >::assignFrobNormsLowestLevel().
| Treal mat::Matrix< Treal, Telement >::frob_squared_thresh | ( | Treal const | threshold, | |
| Matrix< Treal, Telement > * | ErrorMatrix = 0 | |||
| ) | [inline] |
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.
References mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::Matrix< Treal, Telement >::frobThreshLowestLevel(), mat::Matrix< Treal, Telement >::getFrobSqLowestLevel(), mat::MatrixHierarchicBase< Treal, Telement >::rows, and mat::MatrixHierarchicBase< Treal, Telement >::swap().
Referenced by mat::Matrix< Treal >::frob_thresh(), and mat::Matrix< Treal, Telement >::frob_thresh().
| Treal mat::Matrix< Treal, Telement >::frob_thresh | ( | Treal const | threshold, | |
| Matrix< Treal, Telement > * | 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.
References mat::Matrix< Treal, Telement >::frob_squared_thresh(), and template_blas_sqrt().
Referenced by mat::Matrix< Treal, Telement >::syInch().
| static Treal mat::Matrix< Treal, Telement >::frobDiff | ( | const Matrix< Treal, Telement > & | A, | |
| const Matrix< Treal, Telement > & | B | |||
| ) | [inline, static] |
References mat::Matrix< Treal, Telement >::frobSquaredDiff(), and template_blas_sqrt().
| Treal mat::Matrix< Treal, Telement >::frobSquared | ( | ) | const [inline] |
References mat::MatrixHierarchicBase< Treal, Telement >::assert(), and mat::MatrixHierarchicBase< Treal, Telement >::elements.
Referenced by mat::Matrix< Treal >::frob(), mat::Matrix< Treal, Telement >::frob(), mat::Matrix< Treal, Telement >::frobSquaredDiff(), mat::Matrix< Treal >::getFrobSqLowestLevel(), and mat::Matrix< Treal, Telement >::syFrobSquared().
| Treal mat::Matrix< Treal, Telement >::frobSquaredDiff | ( | const Matrix< Treal, Telement > & | A, | |
| const Matrix< Treal, Telement > & | B | |||
| ) | [inline, static] |
References mat::MatrixHierarchicBase< Treal, Telement >::elements, mat::Matrix< Treal, Telement >::frobSquared(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), and mat::MatrixHierarchicBase< Treal, Telement >::nrows().
Referenced by mat::Matrix< Treal >::frobDiff(), and mat::Matrix< Treal, Telement >::frobDiff().
| void mat::Matrix< Treal, Telement >::frobThreshElementLevel | ( | Treal const | threshold, | |
| Matrix< Treal, Telement > * | ErrorMatrix | |||
| ) | [inline] |
| void mat::Matrix< Treal, Telement >::frobThreshLowestLevel | ( | Treal const | threshold, | |
| Matrix< Treal, Telement > * | ErrorMatrix | |||
| ) | [inline] |
| void mat::Matrix< Treal, Telement >::fullMatrix | ( | std::vector< Treal > & | fullMat | ) | const [inline] |
References mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::SizesAndBlocks::getNTotalScalars(), mat::SizesAndBlocks::getOffset(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::MatrixHierarchicBase< Treal, Telement >::nScalarsCols(), mat::MatrixHierarchicBase< Treal, Telement >::nScalarsRows(), and mat::MatrixHierarchicBase< Treal, Telement >::rows.
| Treal mat::Matrix< Treal, Telement >::geAccumulateWith | ( | Top & | op | ) | [inline] |
Accumulation algorithm for general matrices.
References mat::MatrixHierarchicBase< Treal, Telement >::ncols(), and mat::MatrixHierarchicBase< Treal, Telement >::nrows().
Referenced by mat::Matrix< Treal, Telement >::syAccumulateWith().
| void mat::Matrix< Treal, Telement >::gemm | ( | const bool | tA, | |
| const bool | tB, | |||
| const Treal | alpha, | |||
| const Matrix< Treal, Telement > & | A, | |||
| const Matrix< Treal, Telement > & | B, | |||
| const Treal | beta, | |||
| Matrix< Treal, Telement > & | C | |||
| ) | [inline, static] |
References mat::Matrix< Treal, Telement >::allocate(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::gemm(), MAT_OMP_END, MAT_OMP_FINALIZE, MAT_OMP_INIT, MAT_OMP_START, mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), and mat::MatrixHierarchicBase< Treal, Telement >::rows.
Referenced by mat::Matrix< Treal >::gemm_upper_tr_only(), mat::Matrix< Treal, Telement >::gemm_upper_tr_only(), mat::Matrix< Treal, Telement >::syrk(), and mat::Matrix< Treal, Telement >::sytr_upper_tr_only().
| void mat::Matrix< Treal, Telement >::gemm_upper_tr_only | ( | const bool | tA, | |
| const bool | tB, | |||
| const Treal | alpha, | |||
| const Matrix< Treal, Telement > & | A, | |||
| const Matrix< Treal, Telement > & | B, | |||
| const Treal | beta, | |||
| Matrix< Treal, Telement > & | C | |||
| ) | [inline, static] |
References mat::Matrix< Treal, Telement >::allocate(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::gemm(), mat::Matrix< Treal, Telement >::gemm(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), and mat::MatrixHierarchicBase< Treal, Telement >::rows.
Referenced by mat::Matrix< Treal, Telement >::sytr_upper_tr_only().
| void mat::Matrix< Treal, Telement >::gershgorin | ( | Treal & | lmin, | |
| Treal & | lmax | |||
| ) | const [inline] |
References mat::Matrix< Treal, Telement >::add_abs_col_sums(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::Matrix< Treal, Telement >::get_diagonal(), mat::MatrixHierarchicBase< Treal, Telement >::nScalarsCols(), mat::MatrixHierarchicBase< Treal, Telement >::nScalarsRows(), and template_blas_fabs().
Referenced by mat::Matrix< Treal, Telement >::sy_gershgorin().
| void mat::Matrix< Treal, Telement >::get_diagonal | ( | Treal * | diag | ) | const [inline] |
References mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), and mat::MatrixHierarchicBase< Treal, Telement >::nScalarsCols().
Referenced by mat::Matrix< Treal >::gershgorin(), and mat::Matrix< Treal, Telement >::gershgorin().
| void mat::Matrix< Treal, Telement >::getAllValues | ( | std::vector< int > & | rowind, | |
| std::vector< int > & | colind, | |||
| std::vector< Treal > & | values | |||
| ) | const [inline] |
| void mat::Matrix< Treal, Telement >::getFrobSqElementLevel | ( | std::vector< Treal > & | frobsq | ) | const [inline] |
| void mat::Matrix< Treal, Telement >::getFrobSqLowestLevel | ( | std::vector< Treal > & | frobsq | ) | const [inline] |
References mat::MatrixHierarchicBase< Treal, Telement >::elements.
Referenced by mat::Matrix< Treal, Telement >::frob_squared_thresh().
| void mat::Matrix< Treal, Telement >::getValues | ( | std::vector< int > const & | rowind, | |
| std::vector< int > const & | colind, | |||
| std::vector< Treal > & | values, | |||
| std::vector< int > const & | indexes | |||
| ) | const [inline] |
References mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::SizesAndBlocks::getNBlocks(), mat::Matrix< Treal, Telement >::getValues(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::MatrixHierarchicBase< Treal, Telement >::rows, and mat::SizesAndBlocks::whichBlock().
| void mat::Matrix< Treal, Telement >::getValues | ( | std::vector< int > const & | rowind, | |
| std::vector< int > const & | colind, | |||
| std::vector< Treal > & | values | |||
| ) | const [inline] |
| static unsigned int mat::Matrix< Treal, Telement >::level | ( | ) | [inline, static] |
| Treal mat::Matrix< Treal, Telement >::maxAbsValue | ( | ) | const [inline] |
| size_t mat::Matrix< Treal, Telement >::memory_usage | ( | ) | const [inline] |
| size_t mat::Matrix< Treal, Telement >::nnz | ( | ) | const [inline] |
Returns number of nonzeros in matrix.
References mat::MatrixHierarchicBase< Treal, Telement >::elements.
Referenced by mat::Matrix< Treal >::nvalues(), mat::Matrix< Treal, Telement >::nvalues(), and mat::Matrix< Treal, Telement >::sy_nnz().
| void mat::Matrix< Treal, Telement >::nosymToSym | ( | ) | [inline] |
| size_t mat::Matrix< Treal, Telement >::nvalues | ( | ) | const [inline] |
Returns number of stored values in matrix.
Returns same number as nnz()
References mat::Matrix< Treal, Telement >::nnz().
Referenced by mat::Matrix< Treal, Telement >::sy_nvalues().
| Matrix< Treal, Telement > & mat::Matrix< Treal, Telement >::operator*= | ( | const Treal | alpha | ) | [inline] |
| Matrix< Treal, Telement > & mat::Matrix< Treal, Telement >::operator= | ( | int const | k | ) | [inline] |
| Matrix<Treal, Telement>& mat::Matrix< Treal, Telement >::operator= | ( | const Matrix< Treal, Telement > & | mat | ) | [inline] |
Reimplemented from mat::MatrixHierarchicBase< Treal, Telement >.
Referenced by mat::Matrix< Treal >::operator=().
| void mat::Matrix< Treal, Telement >::random | ( | ) | [inline] |
| void mat::Matrix< Treal, Telement >::randomZeroStructure | ( | Treal | probabilityBeingZero | ) | [inline] |
Get a random zero structure with a specified probability that each submatrix is zero.
References mat::Matrix< Treal, Telement >::allocate(), mat::Matrix< Treal, Telement >::clear(), and mat::MatrixHierarchicBase< Treal, Telement >::elements.
Referenced by mat::Matrix< Treal, Telement >::syRandomZeroStructure().
| void mat::Matrix< Treal, Telement >::readFromFile | ( | std::ifstream & | file | ) | [inline] |
| void mat::Matrix< Treal, Telement >::setElementsByRule | ( | TRule & | rule | ) | [inline] |
| void mat::Matrix< Treal, Telement >::ssmm | ( | const Treal | alpha, | |
| const Matrix< Treal, Telement > & | A, | |||
| const Matrix< Treal, Telement > & | B, | |||
| const Treal | beta, | |||
| Matrix< Treal, Telement > & | C | |||
| ) | [inline, static] |
References mat::Matrix< Treal, Telement >::allocate(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::gemm(), MAT_OMP_END, MAT_OMP_FINALIZE, MAT_OMP_INIT, MAT_OMP_START, mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::MatrixHierarchicBase< Treal, Telement >::rows, mat::Matrix< Treal, Telement >::symm(), and mat::Matrix< Treal, Telement >::transpose().
Referenced by mat::Matrix< Treal >::ssmm_upper_tr_only().
| void mat::Matrix< Treal, Telement >::ssmm_upper_tr_only | ( | const Treal | alpha, | |
| const Matrix< Treal, Telement > & | A, | |||
| const Matrix< Treal, Telement > & | B, | |||
| const Treal | beta, | |||
| Matrix< Treal, Telement > & | C | |||
| ) | [inline, static] |
References mat::Matrix< Treal, Telement >::allocate(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::gemm(), MAT_OMP_END, MAT_OMP_FINALIZE, MAT_OMP_INIT, MAT_OMP_START, mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::MatrixHierarchicBase< Treal, Telement >::rows, and mat::Matrix< Treal, Telement >::symm().
| void mat::Matrix< Treal, Telement >::sy_gershgorin | ( | Treal & | lmin, | |
| Treal & | lmax | |||
| ) | const [inline] |
| size_t mat::Matrix< Treal, Telement >::sy_nnz | ( | ) | const [inline] |
Returns number of nonzeros in matrix including lower triangle elements.
References mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::Matrix< Treal, Telement >::nnz(), and mat::MatrixHierarchicBase< Treal, Telement >::nrows().
| size_t mat::Matrix< Treal, Telement >::sy_nvalues | ( | ) | const [inline] |
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().
References mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), and mat::Matrix< Treal, Telement >::nvalues().
| Treal mat::Matrix< Treal, Telement >::sy_trace_ab | ( | const Matrix< Treal, Telement > & | A, | |
| const Matrix< Treal, Telement > & | B | |||
| ) | [inline, static] |
| Treal mat::Matrix< Treal, Telement >::syAccumulateWith | ( | Top & | op | ) | [inline] |
| void mat::Matrix< Treal, Telement >::syAddValues | ( | std::vector< int > const & | rowind, | |
| std::vector< int > const & | colind, | |||
| std::vector< Treal > const & | values | |||
| ) | [inline] |
| void mat::Matrix< Treal, Telement >::syAssignDiffFrobNormsLowestLevel | ( | Matrix< Treal, Matrix< Treal, Telement > > const & | A, | |
| Matrix< Treal, Matrix< Treal, Telement > > const & | B | |||
| ) | [inline] |
Same as syAssignFrobNormsLowestLevel except that the Frobenius norms of the differences between submatrices of A and B are assigned.
| void mat::Matrix< Treal, Telement >::syAssignFrobNormsLowestLevel | ( | Matrix< Treal, Matrix< Treal, Telement > > const & | A | ) | [inline] |
Version of assignFrobNormsLowestLevelToMatrix for symmetric matrices.
References mat::MatrixHierarchicBase< Treal, Telement >::ncols(), and mat::MatrixHierarchicBase< Treal, Telement >::nrows().
Referenced by mat::Matrix< Treal >::syAssignDiffFrobNormsLowestLevel().
| void mat::Matrix< Treal, Telement >::syAssignFromSparse | ( | std::vector< int > const & | rowind, | |
| std::vector< int > const & | colind, | |||
| std::vector< Treal > const & | values | |||
| ) | [inline] |
| Treal mat::Matrix< Treal, Telement >::syFrob | ( | ) | const [inline] |
References mat::Matrix< Treal, Telement >::syFrobSquared(), and template_blas_sqrt().
| static Treal mat::Matrix< Treal, Telement >::syFrobDiff | ( | const Matrix< Treal, Telement > & | A, | |
| const Matrix< Treal, Telement > & | B | |||
| ) | [inline, static] |
References mat::Matrix< Treal, Telement >::syFrobSquaredDiff(), and template_blas_sqrt().
| Treal mat::Matrix< Treal, Telement >::syFrobSquared | ( | ) | const [inline] |
References mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::Matrix< Treal, Telement >::frobSquared(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), and mat::MatrixHierarchicBase< Treal, Telement >::nrows().
Referenced by mat::Matrix< Treal >::syFrob(), mat::Matrix< Treal, Telement >::syFrob(), and mat::Matrix< Treal, Telement >::syFrobSquaredDiff().
| Treal mat::Matrix< Treal, Telement >::syFrobSquaredDiff | ( | const Matrix< Treal, Telement > & | A, | |
| const Matrix< Treal, Telement > & | B | |||
| ) | [inline, static] |
| void mat::Matrix< Treal, Telement >::syFullMatrix | ( | std::vector< Treal > & | fullMat | ) | const [inline] |
References mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::SizesAndBlocks::getNTotalScalars(), mat::SizesAndBlocks::getOffset(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nScalarsCols(), mat::MatrixHierarchicBase< Treal, Telement >::rows, and mat::Matrix< Treal, Telement >::syUpTriFullMatrix().
| void mat::Matrix< Treal, Telement >::syGetAllValues | ( | std::vector< int > & | rowind, | |
| std::vector< int > & | colind, | |||
| std::vector< Treal > & | values | |||
| ) | const [inline] |
| void mat::Matrix< Treal, Telement >::syGetValues | ( | std::vector< int > const & | rowind, | |
| std::vector< int > const & | colind, | |||
| std::vector< Treal > & | values | |||
| ) | const [inline] |
| void mat::Matrix< Treal, Telement >::syInch | ( | const Matrix< Treal, Telement > & | A, | |
| Matrix< Treal, Telement > & | Z, | |||
| const Treal | threshold = 0, |
|||
| const side | looking = left, |
|||
| const inchversion | version = unstable | |||
| ) | [inline, static] |
References mat::Matrix< Treal, Telement >::add(), mat::Matrix< Treal, Telement >::allocate(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::Matrix< Treal, Telement >::frob_thresh(), mat::gemm(), mat::left, mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::right, mat::MatrixHierarchicBase< Treal, Telement >::rows, mat::stable, and mat::Matrix< Treal, Telement >::trmm().
| void mat::Matrix< Treal, Telement >::symm | ( | const char | side, | |
| const char | uplo, | |||
| const Treal | alpha, | |||
| const Matrix< Treal, Telement > & | A, | |||
| const Matrix< Treal, Telement > & | B, | |||
| const Treal | beta, | |||
| Matrix< Treal, Telement > & | C | |||
| ) | [inline, static] |
References mat::Matrix< Treal, Telement >::allocate(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::gemm(), MAT_OMP_END, MAT_OMP_FINALIZE, MAT_OMP_INIT, MAT_OMP_START, mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), and mat::MatrixHierarchicBase< Treal, Telement >::rows.
Referenced by mat::Matrix< Treal >::ssmm(), mat::Matrix< Treal, Telement >::ssmm(), mat::Matrix< Treal, Telement >::ssmm_upper_tr_only(), mat::Matrix< Treal, Telement >::sysq(), and mat::Matrix< Treal, Telement >::sytr_upper_tr_only().
| void mat::Matrix< Treal, Telement >::symToNosym | ( | ) | [inline] |
| void mat::Matrix< Treal, Telement >::syRandom | ( | ) | [inline] |
| void mat::Matrix< Treal, Telement >::syRandomZeroStructure | ( | Treal | probabilityBeingZero | ) | [inline] |
| void mat::Matrix< Treal, Telement >::syrk | ( | const char | uplo, | |
| const bool | tA, | |||
| const Treal | alpha, | |||
| const Matrix< Treal, Telement > & | A, | |||
| const Treal | beta, | |||
| Matrix< Treal, Telement > & | C | |||
| ) | [inline, static] |
References mat::Matrix< Treal, Telement >::allocate(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::gemm(), mat::Matrix< Treal, Telement >::gemm(), MAT_OMP_END, MAT_OMP_FINALIZE, MAT_OMP_INIT, MAT_OMP_START, mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::MatrixHierarchicBase< Treal, Telement >::rows, and mat::syrk().
Referenced by mat::Matrix< Treal >::syrk(), and mat::Matrix< Treal >::sysq().
| void mat::Matrix< Treal, Telement >::sySetElementsByRule | ( | TRule & | rule | ) | [inline] |
| void mat::Matrix< Treal, Telement >::sysq | ( | const char | uplo, | |
| const Treal | alpha, | |||
| const Matrix< Treal, Telement > & | A, | |||
| const Treal | beta, | |||
| Matrix< Treal, Telement > & | C | |||
| ) | [inline, static] |
References mat::Matrix< Treal, Telement >::allocate(), mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::gemm(), MAT_OMP_END, MAT_OMP_FINALIZE, MAT_OMP_INIT, MAT_OMP_START, mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::MatrixHierarchicBase< Treal, Telement >::rows, mat::Matrix< Treal, Telement >::symm(), and mat::syrk().
| void mat::Matrix< Treal, Telement >::sytr_upper_tr_only | ( | char const | side, | |
| const Treal | alpha, | |||
| Matrix< Treal, Telement > & | A, | |||
| const Matrix< Treal, Telement > & | Z | |||
| ) | [inline, static] |
References mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::gemm(), mat::Matrix< Treal, Telement >::gemm(), mat::Matrix< Treal, Telement >::gemm_upper_tr_only(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::Matrix< Treal, Telement >::symm(), and mat::Matrix< Treal, Telement >::trmm().
Referenced by mat::Matrix< Treal >::trsytriplemm(), and mat::Matrix< Treal, Telement >::trsytriplemm().
| void mat::Matrix< Treal, Telement >::syUpTriFullMatrix | ( | std::vector< Treal > & | fullMat | ) | const [inline] |
References mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::SizesAndBlocks::getNTotalScalars(), mat::SizesAndBlocks::getOffset(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::MatrixHierarchicBase< Treal, Telement >::nScalarsCols(), mat::MatrixHierarchicBase< Treal, Telement >::nScalarsRows(), and mat::MatrixHierarchicBase< Treal, Telement >::rows.
Referenced by mat::Matrix< Treal, Telement >::syFullMatrix().
| Treal mat::Matrix< Treal, Telement >::trace | ( | ) | const [inline] |
| Treal mat::Matrix< Treal, Telement >::trace_ab | ( | const Matrix< Treal, Telement > & | A, | |
| const Matrix< Treal, Telement > & | B | |||
| ) | [inline, static] |
| Treal mat::Matrix< Treal, Telement >::trace_aTb | ( | const Matrix< Treal, Telement > & | A, | |
| const Matrix< Treal, Telement > & | B | |||
| ) | [inline, static] |
| void mat::Matrix< Treal, Telement >::transpose | ( | Matrix< Treal, Telement > const & | A, | |
| Matrix< Treal, Telement > & | AT | |||
| ) | [inline, static] |
References mat::MatrixHierarchicBase< Treal, Telement >::cols, mat::MatrixHierarchicBase< Treal, Telement >::elements, mat::freeElements(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), mat::MatrixHierarchicBase< Treal, Telement >::rows, and mat::transpose().
Referenced by mat::Matrix< Treal, Telement >::ssmm().
| void mat::Matrix< Treal, Telement >::trmm | ( | const char | side, | |
| const char | uplo, | |||
| const bool | tA, | |||
| const Treal | alpha, | |||
| const Matrix< Treal, Telement > & | A, | |||
| Matrix< Treal, Telement > & | B | |||
| ) | [inline, static] |
References mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::gemm(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), and mat::MatrixHierarchicBase< Treal, Telement >::nrows().
Referenced by mat::Matrix< Treal, Telement >::syInch(), mat::Matrix< Treal >::sytr_upper_tr_only(), mat::Matrix< Treal, Telement >::sytr_upper_tr_only(), mat::Matrix< Treal >::trmm(), mat::Matrix< Treal >::trmm_upper_tr_only(), and mat::Matrix< Treal, Telement >::trmm_upper_tr_only().
| void mat::Matrix< Treal, Telement >::trmm_upper_tr_only | ( | const char | side, | |
| const char | uplo, | |||
| const bool | tA, | |||
| const Treal | alpha, | |||
| const Matrix< Treal, Telement > & | A, | |||
| Matrix< Treal, Telement > & | B | |||
| ) | [inline, static] |
References mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::gemm(), mat::MatrixHierarchicBase< Treal, Telement >::ncols(), mat::MatrixHierarchicBase< Treal, Telement >::nrows(), and mat::Matrix< Treal, Telement >::trmm().
Referenced by mat::Matrix< Treal >::trsytriplemm(), and mat::Matrix< Treal, Telement >::trsytriplemm().
| void mat::Matrix< Treal, Telement >::trSetElementsByRule | ( | TRule & | rule | ) | [inline] |
| void mat::Matrix< Treal, Telement >::trsytriplemm | ( | char const | side, | |
| const Matrix< Treal, Telement > & | Z, | |||
| Matrix< Treal, Telement > & | A | |||
| ) | [inline, static] |
| void mat::Matrix< Treal, Telement >::truncateAccordingToSparsityPattern | ( | Matrix< Treal, Matrix< Treal, Telement > > & | A | ) | const [inline] |
Truncate matrix A according to the sparsity pattern of the this matrix (frobNormMat).
References mat::MatrixHierarchicBase< Treal, Telement >::assert(), mat::Matrix< Treal, Telement >::clear(), and mat::MatrixHierarchicBase< Treal, Telement >::elements.
| void mat::Matrix< Treal, Telement >::writeToFile | ( | std::ofstream & | file | ) | const [inline] |
friend class Vector< Treal, Telement > [friend] |
1.6.1