ergo
|
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::MatrixBase | ( | ) | [inline, protected] |
mat::MatrixBase::MatrixBase | ( | const MatrixBase< Treal, Tmatrix > & | other | ) | [inline, protected] |
void mat::MatrixBase::add_identity | ( | Treal | alpha | ) | [inline] |
Referenced by simple_purification(), and mainFun().
void mat::MatrixBase::clear | ( | ) | [inline, virtual] |
Release memory for the information written to file.
Implements mat::FileWritable.
Referenced by get_dens_from_fock_general(), getAllEigsInterval(), get_dens_from_fock_sparse(), SCF_restricted::get_2e_part_and_energy(), SCF_restricted::clear_error_matrices(), SCF_unrestricted::clear_error_matrices(), SCF_unrestricted::get_new_density_matrix(), SCF_unrestricted::do_mulliken_pop_stuff(), compute_h_core_matrix_sparse(), add_disturbance_to_matrix(), get_2e_matrices_and_energy_simple_HF_sparse_unrestricted(), get_2e_matrices_and_energy_simple_sparse_unrestricted(), get_2e_matrices_and_energy_restricted_open(), compute_FDSminusSDF_sparse(), do_tdhf_dynamics(), load_density_and_project_sparse(), and compute_operator_matrix_sparse_symm().
int mat::MatrixBase::get_ncols | ( | ) | const [inline] |
int mat::MatrixBase::get_nrows | ( | ) | const [inline] |
Referenced by mainFun().
void mat::MatrixBase::getCols | ( | SizesAndBlocks & | colsCopy | ) | const [inline] |
Tmatrix const& mat::MatrixBase::getMatrix | ( | ) | const [inline] |
Tmatrix& mat::MatrixBase::getMatrix | ( | ) | [inline] |
static void mat::MatrixBase::getPermutedIndexes | ( | std::vector< int > const & | index, |
std::vector< int > const & | permutation, | ||
std::vector< int > & | newIndex | ||
) | [inline, static, protected] |
void mat::MatrixBase::getRows | ( | SizesAndBlocks & | rowsCopy | ) | const [inline] |
void mat::MatrixBase::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::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< Treal, Tmatrix >::clear(), and SCF_restricted::get_2e_part_and_energy().
Treal mat::MatrixBase::maxAbsValue | ( | ) | const [inline] |
Get largest absolute value of matrix element in the matrix.
Referenced by compute_J_by_boxes_sparse().
std::string mat::MatrixBase::obj_type_id | ( | ) | const [inline, protected, virtual] |
Implements mat::FileWritable.
Reimplemented in mat::MatrixSymmetric, mat::MatrixGeneral, and mat::MatrixTriangular.
MatrixBase<Treal, Tmatrix>& mat::MatrixBase::operator*= | ( | Treal const | alpha | ) | [inline] |
MatrixBase<Treal, Tmatrix>& mat::MatrixBase::operator= | ( | const MatrixBase< Treal, Tmatrix > & | other | ) | [inline, protected] |
Referenced by mat::MatrixBase< Treal, Tmatrix >::operator=().
MatrixBase<Treal, Tmatrix>& mat::MatrixBase::operator= | ( | const Xtrans< MatrixGeneral< Treal, Tmatrix > > & | mt | ) | [inline, protected] |
Reimplemented in mat::MatrixGeneral.
bool mat::MatrixBase::operator== | ( | int | k | ) | const [inline] |
void mat::MatrixBase::read_from_buffer_base | ( | void * | buffer, |
const int | n_bytes, | ||
const matrix_type | mattype | ||
) | [protected] |
void mat::MatrixBase::readFromFileBase | ( | std::ifstream & | file, |
matrix_type const | mattype | ||
) | [protected] |
void mat::MatrixBase::resetSizesAndBlocks | ( | SizesAndBlocks const & | newRows, |
SizesAndBlocks const & | newCols | ||
) | [inline] |
Referenced by getAllEigsInterval(), mainFun(), SCF_general::SCF_general(), SCF_restricted::initialize_matrices(), SCF_restricted::get_starting_guess_density(), SCF_restricted::get_2e_part_and_energy(), SCF_restricted::get_non_ort_err_mat_normalized_in_ort_basis(), SCF_restricted::disturb_dens_matrix(), SCF_restricted::disturb_dens_matrix_exact_try(), SCF_restricted::disturb_dens_matrix_exact(), SCF_restricted::disturb_fock_matrix(), SCF_unrestricted::initialize_matrices(), SCF_unrestricted::get_starting_guess_density(), SCF_unrestricted::get_2e_part_and_energy(), SCF_unrestricted::get_S2(), Vxc_worker::ComputeMatrix(), compute_h_core_matrix_sparse(), get_2e_matrix_and_energy_simple_HF_sparse(), get_2e_matrices_and_energy_simple_HF_sparse_unrestricted(), get_2e_matrix_and_energy_simple_sparse(), get_2e_matrices_and_energy_simple_sparse_unrestricted(), get_2e_matrices_and_energy_restricted_open(), compute_dipole_moment_onecoord(), get_Fock_matrix_in_ort_basis(), ComplexMatrix::initialize(), ComplexMatrix::product(), ComplexMatrix::rescale_im(), ComplexMatrix::do_conjugate(), do_tdhf_dynamics(), main(), get_random_positive_definite_matrix(), test_S_V_comparison(), test_V_by_explicit_comparison(), test_V_by_explicit_comparison_tight(), calculation_shared(), load_density_and_project_sparse(), and MatAccInvestigator::Scan().
Treal mat::MatrixBase::trace | ( | ) | const [inline] |
Referenced by get_dens_from_fock_sparse(), simple_purification(), and mainFun().
void mat::MatrixBase::write_to_buffer_base | ( | void * | buffer, |
const int | n_bytes, | ||
const matrix_type | mattype | ||
) | const [protected] |
References write_to_buffer_count().
void mat::MatrixBase::write_to_buffer_count | ( | int & | n_bytes | ) | const [inline] |
Referenced by write_to_buffer_base().
void mat::MatrixBase::writeToFileBase | ( | std::ofstream & | file, |
matrix_type const | mattype | ||
) | const [protected] |
friend class MatrixGeneral< Treal, Tmatrix > [friend] |
friend class MatrixSymmetric< Treal, Tmatrix > [friend] |
friend class MatrixTriangular< Treal, Tmatrix > [friend] |
ValidPtr<Tmatrix> mat::MatrixBase::matrixPtr [protected] |
Referenced by mat::MatrixBase< Treal, Tmatrix >::resetSizesAndBlocks(), mat::MatrixBase< Treal, Tmatrix >::getRows(), mat::MatrixBase< Treal, Tmatrix >::getCols(), mat::MatrixBase< Treal, Tmatrix >::is_empty(), mat::MatrixBase< Treal, Tmatrix >::trace(), mat::MatrixBase< Treal, Tmatrix >::add_identity(), mat::MatrixBase< Treal, Tmatrix >::operator*=(), mat::MatrixBase< Treal, Tmatrix >::operator==(), mat::MatrixBase< Treal, Tmatrix >::clear(), mat::MatrixBase< Treal, Tmatrix >::memory_usage(), mat::MatrixBase< Treal, Tmatrix >::write_to_buffer_count(), mat::MatrixBase< Treal, Tmatrix >::get_nrows(), mat::MatrixBase< Treal, Tmatrix >::get_ncols(), mat::MatrixBase< Treal, Tmatrix >::getMatrix(), mat::MatrixBase< Treal, Tmatrix >::maxAbsValue(), mat::MatrixBase< Treal, Tmatrix >::MatrixBase(), mat::MatrixBase< Treal, Tmatrix >::operator=(), mat::MatrixBase< Treal, Tmatrix >::inMemorySet(), and mat::MatrixTriangular< ergo_real, Matri >::inch().