48 template<
typename Treal,
typename Tmatrix>
50 template<
typename Treal,
typename Tmatrix>
51 class MatrixSymmetric;
52 template<
typename Treal,
typename Tmatrix>
53 class MatrixTriangular;
54 template<
typename Treal,
typename Tvector>
68 template<
typename Treal,
typename Tmatrix>
113 throw Failure(
"MatrixBase::operator== only implemented for k == 0");
178 if (
mt.A.matrixPtr.haveDataStructureGet()) {
182 Tmatrix::transpose(*
mt.A.matrixPtr, *
this->matrixPtr);
184 *this->matrixPtr = *
mt.A.matrixPtr;
209 for (
unsigned int i = 0; i < index.size(); ++i)
219 template<
typename Treal,
typename Tmatrix>
224 file.write((
char*)&type,
sizeof(
int));
231 matrixPtr->writeToFile(
file);
234 template<
typename Treal,
typename Tmatrix>
238 char type[
sizeof(
int)];
239 file.read(type,
sizeof(
int));
241 throw Failure(
"MatrixBase<Treal, Tmatrix>::"
242 "readFromFile(std::ifstream &, "
243 "matrix_type const): Wrong matrix type");
247 matrixPtr->readFromFile(
file);
252 template<
typename Treal,
typename Tmatrix>
275 throw Failure(
"MatrixBase::write_to_buffer: Buffer is too small");
279 template<
typename Treal,
typename Tmatrix>
295 throw Failure(
"MatrixBase::read_from_buffer: Wrong matrix type");
Abstract class for simple writing and reading of objects to/from file.
Class used to keep track of the block sizes used at different levels in the hierarchical matrix data ...
Smart pointer class to control access to object.
Write and read objects to/from file.
Definition FileWritable.h:56
FileWritable & operator=(FileWritable const &)
Definition FileWritable.cc:478
Base class for matrix API.
Definition MatrixBase.h:69
MatrixBase< Treal, Tmatrix > & operator*=(Treal const alpha)
Definition MatrixBase.h:104
size_t memory_usage() const
Definition MatrixBase.h:126
int get_ncols() const
Definition MatrixBase.h:141
bool is_empty() const
Check if matrix is empty.
Definition MatrixBase.h:93
void getCols(SizesAndBlocks &colsCopy) const
Definition MatrixBase.h:85
bool operator==(int k) const
Definition MatrixBase.h:109
std::string obj_type_id() const
Definition MatrixBase.h:200
Tmatrix const & getMatrix() const
Definition MatrixBase.h:146
static void getPermutedIndexes(std::vector< int > const &index, std::vector< int > const &permutation, std::vector< int > &newIndex)
Definition MatrixBase.h:205
void read_from_buffer_base(void *buffer, const int n_bytes, const matrix_type mattype)
Definition MatrixBase.h:281
int get_nrows() const
Definition MatrixBase.h:138
MatrixBase(const MatrixBase< Treal, Tmatrix > &other)
Definition MatrixBase.h:156
void add_identity(Treal alpha)
Definition MatrixBase.h:101
void writeToFileBase(std::ofstream &file, matrix_type const mattype) const
Definition MatrixBase.h:221
Tmatrix & getMatrix()
Definition MatrixBase.h:147
Treal trace() const
Definition MatrixBase.h:97
void inMemorySet(bool inMem)
Make object invalid (false) via this function when object is written to file and valid (true) when ob...
Definition MatrixBase.h:201
MatrixBase< Treal, Tmatrix > & operator=(const MatrixBase< Treal, Tmatrix > &other)
Definition MatrixBase.h:166
void getRows(SizesAndBlocks &rowsCopy) const
Definition MatrixBase.h:82
Treal maxAbsValue() const
Get largest absolute value of matrix element in the matrix.
Definition MatrixBase.h:150
void resetSizesAndBlocks(SizesAndBlocks const &newRows, SizesAndBlocks const &newCols)
Definition MatrixBase.h:76
void clear()
Release memory for the information written to file.
Definition MatrixBase.h:118
MatrixBase< Treal, Tmatrix > & operator=(const Xtrans< MatrixGeneral< Treal, Tmatrix > > &mt)
Definition MatrixBase.h:177
void write_to_buffer_base(void *buffer, const int n_bytes, const matrix_type mattype) const
Definition MatrixBase.h:254
void write_to_buffer_count(int &n_bytes) const
Definition MatrixBase.h:130
ValidPtr< Tmatrix > matrixPtr
Definition MatrixBase.h:153
void readFromFileBase(std::ifstream &file, matrix_type const mattype)
Definition MatrixBase.h:236
MatrixBase()
Definition MatrixBase.h:155
Normal matrix.
Definition MatrixGeneral.h:59
Symmetric matrix.
Definition MatrixSymmetric.h:68
Upper non-unit triangular matrix.
Definition MatrixTriangular.h:59
Describes dimensions of matrix and its blocks on all levels.
Definition SizesAndBlocks.h:45
Smart pointer class to control access to object.
Definition ValidPtr.h:50
const Tobj & getConstRefForCopying() const
getConstRefForCopying() is provided to make it possible to copy the object also when it is written to...
Definition ValidPtr.h:89
void haveDataStructureSet(bool val)
Definition ValidPtr.h:99
bool haveDataStructureGet() const
Definition ValidPtr.h:102
void inMemorySet(bool val)
Definition ValidPtr.h:93
Proxy structs used by the matrix API.
Definition allocate.cc:39
matrix_type
Definition MatrixBase.h:56
@ matrix_triang
Definition MatrixBase.h:56
@ matrix_matr
Definition MatrixBase.h:56
@ matrix_symm
Definition MatrixBase.h:56
static Treal getMachineEpsilon()
Definition matInclude.h:147
normalMatrix MatrixGeneral
Definition random_matrices.h:74
This proxy expresses the result of transposition of an object of type TX.
Definition matrix_proxy.h:118