Upper non-unit triangular matrix. More...
#include <MatrixTriangular.h>
Public Types | |
typedef VectorGeneral< Treal, typename Tmatrix::VectorType > | VectorType |
Public Member Functions | |
MatrixTriangular () | |
Default constructor. | |
MatrixTriangular (const MatrixTriangular< Treal, Tmatrix > &tri) | |
Copy constructor. | |
MatrixTriangular< Treal, Tmatrix > & | operator= (const MatrixTriangular< Treal, Tmatrix > &tri) |
MatrixTriangular< Treal, Tmatrix > & | operator= (int const k) |
Set matrix to zero or identity: A = 0 or A = 1. | |
void | assign_from_sparse (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > const &values, SizesAndBlocks const &newRows, SizesAndBlocks const &newCols) |
Assign from sparse matrix given by three vectors. | |
void | add_values (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > const &values) |
Add given set of values to the matrix (+=). | |
void | get_values (std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > &values) const |
Get values given by row and column index lists. | |
void | get_all_values (std::vector< int > &rowind, std::vector< int > &colind, std::vector< Treal > &values) const |
Get all values and corresponding row and column index lists, in matrix. | |
void | inch (const MatrixGeneral< Treal, Tmatrix > &SPD, const Treal threshold, const side looking=left, const inchversion version=unstable) |
void | inch (const MatrixSymmetric< Treal, Tmatrix > &SPD, const Treal threshold, const side looking=left, const inchversion version=unstable) |
void | thresh (Treal const threshold, normType const norm) |
Treal | frob () const |
Treal | eucl (Treal const requestedAccuracy, int maxIter=-1) const |
Treal | eucl_thresh (Treal const threshold) |
Treal | eucl_thresh_congr_trans_measure (Treal const threshold, MatrixSymmetric< Treal, Tmatrix > &trA) |
void | frob_thresh (Treal threshold) |
size_t | nnz () const |
size_t | nvalues () const |
void | write_to_buffer (void *buffer, const int n_bytes) const |
void | read_from_buffer (void *buffer, const int n_bytes) |
void | random () |
template<typename TRule > | |
void | setElementsByRule (TRule &rule) |
Uses rule depending on the row and column indexes to set matrix elements The Trule class should have the function "Treal = set(int row,int col)" which is used to set the elements. | |
MatrixTriangular< Treal, Tmatrix > & | operator+= (XY< Treal, MatrixTriangular< Treal, Tmatrix > > const &sm) |
B += alpha * A. | |
std::string | obj_type_id () const |
Protected Member Functions | |
void | writeToFileProt (std::ofstream &file) const |
Write object to file. | |
void | readFromFileProt (std::ifstream &file) |
Read object from file. |
Upper non-unit triangular matrix.
This class belongs to the matrix API
Treal: Type for real numbers
Tmatrix: The matrix class
typedef VectorGeneral<Treal, typename Tmatrix::VectorType> mat::MatrixTriangular< Treal, Tmatrix >::VectorType |
mat::MatrixTriangular< Treal, Tmatrix >::MatrixTriangular | ( | ) | [inline] |
Default constructor.
mat::MatrixTriangular< Treal, Tmatrix >::MatrixTriangular | ( | const MatrixTriangular< Treal, Tmatrix > & | tri | ) | [inline, explicit] |
Copy constructor.
void mat::MatrixTriangular< Treal, Tmatrix >::add_values | ( | std::vector< int > const & | rowind, | |
std::vector< int > const & | colind, | |||
std::vector< Treal > const & | values | |||
) | [inline] |
Add given set of values to the matrix (+=).
The values should be in upper triangle.
void mat::MatrixTriangular< Treal, Tmatrix >::assign_from_sparse | ( | std::vector< int > const & | rowind, | |
std::vector< int > const & | colind, | |||
std::vector< Treal > const & | values, | |||
SizesAndBlocks const & | newRows, | |||
SizesAndBlocks const & | newCols | |||
) | [inline] |
Assign from sparse matrix given by three vectors.
The vectors contain row indices, column indices and values. The indices start at zero. The elements to be added must be in upper triangle. Information about sizes and blocks for rows as well as columns must also be given.
Referenced by mainFun().
Treal mat::MatrixTriangular< Treal, Tmatrix >::eucl | ( | Treal const | requestedAccuracy, | |
int | maxIter = -1 | |||
) | const [inline] |
References mat::MatrixBase< Treal, Tmatrix >::get_nrows(), mat::MatrixBase< Treal, Tmatrix >::getCols(), mat::arn::LanczosLargestMagnitudeEig< Treal, Tmatrix, Tvector >::getLargestMagnitudeEig(), mat::Interval< Treal >::length(), mat::Interval< Treal >::low(), mat::Interval< Treal >::midPoint(), mat::VectorGeneral< Treal, Tvector >::rand(), mat::VectorGeneral< Treal, Tvector >::resetSizesAndBlocks(), and template_blas_sqrt().
Referenced by mainFun(), and SCF_general::SCF_general().
Treal mat::MatrixTriangular< Treal, Tmatrix >::eucl_thresh | ( | Treal const | threshold | ) | [inline] |
References mat::EuclTruncationBase< Tmatrix, Treal >::run().
Referenced by mainFun(), and SCF_general::SCF_general().
Treal mat::MatrixTriangular< Treal, Tmatrix >::eucl_thresh_congr_trans_measure | ( | Treal const | threshold, | |
MatrixSymmetric< Treal, Tmatrix > & | trA | |||
) | [inline] |
References mat::EuclTruncationBase< Tmatrix, Treal >::run().
Treal mat::MatrixTriangular< Treal, Tmatrix >::frob | ( | ) | const [inline] |
Referenced by mainFun(), and SCF_general::SCF_general().
void mat::MatrixTriangular< Treal, Tmatrix >::frob_thresh | ( | Treal | threshold | ) | [inline] |
Referenced by mat::MatrixTriangular< Treal, Tmatrix >::thresh().
void mat::MatrixTriangular< Treal, Tmatrix >::get_all_values | ( | std::vector< int > & | rowind, | |
std::vector< int > & | colind, | |||
std::vector< Treal > & | values | |||
) | const [inline] |
Get all values and corresponding row and column index lists, in matrix.
Only upper triangle values are returned.
Referenced by mainFun().
void mat::MatrixTriangular< Treal, Tmatrix >::get_values | ( | std::vector< int > const & | rowind, | |
std::vector< int > const & | colind, | |||
std::vector< Treal > & | values | |||
) | const [inline] |
Get values given by row and column index lists.
Input arrays contain row and column indices. The wanted elements must in upper triangle. The output array contains values for the given indices.
Referenced by mainFun().
void mat::MatrixTriangular< Treal, Tmatrix >::inch | ( | const MatrixSymmetric< Treal, Tmatrix > & | SPD, | |
const Treal | threshold, | |||
const side | looking = left , |
|||
const inchversion | version = unstable | |||
) | [inline] |
void mat::MatrixTriangular< Treal, Tmatrix >::inch | ( | const MatrixGeneral< Treal, Tmatrix > & | SPD, | |
const Treal | threshold, | |||
const side | looking = left , |
|||
const inchversion | version = unstable | |||
) | [inline] |
Referenced by mat::MatrixTriangular< ergo_real, Matri >::inch(), main(), mainFun(), and SCF_general::SCF_general().
size_t mat::MatrixTriangular< Treal, Tmatrix >::nnz | ( | ) | const [inline] |
Referenced by SCF_general::SCF_general().
size_t mat::MatrixTriangular< Treal, Tmatrix >::nvalues | ( | ) | const [inline] |
std::string mat::MatrixTriangular< Treal, Tmatrix >::obj_type_id | ( | ) | const [inline, virtual] |
Reimplemented from mat::MatrixBase< Treal, Tmatrix >.
MatrixTriangular< Treal, Tmatrix > & mat::MatrixTriangular< Treal, Tmatrix >::operator+= | ( | XY< Treal, MatrixTriangular< Treal, Tmatrix > > const & | sm | ) | [inline] |
B += alpha * A.
MatrixTriangular<Treal, Tmatrix>& mat::MatrixTriangular< Treal, Tmatrix >::operator= | ( | int const | k | ) | [inline] |
Set matrix to zero or identity: A = 0 or A = 1.
Only zero and one are valid arguments.
MatrixTriangular<Treal, Tmatrix>& mat::MatrixTriangular< Treal, Tmatrix >::operator= | ( | const MatrixTriangular< Treal, Tmatrix > & | tri | ) | [inline] |
Reimplemented from mat::MatrixBase< Treal, Tmatrix >.
Referenced by mat::MatrixTriangular< ergo_real, Matri >::operator=().
void mat::MatrixTriangular< Treal, Tmatrix >::random | ( | ) | [inline] |
Referenced by mainFun().
void mat::MatrixTriangular< Treal, Tmatrix >::read_from_buffer | ( | void * | buffer, | |
const int | n_bytes | |||
) | [inline] |
void mat::MatrixTriangular< Treal, Tmatrix >::readFromFileProt | ( | std::ifstream & | ) | [inline, protected, virtual] |
void mat::MatrixTriangular< Treal, Tmatrix >::setElementsByRule | ( | TRule & | rule | ) | [inline] |
Uses rule depending on the row and column indexes to set matrix elements The Trule class should have the function "Treal = set(int row,int col)" which is used to set the elements.
Referenced by mainFun().
void mat::MatrixTriangular< Treal, Tmatrix >::thresh | ( | Treal const | threshold, | |
normType const | norm | |||
) | [inline] |
References mat::MatrixTriangular< Treal, Tmatrix >::frob_thresh(), and mat::frobNorm.
void mat::MatrixTriangular< Treal, Tmatrix >::write_to_buffer | ( | void * | buffer, | |
const int | n_bytes | |||
) | const [inline] |
void mat::MatrixTriangular< Treal, Tmatrix >::writeToFileProt | ( | std::ofstream & | ) | const [inline, protected, virtual] |