NeoPZ
tpzsparseblockdiagonal.h
Go to the documentation of this file.
1 
5 #ifndef TPZSPARSEBLOCKDIAGONAL_H
6 #define TPZSPARSEBLOCKDIAGONAL_H
7 
8 #include "pzblockdiag.h"
9 
16 template<class TVar>
18 {
19 public:
21  TPZSparseBlockDiagonal(TPZVec<int64_t> &blockgraph, TPZVec<int64_t> &blockgraphindex,int64_t rows);
22 
23  TPZSparseBlockDiagonal(TPZVec<int64_t> &blockgraph, TPZVec<int64_t> &blockgraphindex,int64_t rows, int color, TPZVec<int> &colors);
24 
26 
27  const TVar& Get(const int64_t row, const int64_t col) const override;
28  const TVar& GetVal(const int64_t row, const int64_t col) const override;
29  int Put(const int64_t row, const int64_t col, const TVar& value) override;
30  int PutVal(const int64_t row, const int64_t col, const TVar& value) override;
31  TVar& operator ( )(const int64_t row, const int64_t col);
32  virtual int Substitution(TPZFMatrix<TVar>* B) const override;
33 
34  virtual TVar &s(const int64_t row, const int64_t col) override;
35 
36  virtual void Print(const char* message, std::ostream& out, const MatrixOutputFormat=EFormatted) const override;
37  void AddBlock(int64_t i, TPZFMatrix<TVar>& block);
39  void GetBlock(int64_t i, TPZFMatrix<TVar>& block);
40  void MultAdd(const TPZFMatrix<TVar>& x, const TPZFMatrix<TVar>& y, TPZFMatrix<TVar>& z, const TVar alpha, const TVar beta, const int opt) const override;
41  void FindBlockIndex(int64_t glob, int64_t &block, int64_t &blockind) const;
42 
44  virtual void UpdateFrom(TPZAutoPointer<TPZMatrix<TVar> > mat) override;
45 
46  public:
47 int ClassId() const override;
48 
49 protected:
54 
55  void Scatter(const TPZFMatrix<TVar> &in, TPZFMatrix<TVar> &out) const;
56  void Gather(const TPZFMatrix<TVar> &in, TPZFMatrix<TVar> &out) const;
57 };
58 
59 #endif
const TVar & Get(const int64_t row, const int64_t col) const override
Get value with bound checking.
virtual void UpdateFrom(TPZAutoPointer< TPZMatrix< TVar > > mat) override
Updates the values of the matrix based on the values of the matrix.
MatrixOutputFormat
Defines output format.
Definition: pzmatrix.h:55
Implements a block diagonal matrix where the blocks are not contiguous. Matrix.
int Put(const int64_t row, const int64_t col, const TVar &value) override
Put values with bounds checking if DEBUG variable is defined.
Contains TPZBlockDiagonal class which defines block diagonal matrices.
int PutVal(const int64_t row, const int64_t col, const TVar &value) override
This method don&#39;t make verification if the element exist. It is fast than Put.
TPZSkylMatrix< REAL > matrix
Definition: numatst.cpp:255
void GetBlock(int64_t i, TPZFMatrix< TVar > &block)
void Gather(const TPZFMatrix< TVar > &in, TPZFMatrix< TVar > &out) const
void Scatter(const TPZFMatrix< TVar > &in, TPZFMatrix< TVar > &out) const
int ClassId() const override
Define the class id associated with the class.
TPZVec< int64_t > fBlockIndex
Index to first element of each block.
Full matrix class. Matrix.
Definition: pzfmatrix.h:32
const TVar & GetVal(const int64_t row, const int64_t col) const override
This method don&#39;t make verification if the element exist. It is fast than Get.
Defines block diagonal matrices. Matrix.
Definition: pzblockdiag.h:21
virtual int Substitution(TPZFMatrix< TVar > *B) const override
Makes the backward and forward substitutions whether the matrix was LU decomposed.
void BuildFromMatrix(TPZMatrix< TVar > &matrix)
void FindBlockIndex(int64_t glob, int64_t &block, int64_t &blockind) const
TPZVec< int64_t > fBlock
Equation numbers for each block.
virtual void Print(const char *message, std::ostream &out, const MatrixOutputFormat=EFormatted) const override
Prints current matrix data.
void MultAdd(const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha, const TVar beta, const int opt) const override
Computes z = alpha * opt(this)*x + beta * y.
virtual TVar & s(const int64_t row, const int64_t col) override
The operators check on the bounds if the DEBUG variable is defined.
void AddBlock(int64_t i, TPZFMatrix< TVar > &block)
Root matrix class (abstract). Matrix.
Definition: pzmatrix.h:60
This class implements a reference counter mechanism to administer a dynamically allocated object...