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. | |
![]() | |
void | writeToFile () |
Write object to file if filewrite is active. | |
void | readFromFile () |
Read object from file if filewrite is active. | |
void | copyToFile (const char *destFileName) |
void | copyFromFile (const char *sourceFileName) |
bool | isOnFile () |
Check if object is on file. | |
long int | fileSize () |
Return file size. | |
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. | |
![]() | |
virtual void | writeToFileProt (std::ofstream &) const =0 |
Write object to file. | |
virtual void | readFromFileProt (std::ifstream &)=0 |
Read object from file. | |
FileWritable () | |
Gives each object a unique ID-number and filename. | |
virtual | ~FileWritable () |
Removes file, if any. | |
FileWritable (FileWritable const &) | |
FileWritable & | operator= (FileWritable const &) |
Static Protected Member Functions | |
static void | getPermutedIndexes (std::vector< int > const &index, std::vector< int > const &permutation, std::vector< int > &newIndex) |
![]() | |
static std::string | getStatsTime (TypeTimeMap &theMap) |
static std::string | getStatsCount (TypeCountMap &theMap) |
static std::string | getStatsFileSizes (ObjPtrSet const &set) |
Protected Attributes | |
ValidPtr< Tmatrix > | matrixPtr |
Friends | |
class | MatrixGeneral< Treal, Tmatrix > |
class | MatrixSymmetric< Treal, Tmatrix > |
class | MatrixTriangular< Treal, Tmatrix > |
Additional Inherited Members | |
![]() | |
static void | setPath (char const *const newPath) |
Set the path to which the objects will be written. | |
static void | activate () |
Activate the filewriting. | |
static std::string | getStatsFileSizes () |
static std::string | writeAndReadAll () |
static void | resetStats () |
static std::string | getStatsTimeWrite () |
static std::string | getStatsTimeRead () |
static std::string | getStatsTimeCopyAndAssign () |
static std::string | getStatsCountWrite () |
static std::string | getStatsCountRead () |
static std::string | getStatsCountCopyAndAssign () |
![]() | |
typedef std::map< std::string, double > | TypeTimeMap |
typedef std::map< std::string, int > | TypeCountMap |
typedef std::set< FileWritable * > | ObjPtrSet |
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
|
inlineprotected |
References matrixPtr.
Referenced by MatrixBase(), mat::MatrixGeneral< real, matri >::MatrixGeneral(), mat::MatrixGeneral< real, matri >::MatrixGeneral(), mat::MatrixGeneral< real, matri >::MatrixGeneral(), mat::MatrixGeneral< real, matri >::MatrixGeneral(), mat::MatrixSymmetric< real, matri >::MatrixSymmetric(), mat::MatrixSymmetric< real, matri >::MatrixSymmetric(), mat::MatrixSymmetric< real, matri >::MatrixSymmetric(), mat::MatrixSymmetric< real, matri >::MatrixSymmetric(), mat::MatrixTriangular< real, matri >::MatrixTriangular(), mat::MatrixTriangular< real, matri >::MatrixTriangular(), operator*=(), and operator=().
|
inlineprotected |
|
inline |
|
inlinevirtual |
Release memory for the information written to file.
Implements mat::FileWritable.
References is_empty(), and matrixPtr.
Referenced by main(), and mat::MatrixSymmetric< real, matri >::transfer().
|
inline |
|
inline |
References matrixPtr.
Referenced by mat::MatrixSymmetric< real, matri >::assignFromFull(), mat::MatrixGeneral< Treal, Tmatrix >::eucl(), mat::MatrixSymmetric< Treal, Tmatrix >::eucl(), mat::MatrixTriangular< Treal, Tmatrix >::eucl(), mat::MatrixGeneral< real, matri >::fullMatrix(), mat::MatrixSymmetric< real, matri >::fullMatrix(), main(), and mat::MatrixSymmetric< real, matri >::quickEuclBounds().
|
inline |
|
inline |
References matrixPtr.
|
inline |
|
inlinestaticprotected |
|
inline |
References matrixPtr.
Referenced by mat::MatrixSymmetric< Treal, Tmatrix >::getSizesAndBlocksForFrobNormMat().
|
inlineprotectedvirtual |
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.
References matrixPtr.
|
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.
References matrixPtr.
Referenced by clear(), readFromFileBase(), and writeToFileBase().
|
inline |
Get largest absolute value of matrix element in the matrix.
References matrixPtr.
|
inline |
|
inlineprotectedvirtual |
Implements mat::FileWritable.
Reimplemented in mat::MatrixGeneral< Treal, Tmatrix >, mat::MatrixGeneral< ergo_real, Matri >, mat::MatrixGeneral< ergo_real, Matri >, mat::MatrixGeneral< real, matri >, mat::MatrixGeneral< real, matri >, mat::MatrixSymmetric< Treal, Tmatrix >, mat::MatrixSymmetric< ergo_real, Matri >, mat::MatrixSymmetric< ergo_real, Matri >, mat::MatrixSymmetric< real, matri >, mat::MatrixSymmetric< real, matri >, mat::MatrixTriangular< Treal, Tmatrix >, mat::MatrixTriangular< ergo_real, Matri >, mat::MatrixTriangular< ergo_real, Matri >, mat::MatrixTriangular< real, matri >, and mat::MatrixTriangular< real, matri >.
|
inline |
References MatrixBase(), and matrixPtr.
|
inlineprotected |
References mat::ValidPtr< Tobj >::getConstRefForCopying(), mat::ValidPtr< Tobj >::haveDataStructureGet(), mat::ValidPtr< Tobj >::inMemoryGet(), MatrixBase(), matrixPtr, and mat::FileWritable::operator=().
Referenced by mat::MatrixGeneral< real, matri >::operator=(), mat::MatrixGeneral< real, matri >::operator=(), mat::MatrixGeneral< real, matri >::operator=(), mat::MatrixGeneral< real, matri >::operator=(), mat::MatrixSymmetric< real, matri >::operator=(), mat::MatrixSymmetric< real, matri >::operator=(), and mat::MatrixTriangular< real, matri >::operator=().
|
inlineprotected |
References matrixPtr.
|
inline |
References matrixPtr.
|
protected |
|
protected |
|
inline |
References matrixPtr.
Referenced by mat::MatrixGeneral< real, matri >::assign_from_sparse(), mat::MatrixGeneral< real, matri >::assign_from_sparse(), mat::MatrixSymmetric< real, matri >::assign_from_sparse(), mat::MatrixSymmetric< real, matri >::assign_from_sparse(), mat::MatrixTriangular< real, matri >::assign_from_sparse(), SCF_unrestricted::get_2e_part_and_energy(), SCF_unrestricted::get_S2(), main(), mainFun(), mat::MatrixSymmetric< Treal, Tmatrix >::mixed_diff(), mat::MatrixSymmetric< Treal, Tmatrix >::mixed_norm(), mat::MatrixSymmetric< Treal, Tmatrix >::mixed_norm_thresh(), MatAccInvestigator< Treal, Tworker >::Scan(), and SCF_general::SCF_general().
|
inline |
|
protected |
|
inline |
References matrixPtr.
|
protected |
|
friend |
References matrixPtr.
|
friend |
|
friend |
|
protected |
Referenced by mat::MatrixSymmetric< real, matri >::accumulateWith(), add_identity(), mat::MatrixSymmetric< real, matri >::add_values(), mat::MatrixSymmetric< real, matri >::add_values(), mat::MatrixTriangular< real, matri >::add_values(), mat::MatrixGeneral< real, matri >::assign_from_sparse(), mat::MatrixGeneral< real, matri >::assign_from_sparse(), mat::MatrixSymmetric< real, matri >::assign_from_sparse(), mat::MatrixSymmetric< real, matri >::assign_from_sparse(), mat::MatrixSymmetric< real, matri >::assign_from_sparse(), mat::MatrixTriangular< real, matri >::assign_from_sparse(), mat::MatrixGeneral< real, matri >::assignFromFull(), mat::MatrixSymmetric< real, matri >::assignFromFull(), mat::MatrixSymmetric< real, matri >::assignFromFull(), clear(), mat::MatrixGeneral< real, matri >::frob(), mat::MatrixSymmetric< real, matri >::frob(), mat::MatrixTriangular< real, matri >::frob(), mat::MatrixGeneral< real, matri >::frob_thresh(), mat::MatrixSymmetric< real, matri >::frob_thresh(), mat::MatrixTriangular< real, matri >::frob_thresh(), mat::MatrixGeneral< real, matri >::fullMatrix(), mat::MatrixSymmetric< real, matri >::fullMatrix(), mat::MatrixGeneral< real, matri >::gershgorin(), mat::MatrixSymmetric< real, matri >::gershgorin(), mat::MatrixGeneral< real, matri >::get_all_values(), mat::MatrixGeneral< real, matri >::get_all_values(), mat::MatrixSymmetric< real, matri >::get_all_values(), mat::MatrixSymmetric< real, matri >::get_all_values(), mat::MatrixTriangular< real, matri >::get_all_values(), get_ncols(), get_nrows(), mat::MatrixGeneral< real, matri >::get_values(), mat::MatrixGeneral< real, matri >::get_values(), mat::MatrixSymmetric< real, matri >::get_values(), mat::MatrixSymmetric< real, matri >::get_values(), mat::MatrixTriangular< real, matri >::get_values(), getCols(), getMatrix(), getMatrix(), getRows(), mat::MatrixTriangular< real, matri >::inch(), mat::MatrixTriangular< real, matri >::inch(), inMemorySet(), is_empty(), MatrixBase(), MatrixBase(), mat::MatrixGeneral< real, matri >::MatrixGeneral(), MatrixGeneral< Treal, Tmatrix >, mat::MatrixSymmetric< real, matri >::MatrixSymmetric(), maxAbsValue(), memory_usage(), mat::MatrixGeneral< real, matri >::nnz(), mat::MatrixSymmetric< real, matri >::nnz(), mat::MatrixTriangular< real, matri >::nnz(), mat::MatrixGeneral< real, matri >::nvalues(), mat::MatrixSymmetric< real, matri >::nvalues(), mat::MatrixTriangular< real, matri >::nvalues(), operator*=(), operator=(), operator=(), mat::MatrixGeneral< Treal, Tmatrix >::operator=(), mat::MatrixGeneral< Treal, Tmatrix >::operator=(), mat::MatrixGeneral< Treal, Tmatrix >::operator=(), mat::MatrixGeneral< Treal, Tmatrix >::operator=(), mat::MatrixGeneral< real, matri >::operator=(), mat::MatrixGeneral< real, matri >::operator=(), mat::MatrixSymmetric< Treal, Tmatrix >::operator=(), mat::MatrixSymmetric< Treal, Tmatrix >::operator=(), mat::MatrixSymmetric< real, matri >::operator=(), mat::MatrixSymmetric< real, matri >::operator=(), mat::MatrixTriangular< real, matri >::operator=(), operator==(), mat::MatrixGeneral< real, matri >::random(), mat::MatrixSymmetric< real, matri >::random(), mat::MatrixTriangular< real, matri >::random(), mat::MatrixGeneral< real, matri >::randomZeroStructure(), mat::MatrixSymmetric< real, matri >::randomZeroStructure(), readFromFileBase(), resetSizesAndBlocks(), mat::MatrixGeneral< real, matri >::setElementsByRule(), mat::MatrixSymmetric< real, matri >::setElementsByRule(), mat::MatrixTriangular< real, matri >::setElementsByRule(), mat::MatrixSymmetric< real, matri >::simple_blockwise_frob_thresh(), mat::MatrixSymmetric< Treal, Tmatrix >::ssmmUpperTriangleOnly(), trace(), mat::MatrixSymmetric< real, matri >::transfer(), write_to_buffer_base(), write_to_buffer_count(), and writeToFileBase().