15 #include "../general/array.hpp"
16 #include "../general/globals.hpp"
38 virtual double &
Elem(
int i,
int j) = 0;
41 virtual const double &
Elem(
int i,
int j)
const = 0;
97 const double val = 1.)
const = 0;
102 const double val = 1.)
const = 0;
virtual void Finalize(int)
Finalizes the matrix initialization.
virtual MatrixInverse * Inverse() const =0
Returns a pointer to (an approximation) of the matrix inverse.
virtual ~AbstractSparseMatrix()
Destroys AbstractSparseMatrix.
Abstract data type for sparse matrices.
virtual void AddMult(const Vector &x, Vector &y, const double val=1.) const =0
Matrix-Vector Multiplication y = y + val*A*x.
Abstract data type for matrix inverse.
virtual void Print(std::ostream &out=mfem::out, int width_=4) const
Prints matrix to stream out.
virtual int NumNonZeroElems() const =0
Returns the number of non-zeros in a matrix.
AbstractSparseMatrix(int h, int w)
Creates a matrix of the given height and width.
virtual void MultTranspose(const Vector &x, Vector &y) const =0
MatrixTranspose-Vector Multiplication y = A'*x.
Matrix(int h, int w)
Creates a matrix of the given height and width.
virtual ~Matrix()
Destroys matrix.
Abstract data type matrix.
virtual void EliminateZeroRows()=0
virtual double & Elem(int i, int j)=0
Returns reference to a_{ij}.
virtual int GetRow(const int row, Array< int > &cols, Vector &srow) const =0
virtual void Mult(const Vector &x, Vector &y) const =0
Matrix-Vector Multiplication y = A*x.
MatrixInverse(const Matrix &mat)
Creates approximation of the inverse of square matrix.
int height
Dimension of the output / number of rows in the matrix.
Matrix(int s)
Creates a square matrix of size s.
virtual void AddMultTranspose(const Vector &x, Vector &y, const double val=1.) const =0
MatrixTranspose-Vector Multiplication y = y + val*A'*x.
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
AbstractSparseMatrix(int s=0)
Creates a square matrix of the given size.
int width
Dimension of the input / number of columns in the matrix.