102 const real_t val = 1.)
const = 0;
107 const real_t val = 1.)
const = 0;
Abstract data type for sparse matrices.
virtual void Mult(const Vector &x, Vector &y) const =0
Matrix-Vector Multiplication y = A*x.
virtual ~AbstractSparseMatrix()
Destroys AbstractSparseMatrix.
AbstractSparseMatrix(int h, int w)
Creates a matrix of the given height and width.
virtual void AddMultTranspose(const Vector &x, Vector &y, const real_t val=1.) const =0
MatrixTranspose-Vector Multiplication y = y + val*A'*x.
virtual void AddMult(const Vector &x, Vector &y, const real_t val=1.) const =0
Matrix-Vector Multiplication y = y + val*A*x.
virtual int NumNonZeroElems() const =0
Returns the number of non-zeros in a matrix.
virtual void EliminateZeroRows(const real_t threshold=1e-12)=0
If the matrix is square, this method will place 1 on the diagonal (i,i) if row i has "almost" zero l1...
virtual void MultTranspose(const Vector &x, Vector &y) const =0
MatrixTranspose-Vector Multiplication y = A'*x.
virtual int GetRow(const int row, Array< int > &cols, Vector &srow) const =0
Gets the columns indexes and values for row row.
AbstractSparseMatrix(int s=0)
Creates a square matrix of the given size.
Abstract data type for matrix inverse.
MatrixInverse(const Matrix &mat)
Creates approximation of the inverse of square matrix.
Abstract data type matrix.
virtual real_t & Elem(int i, int j)=0
Returns reference to a_{ij}.
virtual const real_t & Elem(int i, int j) const =0
Returns constant reference to a_{ij}.
virtual MatrixInverse * Inverse() const =0
Returns a pointer to (an approximation) of the matrix inverse.
Matrix(int s)
Creates a square matrix of size s.
virtual void Finalize(int)
Finalizes the matrix initialization.
virtual ~Matrix()
Destroys matrix.
virtual void Print(std::ostream &out=mfem::out, int width_=4) const
Prints matrix to stream out.
Matrix(int h, int w)
Creates a matrix of the given height and width.
bool IsSquare() const
Returns whether the matrix is a square matrix.
int width
Dimension of the input / number of columns in the matrix.
int height
Dimension of the output / number of rows in the matrix.
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...