Base class for matrix API. More...
#include <MatrixBase.h>
Public Member Functions | |
void | resetSizesAndBlocks (SizesAndBlocks const &newRows, SizesAndBlocks const &newCols) |
void | getRows (SizesAndBlocks &rowsCopy) const |
void | getCols (SizesAndBlocks &colsCopy) const |
bool | is_empty () const |
Check if matrix is empty. | |
Treal | trace () const |
void | add_identity (Treal alpha) |
MatrixBase< Treal, Tmatrix > & | operator*= (Treal const alpha) |
bool | operator== (int k) const |
void | clear () |
Release memory for the information written to file. | |
size_t | memory_usage () const |
void | write_to_buffer_count (int &n_bytes) const |
int | get_nrows () const |
int | get_ncols () const |
Tmatrix const & | getMatrix () const |
Tmatrix & | getMatrix () |
Treal | maxAbsValue () const |
Get largest absolute value of matrix element in the matrix. | |
Protected Member Functions | |
MatrixBase () | |
MatrixBase (const MatrixBase< Treal, Tmatrix > &other) | |
MatrixBase< Treal, Tmatrix > & | operator= (const MatrixBase< Treal, Tmatrix > &other) |
MatrixBase< Treal, Tmatrix > & | operator= (const Xtrans< MatrixGeneral< Treal, Tmatrix > > &mt) |
void | write_to_buffer_base (void *buffer, const int n_bytes, const matrix_type mattype) const |
void | read_from_buffer_base (void *buffer, const int n_bytes, const matrix_type mattype) |
void | writeToFileBase (std::ofstream &file, matrix_type const mattype) const |
void | readFromFileBase (std::ifstream &file, matrix_type const mattype) |
std::string | obj_type_id () const |
void | inMemorySet (bool inMem) |
Make object invalid (false) via this function when object is written to file and valid (true) when object is read from file. | |
Static Protected Member Functions | |
static void | getPermutedIndexes (std::vector< int > const &index, std::vector< int > const &permutation, std::vector< int > &newIndex) |
Protected Attributes | |
ValidPtr< Tmatrix > | matrixPtr |
Friends | |
class | MatrixGeneral< Treal, Tmatrix > |
class | MatrixSymmetric< Treal, Tmatrix > |
class | MatrixTriangular< Treal, Tmatrix > |
Base class for matrix API.
This class provides a base for an API to a matrix library built up from three types which are also the template arguments to this class.
Treal: Type for real numbers
Tmatrix: The matrix class
mat::MatrixBase< Treal, Tmatrix >::MatrixBase | ( | ) | [inline, protected] |
mat::MatrixBase< Treal, Tmatrix >::MatrixBase | ( | const MatrixBase< Treal, Tmatrix > & | other | ) | [inline, protected] |
void mat::MatrixBase< Treal, Tmatrix >::add_identity | ( | Treal | alpha | ) | [inline] |
Referenced by mainFun(), and simple_purification().
void mat::MatrixBase< Treal, Tmatrix >::clear | ( | ) | [inline, virtual] |
Release memory for the information written to file.
Implements mat::FileWritable.
Referenced by add_disturbance_to_matrix(), SCF_unrestricted::clear_error_matrices(), SCF_restricted::clear_error_matrices(), compute_FDSminusSDF_sparse(), compute_h_core_matrix_sparse(), compute_operator_matrix_sparse_symm(), SCF_unrestricted::do_mulliken_pop_stuff(), do_tdhf_dynamics(), get_2e_matrices_and_energy_restricted_open(), get_2e_matrices_and_energy_simple_HF_sparse_unrestricted(), get_2e_matrices_and_energy_simple_sparse_unrestricted(), get_dens_from_fock_general(), get_dens_from_fock_sparse(), SCF_unrestricted::get_new_density_matrix(), getAllEigsInterval(), load_density_and_project_sparse(), and mat::MatrixSymmetric< ergo_real, Matri >::transfer().
int mat::MatrixBase< Treal, Tmatrix >::get_ncols | ( | ) | const [inline] |
int mat::MatrixBase< Treal, Tmatrix >::get_nrows | ( | ) | const [inline] |
Referenced by mat::MatrixSymmetric< ergo_real, Matri >::assignFromFull(), mat::MatrixGeneral< ergo_real, Matri >::assignFromFull(), mat::MatrixSymmetric< Treal, Tmatrix >::diff(), mat::MatrixSymmetric< Treal, Tmatrix >::diffIfSmall(), mat::MatrixTriangular< Treal, Tmatrix >::eucl(), mat::MatrixSymmetric< Treal, Tmatrix >::eucl(), mat::MatrixGeneral< Treal, Tmatrix >::eucl(), mat::MatrixSymmetric< ergo_real, Matri >::fullMatrix(), mat::MatrixGeneral< ergo_real, Matri >::fullMatrix(), mainFun(), and mat::MatrixSymmetric< ergo_real, Matri >::quickEuclBounds().
void mat::MatrixBase< Treal, Tmatrix >::getCols | ( | SizesAndBlocks & | colsCopy | ) | const [inline] |
Tmatrix& mat::MatrixBase< Treal, Tmatrix >::getMatrix | ( | ) | [inline] |
Tmatrix const& mat::MatrixBase< Treal, Tmatrix >::getMatrix | ( | ) | const [inline] |
static void mat::MatrixBase< Treal, Tmatrix >::getPermutedIndexes | ( | std::vector< int > const & | index, | |
std::vector< int > const & | permutation, | |||
std::vector< int > & | newIndex | |||
) | [inline, static, protected] |
void mat::MatrixBase< Treal, Tmatrix >::getRows | ( | SizesAndBlocks & | rowsCopy | ) | const [inline] |
void mat::MatrixBase< Treal, Tmatrix >::inMemorySet | ( | bool | ) | [inline, protected, virtual] |
Make object invalid (false) via this function when object is written to file and valid (true) when object is read from file.
Implements mat::FileWritable.
bool mat::MatrixBase< Treal, Tmatrix >::is_empty | ( | ) | const [inline] |
Check if matrix is empty.
Being empty is not the same as being zero. A matrix being empty means that the data structure has not been set.
Referenced by mat::MatrixBase< ergo_real, Matri >::clear(), SCF_restricted::get_2e_part_and_energy(), mat::MatrixBase< Treal, Tmatrix >::readFromFileBase(), and mat::MatrixBase< Treal, Tmatrix >::writeToFileBase().
Treal mat::MatrixBase< Treal, Tmatrix >::maxAbsValue | ( | ) | const [inline] |
Get largest absolute value of matrix element in the matrix.
Referenced by compute_J_by_boxes_sparse().
size_t mat::MatrixBase< Treal, Tmatrix >::memory_usage | ( | ) | const [inline] |
std::string mat::MatrixBase< Treal, Tmatrix >::obj_type_id | ( | ) | const [inline, protected, virtual] |
MatrixBase<Treal, Tmatrix>& mat::MatrixBase< Treal, Tmatrix >::operator*= | ( | Treal const | alpha | ) | [inline] |
MatrixBase<Treal, Tmatrix>& mat::MatrixBase< Treal, Tmatrix >::operator= | ( | const Xtrans< MatrixGeneral< Treal, Tmatrix > > & | mt | ) | [inline, protected] |
Reimplemented in mat::MatrixGeneral< ergo_real, Matri >.
MatrixBase<Treal, Tmatrix>& mat::MatrixBase< Treal, Tmatrix >::operator= | ( | const MatrixBase< Treal, Tmatrix > & | other | ) | [inline, protected] |
Reimplemented from mat::FileWritable.
Reimplemented in mat::MatrixGeneral< Treal, Tmatrix >, mat::MatrixSymmetric< Treal, Tmatrix >, and mat::MatrixTriangular< Treal, Tmatrix >.
Referenced by mat::MatrixBase< ergo_real, Matri >::operator=().
bool mat::MatrixBase< Treal, Tmatrix >::operator== | ( | int | k | ) | const [inline] |
void mat::MatrixBase< Treal, Tmatrix >::read_from_buffer_base | ( | void * | buffer, | |
const int | n_bytes, | |||
const matrix_type | mattype | |||
) | [inline, protected] |
void mat::MatrixBase< Treal, Tmatrix >::readFromFileBase | ( | std::ifstream & | file, | |
matrix_type const | mattype | |||
) | [inline, protected] |
References mat::MatrixBase< Treal, Tmatrix >::is_empty(), and mat::MatrixBase< Treal, Tmatrix >::matrixPtr.
Referenced by mat::MatrixTriangular< ergo_real, Matri >::readFromFileProt(), mat::MatrixSymmetric< ergo_real, Matri >::readFromFileProt(), and mat::MatrixGeneral< ergo_real, Matri >::readFromFileProt().
void mat::MatrixBase< Treal, Tmatrix >::resetSizesAndBlocks | ( | SizesAndBlocks const & | newRows, | |
SizesAndBlocks const & | newCols | |||
) | [inline] |
Referenced by mat::MatrixTriangular< ergo_real, Matri >::assign_from_sparse(), mat::MatrixSymmetric< ergo_real, Matri >::assign_from_sparse(), mat::MatrixGeneral< ergo_real, Matri >::assign_from_sparse(), calculation_shared(), compute_dipole_moment_onecoord(), compute_h_core_matrix_sparse(), Vxc_worker::ComputeMatrix(), SCF_restricted::disturb_dens_matrix(), SCF_restricted::disturb_dens_matrix_exact(), SCF_restricted::disturb_dens_matrix_exact_try(), SCF_restricted::disturb_fock_matrix(), ComplexMatrix::do_conjugate(), do_tdhf_dynamics(), get_2e_matrices_and_energy_restricted_open(), get_2e_matrices_and_energy_simple_HF_sparse_unrestricted(), get_2e_matrices_and_energy_simple_sparse_unrestricted(), get_2e_matrix_and_energy_simple_HF_sparse(), get_2e_matrix_and_energy_simple_sparse(), SCF_unrestricted::get_2e_part_and_energy(), SCF_restricted::get_2e_part_and_energy(), get_Fock_matrix_in_ort_basis(), SCF_restricted::get_non_ort_err_mat_normalized_in_ort_basis(), get_random_positive_definite_matrix(), SCF_unrestricted::get_S2(), SCF_unrestricted::get_starting_guess_density(), SCF_restricted::get_starting_guess_density(), ComplexMatrix::initialize(), SCF_unrestricted::initialize_matrices(), SCF_restricted::initialize_matrices(), load_density_and_project_sparse(), main(), mainFun(), mat::MatrixSymmetric< Treal, Tmatrix >::mixed_diff(), mat::MatrixSymmetric< Treal, Tmatrix >::mixed_norm(), mat::MatrixSymmetric< Treal, Tmatrix >::mixed_norm_thresh(), ComplexMatrix::product(), ComplexMatrix::rescale_im(), MatAccInvestigator< Treal, Tworker >::Scan(), SCF_general::SCF_general(), test_S_V_comparison(), test_V_by_explicit_comparison(), and test_V_by_explicit_comparison_tight().
Treal mat::MatrixBase< Treal, Tmatrix >::trace | ( | ) | const [inline] |
Referenced by get_dens_from_fock_sparse(), mainFun(), and simple_purification().
void mat::MatrixBase< Treal, Tmatrix >::write_to_buffer_base | ( | void * | buffer, | |
const int | n_bytes, | |||
const matrix_type | mattype | |||
) | const [inline, protected] |
void mat::MatrixBase< Treal, Tmatrix >::write_to_buffer_count | ( | int & | n_bytes | ) | const [inline] |
void mat::MatrixBase< Treal, Tmatrix >::writeToFileBase | ( | std::ofstream & | file, | |
matrix_type const | mattype | |||
) | const [inline, protected] |
References mat::MatrixBase< Treal, Tmatrix >::is_empty(), and mat::MatrixBase< Treal, Tmatrix >::matrixPtr.
Referenced by mat::MatrixTriangular< ergo_real, Matri >::writeToFileProt(), mat::MatrixSymmetric< ergo_real, Matri >::writeToFileProt(), and mat::MatrixGeneral< ergo_real, Matri >::writeToFileProt().
friend class MatrixGeneral< Treal, Tmatrix > [friend] |
friend class MatrixSymmetric< Treal, Tmatrix > [friend] |
friend class MatrixTriangular< Treal, Tmatrix > [friend] |
ValidPtr<Tmatrix> mat::MatrixBase< Treal, Tmatrix >::matrixPtr [protected] |
Referenced by mat::MatrixSymmetric< ergo_real, Matri >::accumulateWith(), mat::MatrixBase< ergo_real, Matri >::add_identity(), mat::MatrixTriangular< ergo_real, Matri >::add_values(), mat::MatrixSymmetric< ergo_real, Matri >::add_values(), mat::MatrixTriangular< ergo_real, Matri >::assign_from_sparse(), mat::MatrixSymmetric< ergo_real, Matri >::assign_from_sparse(), mat::MatrixGeneral< ergo_real, Matri >::assign_from_sparse(), mat::MatrixSymmetric< ergo_real, Matri >::assignFromFull(), mat::MatrixGeneral< ergo_real, Matri >::assignFromFull(), mat::MatrixBase< ergo_real, Matri >::clear(), mat::MatrixTriangular< ergo_real, Matri >::frob(), mat::MatrixSymmetric< ergo_real, Matri >::frob(), mat::MatrixGeneral< ergo_real, Matri >::frob(), mat::MatrixSymmetric< ergo_real, Matri >::frob_diff(), mat::MatrixGeneral< ergo_real, Matri >::frob_diff(), mat::MatrixTriangular< ergo_real, Matri >::frob_thresh(), mat::MatrixSymmetric< ergo_real, Matri >::frob_thresh(), mat::MatrixGeneral< ergo_real, Matri >::frob_thresh(), mat::MatrixSymmetric< ergo_real, Matri >::fullMatrix(), mat::MatrixGeneral< ergo_real, Matri >::fullMatrix(), mat::MatrixSymmetric< ergo_real, Matri >::gersgorin(), mat::MatrixGeneral< ergo_real, Matri >::gersgorin(), mat::MatrixTriangular< ergo_real, Matri >::get_all_values(), mat::MatrixSymmetric< ergo_real, Matri >::get_all_values(), mat::MatrixGeneral< ergo_real, Matri >::get_all_values(), mat::MatrixBase< ergo_real, Matri >::get_ncols(), mat::MatrixBase< ergo_real, Matri >::get_nrows(), mat::MatrixTriangular< ergo_real, Matri >::get_values(), mat::MatrixSymmetric< ergo_real, Matri >::get_values(), mat::MatrixGeneral< ergo_real, Matri >::get_values(), mat::MatrixBase< ergo_real, Matri >::getCols(), mat::MatrixBase< ergo_real, Matri >::getMatrix(), mat::MatrixBase< ergo_real, Matri >::getRows(), mat::MatrixTriangular< ergo_real, Matri >::inch(), mat::MatrixBase< ergo_real, Matri >::inMemorySet(), mat::MatrixBase< ergo_real, Matri >::is_empty(), mat::MatrixBase< ergo_real, Matri >::MatrixBase(), mat::MatrixGeneral< ergo_real, Matri >::MatrixGeneral(), mat::MatrixSymmetric< ergo_real, Matri >::MatrixSymmetric(), mat::MatrixBase< ergo_real, Matri >::maxAbsValue(), mat::MatrixBase< ergo_real, Matri >::memory_usage(), mat::MatrixTriangular< ergo_real, Matri >::nnz(), mat::MatrixSymmetric< ergo_real, Matri >::nnz(), mat::MatrixGeneral< ergo_real, Matri >::nnz(), mat::MatrixTriangular< ergo_real, Matri >::nvalues(), mat::MatrixSymmetric< ergo_real, Matri >::nvalues(), mat::MatrixGeneral< ergo_real, Matri >::nvalues(), mat::MatrixBase< ergo_real, Matri >::operator*=(), mat::MatrixSymmetric< Treal, Tmatrix >::operator+=(), mat::MatrixGeneral< Treal, Tmatrix >::operator+=(), mat::MatrixSymmetric< Treal, Tmatrix >::operator-=(), mat::MatrixGeneral< Treal, Tmatrix >::operator-=(), mat::MatrixTriangular< ergo_real, Matri >::operator=(), mat::MatrixSymmetric< ergo_real, Matri >::operator=(), mat::MatrixGeneral< ergo_real, Matri >::operator=(), mat::MatrixBase< ergo_real, Matri >::operator=(), mat::MatrixBase< ergo_real, Matri >::operator==(), mat::MatrixTriangular< ergo_real, Matri >::random(), mat::MatrixSymmetric< ergo_real, Matri >::random(), mat::MatrixGeneral< ergo_real, Matri >::random(), mat::MatrixSymmetric< ergo_real, Matri >::randomZeroStructure(), mat::MatrixGeneral< ergo_real, Matri >::randomZeroStructure(), mat::MatrixBase< Treal, Tmatrix >::read_from_buffer_base(), mat::MatrixBase< Treal, Tmatrix >::readFromFileBase(), mat::MatrixBase< ergo_real, Matri >::resetSizesAndBlocks(), mat::MatrixTriangular< ergo_real, Matri >::setElementsByRule(), mat::MatrixSymmetric< ergo_real, Matri >::setElementsByRule(), mat::MatrixGeneral< ergo_real, Matri >::setElementsByRule(), mat::MatrixSymmetric< ergo_real, Matri >::simple_blockwise_frob_thresh(), mat::MatrixSymmetric< Treal, Tmatrix >::ssmmUpperTriangleOnly(), mat::MatrixBase< ergo_real, Matri >::trace(), mat::MatrixSymmetric< ergo_real, Matri >::trace_ab(), mat::MatrixGeneral< ergo_real, Matri >::trace_ab(), mat::MatrixGeneral< ergo_real, Matri >::trace_aTb(), mat::MatrixSymmetric< ergo_real, Matri >::transfer(), mat::MatrixBase< Treal, Tmatrix >::write_to_buffer_base(), mat::MatrixBase< ergo_real, Matri >::write_to_buffer_count(), and mat::MatrixBase< Treal, Tmatrix >::writeToFileBase().