My Project
|
Provides a tridiagonal matrix that also supports non-zero entries in the upper right and lower left. More...
#include <TridiagonalMatrix.hpp>
Public Types | |
typedef Scalar | FieldType |
typedef TridiagRow_ | RowType |
typedef size_t | SizeType |
typedef TridiagRow_ | iterator |
typedef TridiagRow_ | const_iterator |
Public Member Functions | |
TridiagonalMatrix (size_t numRows=0) | |
TridiagonalMatrix (size_t numRows, Scalar value) | |
TridiagonalMatrix (const TridiagonalMatrix &source) | |
Copy constructor. | |
size_t | size () const |
Return the number of rows/columns of the matrix. | |
size_t | rows () const |
Return the number of rows of the matrix. | |
size_t | cols () const |
Return the number of columns of the matrix. | |
void | resize (size_t n) |
Change the number of rows of the matrix. | |
Scalar & | at (size_t rowIdx, size_t colIdx) |
Access an entry. | |
Scalar | at (size_t rowIdx, size_t colIdx) const |
Access an entry. | |
TridiagonalMatrix & | operator= (const TridiagonalMatrix &source) |
Assignment operator from another tridiagonal matrix. | |
TridiagonalMatrix & | operator= (Scalar value) |
Assignment operator from a Scalar. | |
iterator | begin () |
\begin Iterator for the first row | |
const_iterator | begin () const |
\begin Const iterator for the first row | |
const_iterator | end () const |
\begin Const iterator for the next-to-last row | |
TridiagRow_ | operator[] (size_t rowIdx) |
Row access operator. | |
const TridiagRow_ | operator[] (size_t rowIdx) const |
Row access operator. | |
TridiagonalMatrix & | operator*= (Scalar alpha) |
Multiplication with a Scalar. | |
TridiagonalMatrix & | operator/= (Scalar alpha) |
Division by a Scalar. | |
TridiagonalMatrix & | operator-= (const TridiagonalMatrix &other) |
Subtraction operator. | |
TridiagonalMatrix & | operator+= (const TridiagonalMatrix &other) |
Addition operator. | |
TridiagonalMatrix & | axpy (Scalar alpha, const TridiagonalMatrix &other) |
Multiply and add the matrix entries of another tridiagonal matrix. More... | |
template<class Vector > | |
void | mv (const Vector &source, Vector &dest) const |
Matrix-vector product. More... | |
template<class Vector > | |
void | umv (const Vector &source, Vector &dest) const |
Additive matrix-vector product. More... | |
template<class Vector > | |
void | mmv (const Vector &source, Vector &dest) const |
Subtractive matrix-vector product. More... | |
template<class Vector > | |
void | usmv (Scalar alpha, const Vector &source, Vector &dest) const |
Scaled additive matrix-vector product. More... | |
template<class Vector > | |
void | mtv (const Vector &source, Vector &dest) const |
Transposed matrix-vector product. More... | |
template<class Vector > | |
void | umtv (const Vector &source, Vector &dest) const |
Transposed additive matrix-vector product. More... | |
template<class Vector > | |
void | mmtv (const Vector &source, Vector &dest) const |
Transposed subtractive matrix-vector product. More... | |
template<class Vector > | |
void | usmtv (Scalar alpha, const Vector &source, Vector &dest) const |
Transposed scaled additive matrix-vector product. More... | |
Scalar | frobeniusNorm () const |
Calculate the frobenius norm. More... | |
Scalar | frobeniusNormSquared () const |
Calculate the squared frobenius norm. More... | |
Scalar | infinityNorm () const |
Calculate the infinity norm. More... | |
template<class XVector , class BVector > | |
void | solve (XVector &x, const BVector &b) const |
Calculate the solution for a linear system of equations. More... | |
void | print (std::ostream &os=std::cout) const |
Print the matrix to a given output stream. | |
Provides a tridiagonal matrix that also supports non-zero entries in the upper right and lower left.
The entries in the lower left and upper right are supported to make implementing periodic systems easy.
The API of this class is designed to be close to the one used by the DUNE matrix classes.
|
inline |
Multiply and add the matrix entries of another tridiagonal matrix.
This means that
is equivalent to
|
inline |
Calculate the frobenius norm.
i.e., the square root of the sum of all squared entries. This corresponds to the euclidean norm for vectors.
|
inline |
Calculate the squared frobenius norm.
i.e., the sum of all squared entries.
|
inline |
Calculate the infinity norm.
i.e., the maximum of the sum of the absolute values of all rows.
|
inline |
Transposed subtractive matrix-vector product.
This means that
is equivalent to
|
inline |
Subtractive matrix-vector product.
This means that
is equivalent to
|
inline |
Transposed matrix-vector product.
This means that
is equivalent to
|
inline |
Matrix-vector product.
This means that
is equivalent to
|
inline |
Calculate the solution for a linear system of equations.
i.e., calculate x, so that it solves Ax = b, where A is a tridiagonal matrix.
|
inline |
Transposed additive matrix-vector product.
This means that
is equivalent to
|
inline |
Additive matrix-vector product.
This means that
is equivalent to
|
inline |
Transposed scaled additive matrix-vector product.
This means that
is equivalent to
|
inline |
Scaled additive matrix-vector product.
This means that
is equivalent to