dune-istl 2.10
Loading...
Searching...
No Matches
Dune::BDMatrix< B, A > Class Template Reference

A block-diagonal matrix. More...

#include <dune/istl/bdmatrix.hh>

Inheritance diagram for Dune::BDMatrix< B, A >:
Inheritance graph

Public Types

using field_type = typename Imp::BlockTraits<B>::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

Public Member Functions

 BDMatrix ()
 Default constructor.
 BDMatrix (int size)
 BDMatrix (std::initializer_list< B > const &list)
 Construct from a std::initializer_list.
void setSize (size_type size)
 Resize the matrix. Invalidates the content!
BDMatrixoperator= (const BDMatrix &other)
 assignment
BDMatrixoperator= (const field_type &k)
 assignment from scalar
template<class V>
void solve (V &x, const V &rhs) const
 Solve the system Ax=b in O(n) time.
void invert ()
 Inverts the matrix.

Detailed Description

template<class B, class A = std::allocator<B>>
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.

Member Typedef Documentation

◆ allocator_type

template<class B, class A = std::allocator<B>>
typedef A Dune::BDMatrix< B, A >::allocator_type

export the allocator type

◆ block_type

template<class B, class A = std::allocator<B>>
typedef B Dune::BDMatrix< B, A >::block_type

export the type representing the components

◆ field_type

template<class B, class A = std::allocator<B>>
using Dune::BDMatrix< B, A >::field_type = typename Imp::BlockTraits<B>::field_type

export the type representing the field

◆ size_type

template<class B, class A = std::allocator<B>>
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

Constructor & Destructor Documentation

◆ BDMatrix() [1/3]

template<class B, class A = std::allocator<B>>
Dune::BDMatrix< B, A >::BDMatrix ( )
inline

Default constructor.

◆ BDMatrix() [2/3]

template<class B, class A = std::allocator<B>>
Dune::BDMatrix< B, A >::BDMatrix ( int size)
inlineexplicit

◆ BDMatrix() [3/3]

template<class B, class A = std::allocator<B>>
Dune::BDMatrix< B, A >::BDMatrix ( std::initializer_list< B > const & list)
inline

Construct from a std::initializer_list.

Member Function Documentation

◆ invert()

template<class B, class A = std::allocator<B>>
void Dune::BDMatrix< B, A >::invert ( )
inline

Inverts the matrix.

◆ operator=() [1/2]

template<class B, class A = std::allocator<B>>
BDMatrix & Dune::BDMatrix< B, A >::operator= ( const BDMatrix< B, A > & other)
inline

assignment

◆ operator=() [2/2]

template<class B, class A = std::allocator<B>>
BDMatrix & Dune::BDMatrix< B, A >::operator= ( const field_type & k)
inline

assignment from scalar

◆ setSize()

template<class B, class A = std::allocator<B>>
void Dune::BDMatrix< B, A >::setSize ( size_type size)
inline

Resize the matrix. Invalidates the content!

◆ solve()

template<class B, class A = std::allocator<B>>
template<class V>
void Dune::BDMatrix< B, A >::solve ( V & x,
const V & rhs ) const
inline

Solve the system Ax=b in O(n) time.

Exceptions
ISTLErrorif the matrix is singular

The documentation for this class was generated from the following file: