15 #include "../general/array.hpp"
38 virtual double &
Elem(
int i,
int j) = 0;
41 virtual const double &
Elem(
int i,
int j)
const = 0;
50 virtual void Print (std::ostream & out = std::cout,
int width_ = 4)
const;
97 const double val = 1.)
const = 0;
102 const double val = 1.)
const = 0;
virtual void Print(std::ostream &out=std::cout, int width_=4) const
Prints matrix to stream out.
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 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.
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.
AbstractSparseMatrix(int s=0)
Creates a square matrix of the given size.