#include <matrix.h>
Public Member Functions | |
| SimpleMatrix () | |
| Default constructor, zeros everything out. | |
| SimpleMatrix (std::string name) | |
| Constructor, zeros everything out, sets name_. | |
| SimpleMatrix (const SimpleMatrix ©) | |
| Explicit copy reference constructor. | |
| SimpleMatrix (const SimpleMatrix *copy) | |
| Explicit copy pointer constructor. | |
| SimpleMatrix (shared_ptr< SimpleMatrix > copy) | |
| SimpleMatrix (int rows, int cols) | |
| Constructor, sets up the matrix. | |
| SimpleMatrix (std::string name, int rows, int cols) | |
| Constructor, sets name_, and sets up the matrix. | |
| SimpleMatrix (const Matrix ©) | |
| Converts Matrix reference to SimpleMatrix. | |
| SimpleMatrix (const Matrix *copy) | |
| Converts Matrix pointer to SimpleMatrix. | |
| ~SimpleMatrix () | |
| Destructor, frees memory. | |
| void | init (int rowspi, int colspi, std::string name="") |
| Initializes a matrix. | |
| SimpleMatrix * | clone () const |
| Creates an exact copy of the matrix and returns it. | |
| void | copy (SimpleMatrix *cp) |
| Copies cp's data onto this. | |
| void | copy (shared_ptr< SimpleMatrix > cp) |
| void | set (double val) |
| Set every element of this to val. | |
| void | set (const double *tri) |
| Copies lower triangle tri to matrix_. | |
| void | set (int m, int n, double val) |
| Set a single element of matrix_. | |
| void | set (SimpleVector *vec) |
| void | set (shared_ptr< SimpleVector > vec) |
| void | set (double **mat) |
| double | get (int m, int n) |
| Sets the diagonal of matrix_ to vec. | |
| double ** | to_block_matrix () const |
| Returns matrix_. | |
| void | set_name (std::string name) |
| Sets the name of the matrix. | |
| void | print (FILE *out=outfile) |
| Prints the matrix with print_mat. | |
| void | eivprint (SimpleVector *values, FILE *out=outfile) |
| Print the matrix with corresponding eigenvalues below each column. | |
| void | eivprint (shared_ptr< SimpleVector > values, FILE *out=outfile) |
| int | rows () const |
| The number of rows. | |
| int | cols () const |
| The number of columns. | |
| void | set_to_identity () |
| Set matrix to identity. | |
| void | zero () |
| Zero out the matrix. | |
| void | zero_diagonal () |
| Zero out the diagonal. | |
| double | trace () const |
| Returns the trace of this. | |
| SimpleMatrix * | transpose () |
| Create a new SimpleMatrix which is the transpose of this. | |
| void | add (const SimpleMatrix *) |
| Add a matrix to this. | |
| void | add (shared_ptr< SimpleMatrix >) |
| void | subtract (const SimpleMatrix *) |
| Subtracts a matrix from this. | |
| void | subtract (shared_ptr< SimpleMatrix >) |
| void | accumulate_product (const SimpleMatrix *, const SimpleMatrix *) |
| Multiples the two arguments and adds their result to this. | |
| void | accumulate_product (shared_ptr< SimpleMatrix >, shared_ptr< SimpleMatrix >) |
| void | scale (double) |
| Scales this matrix. | |
| double | sum_of_squares () |
| Returns the sum of the squares of this. | |
| void | add (int m, int n, double val) |
| Add val to an element of this. | |
| void | scale_row (int m, double a) |
| Scale row m by a. | |
| void | scale_column (int n, double a) |
| Scale column n by a. | |
| void | transform (SimpleMatrix *a, SimpleMatrix *transformer) |
| Transform a by transformer save result to this. | |
| void | transform (shared_ptr< SimpleMatrix > a, shared_ptr< SimpleMatrix > transformer) |
| void | transform (SimpleMatrix *transformer) |
| Transform this by transformer. | |
| void | transform (shared_ptr< SimpleMatrix > transformer) |
| void | back_transform (SimpleMatrix *a, SimpleMatrix *transformer) |
| Back transform a by transformer save result to this. | |
| void | back_transform (shared_ptr< SimpleMatrix > a, shared_ptr< SimpleMatrix > transformer) |
| void | back_transform (SimpleMatrix *transformer) |
| Back transform this by transformer. | |
| void | back_transform (shared_ptr< SimpleMatrix > transformer) |
| double | vector_dot (SimpleMatrix *rhs) |
| Return the vector dot product of rhs by this. | |
| double | vector_dot (shared_ptr< SimpleMatrix > rhs) |
| void | gemm (bool transa, bool transb, double alpha, const SimpleMatrix *a, const SimpleMatrix *b, double beta) |
| General matrix multiply, saves result to this. | |
| void | gemm (bool transa, bool transb, double alpha, shared_ptr< SimpleMatrix > a, shared_ptr< SimpleMatrix > b, double beta) |
| void | diagonalize (SimpleMatrix *eigvectors, SimpleVector *eigvalues) |
| Diagonalize this, eigvector and eigvalues must be created by caller. | |
| void | diagonalize (shared_ptr< SimpleMatrix > eigvectors, shared_ptr< SimpleVector > eigvalues) |
| void | save (psi::PSIO *psio, unsigned int fileno) |
| Saves the block matrix to PSIO object with fileno and with the toc position of the name of the matrix. | |
| void | save (psi::PSIO &psio, unsigned int fileno) |
| void | save (shared_ptr< psi::PSIO > psio, unsigned int fileno) |
| void | save (const char *filename, bool append=true, bool saveLowerTriangle=true) |
| Saves the matrix in ASCII format to filename. | |
| void | save (std::string filename, bool append=true, bool saveLowerTriangle=true) |
| Saves the matrix in ASCII format to filename. | |
Protected Member Functions | |
| void | alloc () |
| Allocates matrix_. | |
| void | release () |
| Releases matrix_. | |
| void | copy_from (double **) |
| Copies data from the passed matrix to this matrix_. | |
Static Protected Member Functions | |
| static double ** | matrix (int nrow, int ncol) |
| allocate a block matrix -- analogous to libciomr's block_matrix | |
| static void | free (double **Block) |
| free a (block) matrix -- analogous to libciomr's free_block | |
Protected Attributes | |
| double ** | matrix_ |
| Matrix data. | |
| int | rows_ |
| Number of rows and columns. | |
| int | cols_ |
| std::string | name_ |
| Nae of the matrix. | |
Friends | |
| class | Matrix |
1.5.6