5 #ifndef TPZVERYSPARSEMATRIX_H 6 #define TPZVERYSPARSEMATRIX_H 14 #define TPZVERYSPARSEMATRIX_ID 28291001; 61 int PutVal(
const int64_t row,
const int64_t col,
const TVar &
val)
override;
64 virtual const TVar &
GetVal(
const int64_t row,
const int64_t col)
const override;
71 virtual TVar &
s(
const int64_t row,
const int64_t col)
override 74 if(row >= this->
Rows() || row<0 || col >= this->
Cols() || col<0)
76 this->
Error(
"TPZFMatrix::operator() ",
" Index out of bounds");
96 const int opt = 0)
const override;
116 void WriteMap(
TPZStream &buf,
int withclassid,
const std::map<std::pair<int64_t, int64_t>, TVar> & TheMap)
const;
117 void ReadMap(
TPZStream &buf,
void *context, std::map<std::pair<int64_t, int64_t>, TVar> & TheMap);
TPZVerySparseMatrix(int64_t rows, int64_t cols, TVar val)
virtual void Transpose(TPZMatrix< TVar > *const T) const
It makes *T the transpose of current matrix.
void WriteMap(TPZStream &buf, int withclassid, const std::map< std::pair< int64_t, int64_t >, TVar > &TheMap) const
Auxiliary functions only reading and writing a map as the third paremeter.
static int Error(const char *msg, const char *msg2=0)
Returns error messages.
std::map< std::pair< int64_t, int64_t >, TVar > fExtraSparseData
Save elements different from zero, of Sparse matrix.
Implements a non symmetric sparse matrix (Yale Sparse Matrix Storage). Matrix.
REAL val(STATE &number)
Returns value of the variable.
virtual ~TPZVerySparseMatrix()
virtual void Transpose(TPZMatrix< TVar > *const T) const override
It makes *T the transpose of current matrix.
virtual const TVar & GetVal(const int64_t row, const int64_t col) const override
Get values checking bounds.
void Read(TPZStream &buf, void *context) override
Unpacks the object structure from a stream of bytes.
void ReadMap(TPZStream &buf, void *context, std::map< std::pair< int64_t, int64_t >, TVar > &TheMap)
#define DebugStop()
Returns a message to user put a breakpoint in.
Implements a matrix whose nonzero elements are stored in binary tree. Matrix.
int64_t Rows() const
Returns number of rows.
TPZVerySparseMatrix(int64_t rows, int64_t cols)
Full matrix class. Matrix.
int32_t Hash(std::string str)
Contains TPZMatrix<TVar>class, root matrix class.
void Simetrize() override
Simetrizes copies the data of the matrix to make its data simetric.
int PutVal(const int64_t row, const int64_t col, const TVar &val) override
Put values checking bounds.
int64_t Cols() const
Returns number of cols.
Defines the interface for saving and reading data. Persistency.
#define CLONEDEF(A)
To create clone matrix.
virtual void MultAdd(const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha=1, const TVar beta=0, const int opt=0) const override
It computes z = beta * y + alpha * opt(this)*x but z and x can not overlap in memory.
virtual TVar & s(const int64_t row, const int64_t col) override
The operators check on the bounds if the DEBUG variable is defined.
std::map< std::pair< int64_t, int64_t >, TVar >::const_iterator MapEnd() const
TPZVerySparseMatrix(const TPZVerySparseMatrix< TVar > ©)
void Write(TPZStream &buf, int withclassid) const override
Packs the object structure in a stream of bytes.
int ClassId() const override
Saveable methods.
std::map< std::pair< int64_t, int64_t >, TVar >::const_iterator MapBegin() const
int ClassId() const override
Define the class id associated with the class.
virtual void Transpose(TPZVerySparseMatrix< TVar > *T) const
It makes *T the transpose of current matrix.
Root matrix class (abstract). Matrix.