![]() |
#include <Matrix.h>
Inheritance diagram for dolfin::Matrix:


Public Types | |
| enum | Type { sparse, dense, generic } |
| Matrix type, sparse or dense. More... | |
Public Member Functions | |
| Matrix (Type type=sparse) | |
| Create an empty matrix. | |
| Matrix (unsigned int m, unsigned int n, Type type=sparse) | |
| Create matrix with given dimensions. | |
| Matrix (const Matrix &A) | |
| Create a copy of a given matrix. | |
| virtual | ~Matrix () |
| Destructor. | |
| virtual void | init (unsigned int m, unsigned int n, Type type=sparse) |
| --- Basic operations --- Initialize to a zero matrix with given dimensions | |
| virtual void | clear () |
| Clear all data. | |
| virtual Type | type () const |
| Return matrix type, sparse or dense. | |
| virtual unsigned int | size (unsigned int dim) const |
| Return number of rows (dim = 0) or columns (dim = 1) along dimension dim. | |
| virtual unsigned int | size () const |
| Return number of non-zero elements (only sparse). | |
| virtual unsigned int | rowsize (unsigned int i) const |
| Return number of non-zero elements on row i (only sparse). | |
| virtual unsigned int | bytes () const |
| Return size of matrix in bytes (approximately). | |
| virtual real | operator() (unsigned int i, unsigned int j) const |
| --- Operators --- Index operator | |
| virtual Element | operator() (unsigned int i, unsigned int j) |
| Index operator. | |
| virtual Row | operator() (unsigned int i, Range j) |
| Index operator. | |
| virtual Row | operator() (Index i, Range j) |
| Index operator. | |
| virtual Column | operator() (Range i, unsigned int j) |
| Index operator. | |
| virtual Column | operator() (Range i, Index j) |
| Index operator. | |
| virtual real * | operator[] (unsigned int i) const |
| Index operator (only dense, quick access). | |
| virtual real | operator() (unsigned int i, unsigned int &j, unsigned int pos) const |
| Index operator (only sparse, quick access). | |
| virtual void | operator= (real a) |
| Assignment from scalar (affects only already non-zero elements for sparse). | |
| virtual void | operator= (const Matrix &A) |
| Assignment from a given matrix. | |
| virtual void | operator+= (const Matrix &A) |
| Add a given matrix. | |
| virtual void | operator-= (const Matrix &A) |
| Subtract a given matrix. | |
| virtual void | operator *= (real a) |
| Multiplication with a given scalar. | |
| virtual real | norm () const |
| --- Matrix operations --- Compute maximum norm | |
| virtual real | mult (const Vector &x, unsigned int i) const |
| Matrix-vector multiplication, component i of Ax. | |
| virtual void | mult (const Vector &x, Vector &Ax) const |
| Matrix-vector multiplication. | |
| virtual void | multt (const Vector &x, Vector &Ax) const |
| Matrix-vector multiplication with transpose. | |
| virtual void | mult (const Matrix &B, Matrix &AB) const |
| Matrix-matrix multiplication. | |
| virtual real | multrow (const Vector &x, unsigned int i) const |
| Scalar product with row. | |
| virtual real | multcol (const Vector &x, unsigned int j) const |
| Scalar product with column. | |
| virtual void | transp (Matrix &At) const |
| Compute transpose. | |
| virtual void | solve (Vector &x, const Vector &b) |
| Solve Ax = b (in-place LU for dense and Krylov for sparse). | |
| virtual void | inverse (Matrix &Ainv) |
| Compute inverse (only dense). | |
| virtual void | hpsolve (Vector &x, const Vector &b) const |
| Solve Ax = b with high precision (only dense, not in-place). | |
| virtual void | lu () |
| Compute LU factorization (only dense, in-place). | |
| virtual void | solveLU (Vector &x, const Vector &b) const |
| Solve A x = b using a computed lu factorization (only dense). | |
| virtual void | inverseLU (Matrix &Ainv) const |
| Compute inverse using a computed lu factorization (only dense). | |
| virtual void | hpsolveLU (const Matrix &LU, Vector &x, const Vector &b) const |
| Solve A x = b high precision using computed lu factorization (only dense). | |
| virtual void | resize () |
| --- Special functions --- Clear unused elements (only sparse) | |
| virtual void | ident (unsigned int i) |
| Set A(i,j) = d_{ij} on row i. | |
| virtual void | lump (Vector &a) const |
| Compute lumped matrix and put result in the given vector. | |
| virtual void | addrow () |
| Add a new row. | |
| virtual void | addrow (const Vector &x) |
| Add a new row given by a vector. | |
| virtual void | initrow (unsigned int i, unsigned int rowsize) |
| Specify number of non-zero elements on row i (only sparse). | |
| virtual bool | endrow (unsigned int i, unsigned int pos) const |
| True if we have reached the end of the row (only sparse). | |
| virtual void | settransp (const Matrix &A) |
| Set this matrix to the transpose of the given matrix. | |
| virtual real | rowmax (unsigned int i) const |
| Compute maximum element in given row. | |
| virtual real | colmax (unsigned int i) const |
| Compute maximum element in given row. | |
| virtual real | rowmin (unsigned int i) const |
| Compute minimum element in given row. | |
| virtual real | colmin (unsigned int i) const |
| Compute minimum element in given column. | |
| virtual real | rowsum (unsigned int i) const |
| Compute sum of given row. | |
| virtual real | colsum (unsigned int i) const |
| Compute sum of given row. | |
| virtual real | rownorm (unsigned int i, unsigned int type) const |
| Compute norm of given row: 0 for inf, 1 for l1, and 2 for l2. | |
| virtual real | colnorm (unsigned int i, unsigned int type) const |
| Compute norm of given column: 0 for inf, 1 for l1, and 2 for l2. | |
| virtual void | show () const |
| --- Output --- Display entire matrix | |
Friends | |
| class | DirectSolver |
| class | Element |
| LogStream & | operator<< (LogStream &stream, const Matrix &A) |
| Condensed information in one line. | |
Some of the operations only work on one type of matrix, like the LU factorization which is implemented only for a dense matrix. Such functions are marked by
(only dense) or (only sparse)
Using a sparse function on a dense matrix (or the opposite) will give a warning or an error.
|
|
Matrix type, sparse or dense.
|
|
|
Create an empty matrix.
|
|
||||||||||||||||
|
Create matrix with given dimensions.
|
|
|
Create a copy of a given matrix.
|
|
|
Destructor.
|
|
|
Add a new row given by a vector.
|
|
|
Add a new row.
|
|
|
Return size of matrix in bytes (approximately).
|
|
|
Clear all data.
|
|
|
Compute maximum element in given row.
|
|
|
Compute minimum element in given column.
|
|
||||||||||||
|
Compute norm of given column: 0 for inf, 1 for l1, and 2 for l2.
|
|
|
Compute sum of given row.
|
|
||||||||||||
|
True if we have reached the end of the row (only sparse).
|
|
||||||||||||
|
Solve Ax = b with high precision (only dense, not in-place).
|
|
||||||||||||||||
|
Solve A x = b high precision using computed lu factorization (only dense).
|
|
|
Set A(i,j) = d_{ij} on row i.
|
|
||||||||||||||||
|
--- Basic operations --- Initialize to a zero matrix with given dimensions
|
|
||||||||||||
|
Specify number of non-zero elements on row i (only sparse).
|
|
|
Compute inverse (only dense).
|
|
|
Compute inverse using a computed lu factorization (only dense).
|
|
|
Compute LU factorization (only dense, in-place).
|
|
|
Compute lumped matrix and put result in the given vector.
|
|
||||||||||||
|
Matrix-matrix multiplication.
|
|
||||||||||||
|
Matrix-vector multiplication.
Reimplemented in MyMatrix. |
|
||||||||||||
|
Matrix-vector multiplication, component i of Ax.
|
|
||||||||||||
|
Scalar product with column.
|
|
||||||||||||
|
Scalar product with row.
|
|
||||||||||||
|
Matrix-vector multiplication with transpose.
|
|
|
--- Matrix operations --- Compute maximum norm
|
|
|
Multiplication with a given scalar.
|
|
||||||||||||||||
|
Index operator (only sparse, quick access).
|
|
||||||||||||
|
Index operator.
|
|
||||||||||||
|
Index operator.
|
|
||||||||||||
|
Index operator.
|
|
||||||||||||
|
Index operator.
|
|
||||||||||||
|
Index operator.
|
|
||||||||||||
|
--- Operators --- Index operator
|
|
|
Add a given matrix.
|
|
|
Subtract a given matrix.
|
|
|
Assignment from a given matrix.
|
|
|
Assignment from scalar (affects only already non-zero elements for sparse).
|
|
|
Index operator (only dense, quick access).
|
|
|
--- Special functions --- Clear unused elements (only sparse)
|
|
|
Compute maximum element in given row.
|
|
|
Compute minimum element in given row.
|
|
||||||||||||
|
Compute norm of given row: 0 for inf, 1 for l1, and 2 for l2.
|
|
|
Return number of non-zero elements on row i (only sparse).
|
|
|
Compute sum of given row.
|
|
|
Set this matrix to the transpose of the given matrix.
|
|
|
--- Output --- Display entire matrix
|
|
|
Return number of non-zero elements (only sparse).
|
|
|
Return number of rows (dim = 0) or columns (dim = 1) along dimension dim.
|
|
||||||||||||
|
Solve Ax = b (in-place LU for dense and Krylov for sparse).
|
|
||||||||||||
|
Solve A x = b using a computed lu factorization (only dense).
|
|
|
Compute transpose.
|
|
|
Return matrix type, sparse or dense.
|
|
|
|
|
|
|
|
||||||||||||
|
Condensed information in one line.
|
![]()
Documentation automatically generated with Doxygen on 10 Sep 2004.