15 #include "../general/array.hpp"
16 #include "../general/globals.hpp"
17 #include "operator.hpp"
42 virtual double &
Elem(
int i,
int j) = 0;
45 virtual const double &
Elem(
int i,
int j)
const = 0;
102 const double val = 1.)
const = 0;
107 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.
bool IsSquare() const
Returns whether the matrix is a square matrix.
Matrix(int h, int w)
Creates a matrix of the given height and width.
virtual ~Matrix()
Destroys matrix.
Abstract data type matrix.
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
Gets the columns indexes and values for row row.
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.
virtual void EliminateZeroRows(const double 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...
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.