A dense n x m matrix. More...
#include <dune/common/fmatrix.hh>
Public Types | |
enum | { blocklevel = 1 } |
We are at the leaf of the block recursion. More... | |
enum | { rows = ROWS, cols = COLS } |
export size More... | |
typedef K | field_type |
export the type representing the field | |
typedef K | block_type |
export the type representing the components | |
typedef std::size_t | size_type |
The type used for the index access and size operations. | |
typedef FieldVector< K, cols > | row_type |
Each row is implemented by a field vector. | |
typedef FieldIterator < FieldMatrix< K, rows, cols > , row_type > | Iterator |
Iterator class for sequential access. | |
typedef Iterator | iterator |
typedef for stl compliant access | |
typedef Iterator | RowIterator |
rename the iterators for easier access | |
typedef row_type::Iterator | ColIterator |
rename the iterators for easier access | |
typedef FieldIterator< const FieldMatrix< K, rows, cols > , const row_type > | ConstIterator |
Iterator class for sequential access. | |
typedef ConstIterator | const_iterator |
typedef for stl compliant access | |
typedef ConstIterator | ConstRowIterator |
rename the iterators for easier access | |
typedef row_type::ConstIterator | ConstColIterator |
rename the iterators for easier access | |
Public Member Functions | |
FieldMatrix () | |
Default constructor. | |
FieldMatrix (const K &k) | |
Constructor initializing the whole matrix with a scalar. | |
template<typename T > | |
FieldMatrix (const T &t) | |
row_type & | operator[] (size_type i) |
random access to the rows | |
const row_type & | operator[] (size_type i) const |
same for read only access | |
Iterator | begin () |
begin iterator | |
Iterator | end () |
end iterator | |
Iterator | rbegin () |
begin iterator | |
Iterator | rend () |
end iterator | |
ConstIterator | begin () const |
begin iterator | |
ConstIterator | end () const |
end iterator | |
ConstIterator | rbegin () const |
begin iterator | |
ConstIterator | rend () const |
end iterator | |
FieldMatrix & | operator= (const K &k) |
template<typename T > | |
FieldMatrix & | operator= (const T &t) |
FieldMatrix & | operator+= (const FieldMatrix &y) |
vector space addition | |
FieldMatrix & | operator-= (const FieldMatrix &y) |
vector space subtraction | |
FieldMatrix & | operator*= (const K &k) |
vector space multiplication with scalar | |
FieldMatrix & | operator/= (const K &k) |
vector space division by scalar | |
FieldMatrix & | axpy (const K &k, const FieldMatrix &y) |
vector space axpy operation (*this += k y) | |
template<class X , class Y > | |
void | mv (const X &x, Y &y) const |
y = A x | |
template<class X , class Y > | |
void | mtv (const X &x, Y &y) const |
y = A^T x | |
template<class X , class Y > | |
void | umv (const X &x, Y &y) const |
y += A x | |
template<class X , class Y > | |
void | umtv (const X &x, Y &y) const |
y += A^T x | |
template<class X , class Y > | |
void | umhv (const X &x, Y &y) const |
y += A^H x | |
template<class X , class Y > | |
void | mmv (const X &x, Y &y) const |
y -= A x | |
template<class X , class Y > | |
void | mmtv (const X &x, Y &y) const |
y -= A^T x | |
template<class X , class Y > | |
void | mmhv (const X &x, Y &y) const |
y -= A^H x | |
template<class X , class Y > | |
void | usmv (const K &alpha, const X &x, Y &y) const |
y += alpha A x | |
template<class X , class Y > | |
void | usmtv (const K &alpha, const X &x, Y &y) const |
y += alpha A^T x | |
template<class X , class Y > | |
void | usmhv (const K &alpha, const X &x, Y &y) const |
y += alpha A^H x | |
FieldTraits< K >::real_type | frobenius_norm () const |
frobenius norm: sqrt(sum over squared values of entries) | |
FieldTraits< K >::real_type | frobenius_norm2 () const |
square of frobenius norm, need for block recursion | |
FieldTraits< K >::real_type | infinity_norm () const |
infinity norm (row sum norm, how to generalize for blocks?) | |
FieldTraits< K >::real_type | infinity_norm_real () const |
simplified infinity norm (uses Manhattan norm for complex values) | |
template<class V > | |
void | solve (V &x, const V &b) const |
Solve system A x = b. | |
void | invert () |
Compute inverse. | |
K | determinant () const |
calculates the determinant of this matrix | |
FieldMatrix & | leftmultiply (const FieldMatrix< K, rows, rows > &M) |
Multiplies M from the left to this matrix. | |
template<int l> | |
FieldMatrix< K, l, cols > | leftmultiplyany (const FieldMatrix< K, l, rows > &M) const |
Multiplies M from the left to this matrix, this matrix is not modified. | |
FieldMatrix & | rightmultiply (const FieldMatrix< K, cols, cols > &M) |
Multiplies M from the right to this matrix. | |
template<int l> | |
FieldMatrix< K, rows, l > | rightmultiplyany (const FieldMatrix< K, cols, l > &M) const |
Multiplies M from the right to this matrix, this matrix is not modified. | |
size_type | N () const |
number of blocks in row direction | |
size_type | M () const |
number of blocks in column direction | |
bool | exists (size_type i, size_type j) const |
return true when (i,j) is in pattern | |
Friends | |
std::ostream & | operator<< (std::ostream &s, const FieldMatrix< K, rows, cols > &a) |
Sends the matrix to an output stream. |
A dense n x m matrix.
Matrices represent linear maps from a vector space V to a vector space W. This class represents such a linear map by storing a two-dimensional array of numbers of a given field type K. The number of rows and columns is given at compile time.
typedef K Dune::FieldMatrix< K, ROWS, COLS >::block_type |
export the type representing the components
typedef row_type::Iterator Dune::FieldMatrix< K, ROWS, COLS >::ColIterator |
rename the iterators for easier access
typedef ConstIterator Dune::FieldMatrix< K, ROWS, COLS >::const_iterator |
typedef for stl compliant access
typedef row_type::ConstIterator Dune::FieldMatrix< K, ROWS, COLS >::ConstColIterator |
rename the iterators for easier access
typedef FieldIterator<const FieldMatrix<K,rows,cols>,const row_type> Dune::FieldMatrix< K, ROWS, COLS >::ConstIterator |
Iterator class for sequential access.
typedef ConstIterator Dune::FieldMatrix< K, ROWS, COLS >::ConstRowIterator |
rename the iterators for easier access
typedef K Dune::FieldMatrix< K, ROWS, COLS >::field_type |
export the type representing the field
typedef Iterator Dune::FieldMatrix< K, ROWS, COLS >::iterator |
typedef for stl compliant access
typedef FieldIterator<FieldMatrix<K,rows,cols>,row_type> Dune::FieldMatrix< K, ROWS, COLS >::Iterator |
Iterator class for sequential access.
typedef FieldVector<K,cols> Dune::FieldMatrix< K, ROWS, COLS >::row_type |
Each row is implemented by a field vector.
typedef Iterator Dune::FieldMatrix< K, ROWS, COLS >::RowIterator |
rename the iterators for easier access
typedef std::size_t Dune::FieldMatrix< K, ROWS, COLS >::size_type |
The type used for the index access and size operations.
anonymous enum |
anonymous enum |
Dune::FieldMatrix< K, ROWS, COLS >::FieldMatrix | ( | ) | [inline] |
Default constructor.
Dune::FieldMatrix< K, ROWS, COLS >::FieldMatrix | ( | const K & | k | ) | [inline, explicit] |
Constructor initializing the whole matrix with a scalar.
Dune::FieldMatrix< K, ROWS, COLS >::FieldMatrix | ( | const T & | t | ) | [inline, explicit] |
FieldMatrix& Dune::FieldMatrix< K, ROWS, COLS >::axpy | ( | const K & | k, | |
const FieldMatrix< K, ROWS, COLS > & | y | |||
) | [inline] |
vector space axpy operation (*this += k y)
Referenced by Dune::FieldMatrix< T, n, m >::axpy().
ConstIterator Dune::FieldMatrix< K, ROWS, COLS >::begin | ( | ) | const [inline] |
begin iterator
Iterator Dune::FieldMatrix< K, ROWS, COLS >::begin | ( | ) | [inline] |
begin iterator
K Dune::FieldMatrix< K, ROWS, COLS >::determinant | ( | ) | const |
calculates the determinant of this matrix
ConstIterator Dune::FieldMatrix< K, ROWS, COLS >::end | ( | ) | const [inline] |
end iterator
Iterator Dune::FieldMatrix< K, ROWS, COLS >::end | ( | ) | [inline] |
end iterator
bool Dune::FieldMatrix< K, ROWS, COLS >::exists | ( | size_type | i, | |
size_type | j | |||
) | const [inline] |
return true when (i,j) is in pattern
FieldTraits<K>::real_type Dune::FieldMatrix< K, ROWS, COLS >::frobenius_norm | ( | ) | const [inline] |
frobenius norm: sqrt(sum over squared values of entries)
FieldTraits<K>::real_type Dune::FieldMatrix< K, ROWS, COLS >::frobenius_norm2 | ( | ) | const [inline] |
square of frobenius norm, need for block recursion
FieldTraits<K>::real_type Dune::FieldMatrix< K, ROWS, COLS >::infinity_norm | ( | ) | const [inline] |
infinity norm (row sum norm, how to generalize for blocks?)
FieldTraits<K>::real_type Dune::FieldMatrix< K, ROWS, COLS >::infinity_norm_real | ( | ) | const [inline] |
simplified infinity norm (uses Manhattan norm for complex values)
void Dune::FieldMatrix< K, ROWS, COLS >::invert | ( | ) |
Compute inverse.
FMatrixError | if the matrix is singular |
FieldMatrix& Dune::FieldMatrix< K, ROWS, COLS >::leftmultiply | ( | const FieldMatrix< K, rows, rows > & | M | ) | [inline] |
Multiplies M from the left to this matrix.
FieldMatrix<K,l,cols> Dune::FieldMatrix< K, ROWS, COLS >::leftmultiplyany | ( | const FieldMatrix< K, l, rows > & | M | ) | const [inline] |
Multiplies M from the left to this matrix, this matrix is not modified.
size_type Dune::FieldMatrix< K, ROWS, COLS >::M | ( | ) | const [inline] |
number of blocks in column direction
Referenced by Dune::FieldMatrix< T, n, m >::mmhv(), Dune::FieldMatrix< T, n, m >::mmtv(), Dune::FieldMatrix< T, n, m >::mmv(), Dune::FieldMatrix< T, n, m >::mtv(), Dune::FieldMatrix< T, n, m >::mv(), Dune::FieldMatrix< T, n, m >::umhv(), Dune::FieldMatrix< T, n, m >::umtv(), Dune::FieldMatrix< T, n, m >::umv(), Dune::FieldMatrix< T, n, m >::usmhv(), Dune::FieldMatrix< T, n, m >::usmtv(), and Dune::FieldMatrix< T, n, m >::usmv().
void Dune::FieldMatrix< K, ROWS, COLS >::mmhv | ( | const X & | x, | |
Y & | y | |||
) | const [inline] |
y -= A^H x
void Dune::FieldMatrix< K, ROWS, COLS >::mmtv | ( | const X & | x, | |
Y & | y | |||
) | const [inline] |
y -= A^T x
void Dune::FieldMatrix< K, ROWS, COLS >::mmv | ( | const X & | x, | |
Y & | y | |||
) | const [inline] |
y -= A x
void Dune::FieldMatrix< K, ROWS, COLS >::mtv | ( | const X & | x, | |
Y & | y | |||
) | const [inline] |
y = A^T x
void Dune::FieldMatrix< K, ROWS, COLS >::mv | ( | const X & | x, | |
Y & | y | |||
) | const [inline] |
y = A x
size_type Dune::FieldMatrix< K, ROWS, COLS >::N | ( | ) | const [inline] |
number of blocks in row direction
Referenced by Dune::FieldMatrix< T, n, m >::mmhv(), Dune::FieldMatrix< T, n, m >::mmtv(), Dune::FieldMatrix< T, n, m >::mmv(), Dune::FieldMatrix< T, n, m >::mtv(), Dune::FieldMatrix< T, n, m >::mv(), Dune::FieldMatrix< T, n, m >::umhv(), Dune::FieldMatrix< T, n, m >::umtv(), Dune::FieldMatrix< T, n, m >::umv(), Dune::FieldMatrix< T, n, m >::usmhv(), Dune::FieldMatrix< T, n, m >::usmtv(), and Dune::FieldMatrix< T, n, m >::usmv().
FieldMatrix& Dune::FieldMatrix< K, ROWS, COLS >::operator*= | ( | const K & | k | ) | [inline] |
vector space multiplication with scalar
FieldMatrix& Dune::FieldMatrix< K, ROWS, COLS >::operator+= | ( | const FieldMatrix< K, ROWS, COLS > & | y | ) | [inline] |
vector space addition
FieldMatrix& Dune::FieldMatrix< K, ROWS, COLS >::operator-= | ( | const FieldMatrix< K, ROWS, COLS > & | y | ) | [inline] |
vector space subtraction
FieldMatrix& Dune::FieldMatrix< K, ROWS, COLS >::operator/= | ( | const K & | k | ) | [inline] |
vector space division by scalar
FieldMatrix& Dune::FieldMatrix< K, ROWS, COLS >::operator= | ( | const T & | t | ) | [inline] |
FieldMatrix& Dune::FieldMatrix< K, ROWS, COLS >::operator= | ( | const K & | k | ) | [inline] |
const row_type& Dune::FieldMatrix< K, ROWS, COLS >::operator[] | ( | size_type | i | ) | const [inline] |
same for read only access
row_type& Dune::FieldMatrix< K, ROWS, COLS >::operator[] | ( | size_type | i | ) | [inline] |
random access to the rows
ConstIterator Dune::FieldMatrix< K, ROWS, COLS >::rbegin | ( | ) | const [inline] |
begin iterator
Iterator Dune::FieldMatrix< K, ROWS, COLS >::rbegin | ( | ) | [inline] |
begin iterator
ConstIterator Dune::FieldMatrix< K, ROWS, COLS >::rend | ( | ) | const [inline] |
end iterator
Iterator Dune::FieldMatrix< K, ROWS, COLS >::rend | ( | ) | [inline] |
end iterator
FieldMatrix& Dune::FieldMatrix< K, ROWS, COLS >::rightmultiply | ( | const FieldMatrix< K, cols, cols > & | M | ) | [inline] |
Multiplies M from the right to this matrix.
FieldMatrix<K,rows,l> Dune::FieldMatrix< K, ROWS, COLS >::rightmultiplyany | ( | const FieldMatrix< K, cols, l > & | M | ) | const [inline] |
Multiplies M from the right to this matrix, this matrix is not modified.
void Dune::FieldMatrix< K, ROWS, COLS >::solve | ( | V & | x, | |
const V & | b | |||
) | const [inline] |
Solve system A x = b.
FMatrixError | if the matrix is singular |
void Dune::FieldMatrix< K, ROWS, COLS >::umhv | ( | const X & | x, | |
Y & | y | |||
) | const [inline] |
y += A^H x
void Dune::FieldMatrix< K, ROWS, COLS >::umtv | ( | const X & | x, | |
Y & | y | |||
) | const [inline] |
y += A^T x
void Dune::FieldMatrix< K, ROWS, COLS >::umv | ( | const X & | x, | |
Y & | y | |||
) | const [inline] |
y += A x
void Dune::FieldMatrix< K, ROWS, COLS >::usmhv | ( | const K & | alpha, | |
const X & | x, | |||
Y & | y | |||
) | const [inline] |
y += alpha A^H x
void Dune::FieldMatrix< K, ROWS, COLS >::usmtv | ( | const K & | alpha, | |
const X & | x, | |||
Y & | y | |||
) | const [inline] |
y += alpha A^T x
void Dune::FieldMatrix< K, ROWS, COLS >::usmv | ( | const K & | alpha, | |
const X & | x, | |||
Y & | y | |||
) | const [inline] |
y += alpha A x
std::ostream& operator<< | ( | std::ostream & | s, | |
const FieldMatrix< K, rows, cols > & | a | |||
) | [friend] |
Sends the matrix to an output stream.