Dune::BDMatrix< B, A > Class Template Reference
[Sparse Matrix and Vector classes]
#include <bdmatrix.hh>

Detailed Description
template<class B, class A = ISTLAllocator>
class Dune::BDMatrix< B, A >
A block-diagonal matrix.
- Todo:
- It would be safer and more efficient to have a real implementation of a block-diagonal matrix and not just subclassing from BCRSMatrix. But that's quite a lot of work for that little advantage.
Public Types | |
enum | { blocklevel = B::blocklevel+1 } |
increment block level counter | |
typedef B::field_type | field_type |
export the type representing the field | |
typedef B | block_type |
export the type representing the components | |
typedef A | allocator_type |
export the allocator type | |
typedef A::size_type | size_type |
implement row_type with compressed vector | |
enum | { blocklevel = B::blocklevel+1 } |
increment block level counter More... | |
enum | BuildMode { row_wise, random, unknown } |
we support two modes More... | |
typedef CompressedBlockVectorWindow< B, A > | row_type |
implement row_type with compressed vector | |
typedef RealRowIterator< row_type > | iterator |
The iterator over the (mutable matrix rows. | |
typedef Iterator | RowIterator |
rename the iterators for easier access | |
typedef row_type::Iterator | ColIterator |
Iterator for the entries of each row. | |
typedef RealRowIterator< const row_type > | const_iterator |
The const iterator over the matrix rows. | |
typedef ConstIterator | ConstRowIterator |
rename the const row iterator for easier access | |
typedef row_type::ConstIterator | ConstColIterator |
Const iterator to the entries of a row. | |
Public Member Functions | |
BDMatrix () | |
Default constructor. | |
BDMatrix & | operator= (const BDMatrix &other) |
assignment | |
BDMatrix & | operator= (const field_type &k) |
assignment from scalar | |
void | invert () |
Inverts the matrix. | |
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 () |
Get iterator to first row. | |
ConstIterator | begin () const |
Get const iterator to first row. | |
Iterator | end () |
Get iterator to one beyond last row. | |
ConstIterator | end () const |
Get const iterator to one beyond last row. | |
Iterator | rbegin () |
Get iterator to last row. | |
ConstIterator | rbegin () const |
Get const iterator to last row. | |
Iterator | rend () |
Get iterator to one before first row. | |
ConstIterator | rend () const |
Get const iterator to one before first row. | |
void | setBuildMode (BuildMode bm) |
Sets the build mode of the matrix. | |
void | setSize (size_type rows, size_type columns, size_type nnz=0) |
Set the size of the matrix. | |
CreateIterator | createbegin () |
get initial create iterator | |
CreateIterator | createend () |
get create iterator pointing to one after the last block | |
size_type | getrowsize (size_type i) const |
get current number of indices in row i | |
void | incrementrowsize (size_type i, size_type s=1) |
increment size of row i by s (1 by default) | |
BCRSMatrix & | operator*= (const field_type &k) |
vector space multiplication with scalar | |
BCRSMatrix & | operator/= (const field_type &k) |
vector space division by scalar | |
BCRSMatrix & | operator+= (const BCRSMatrix &b) |
Add the entries of another matrix to this one. | |
BCRSMatrix & | operator-= (const BCRSMatrix &b) |
Substract the entries of another matrix to this one. | |
template<class X, class Y> | |
void | mv (const X &x, Y &y) const |
y = A x | |
template<class X, class Y> | |
void | umv (const X &x, Y &y) const |
y += A x | |
template<class X, class Y> | |
void | mmv (const X &x, Y &y) const |
y -= A x | |
template<class X, class Y> | |
void | usmv (const field_type &alpha, const X &x, Y &y) const |
y += alpha 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 | mmtv (const X &x, Y &y) const |
y -= A^T x | |
template<class X, class Y> | |
void | usmtv (const field_type &alpha, const X &x, Y &y) const |
y += alpha 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 | mmhv (const X &x, Y &y) const |
y -= A^H x | |
template<class X, class Y> | |
void | usmhv (const field_type &alpha, const X &x, Y &y) const |
y += alpha A^H x | |
double | frobenius_norm2 () const |
square of frobenius norm, need for block recursion | |
double | frobenius_norm () const |
frobenius norm: sqrt(sum over squared values of entries) | |
double | infinity_norm () const |
infinity norm (row sum norm, how to generalize for blocks?) | |
double | infinity_norm_real () const |
simplified infinity norm (uses Manhattan norm for complex values) | |
size_type | N () const |
number of rows (counted in blocks) | |
size_type | M () const |
number of columns (counted in blocks) | |
size_type | nonzeroes () const |
number of blocks that are stored (the number of blocks that possibly are nonzero) | |
size_type | rowdim (size_type i) const |
row dimension of block r | |
size_type | rowdim () const |
dimension of the destination vector space | |
size_type | coldim (size_type c) const |
Column dimension of block c. | |
size_type | coldim () const |
dimension of the source vector space | |
bool | exists (size_type i, size_type j) const |
return true if (i,j) is in pattern |
Member Typedef Documentation
typedef A::size_type Dune::BDMatrix< B, A >::size_type |
implement row_type with compressed vector
The type for the index access and the size
Reimplemented from Dune::BCRSMatrix< B, A >.
Member Enumeration Documentation
anonymous enum [inherited] |
enum Dune::BCRSMatrix::BuildMode [inherited] |
we support two modes
- Enumerator:
Member Function Documentation
void Dune::BCRSMatrix< B, A >::setBuildMode | ( | BuildMode | bm | ) | [inline, inherited] |
Sets the build mode of the matrix.
- Parameters:
-
bm The build mode to use.
void Dune::BCRSMatrix< B, A >::setSize | ( | size_type | rows, | |
size_type | columns, | |||
size_type | nnz = 0 | |||
) | [inline, inherited] |
Set the size of the matrix.
Sets the number of rows and columns of the matrix and allocates the memory needed for the storage of the matrix entries.
- Warning:
- After calling this methods on an already allocated (and probably setup matrix) results in all the structure and data being deleted. I.~e. one has to setup the matrix again.
- Parameters:
-
rows The number of rows the matrix should contain. columns the number of columns the matrix should contain. nnz The number of nonzero entries the matrix should hold (if omitted defaults to 0).
BCRSMatrix& Dune::BCRSMatrix< B, A >::operator+= | ( | const BCRSMatrix< B, A > & | b | ) | [inline, inherited] |
Add the entries of another matrix to this one.
- Parameters:
-
b The matrix to add to this one. Its sparsity pattern has to be subset of the sparsity pattern of this matrix.
References Dune::BCRSMatrix< B, A >::begin(), Dune::BCRSMatrix< B, A >::end(), Dune::BCRSMatrix< B, A >::M(), and Dune::BCRSMatrix< B, A >::N().
BCRSMatrix& Dune::BCRSMatrix< B, A >::operator-= | ( | const BCRSMatrix< B, A > & | b | ) | [inline, inherited] |
Substract the entries of another matrix to this one.
- Parameters:
-
b The matrix to add to this one. Its sparsity pattern has to be subset of the sparsity pattern of this matrix.
References Dune::BCRSMatrix< B, A >::begin(), Dune::BCRSMatrix< B, A >::end(), Dune::BCRSMatrix< B, A >::M(), and Dune::BCRSMatrix< B, A >::N().
size_type Dune::BCRSMatrix< B, A >::rowdim | ( | size_type | i | ) | const [inline, inherited] |
row dimension of block r
- Bug:
- Does not count empty rows (FlySpray #7)
References Dune::CompressedBlockVectorWindow< B, A >::getptr().
size_type Dune::BCRSMatrix< B, A >::coldim | ( | size_type | c | ) | const [inline, inherited] |
Column dimension of block c.
- Bug:
- Does not count empty columns (FlySpray #7)
References Dune::CompressedBlockVectorWindow< B, A >::getindexptr(), Dune::CompressedBlockVectorWindow< B, A >::getptr(), and Dune::CompressedBlockVectorWindow< B, A >::getsize().
The documentation for this class was generated from the following file: