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

A block-tridiagonal matrix. More...

#include <dune/istl/btdmatrix.hh>

Inheritance diagram for Dune::BTDMatrix< 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
 
enum  BuildStage {
  notbuilt =0 , notAllocated =0 , building =1 , rowSizesBuilt =2 ,
  built =3
}
 
enum  BuildMode { row_wise , random , implicit , unknown }
 we support two modes More...
 
typedef Imp::CompressedBlockVectorWindow< B, size_typerow_type
 implement row_type with compressed vector
 
typedef ::Dune::CompressionStatistics< size_typeCompressionStatistics
 The type for the statistics object returned by compress()
 
typedef RealRowIterator< row_typeiterator
 The iterator over the (mutable matrix rows.
 
typedef RealRowIterator< row_typeIterator
 
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_typeconst_iterator
 The const iterator over the matrix rows.
 
typedef RealRowIterator< const row_typeConstIterator
 
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

 BTDMatrix ()
 Default constructor.
 
 BTDMatrix (size_type size)
 
void setSize (size_type size)
 Resize the matrix. Invalidates the content!
 
BTDMatrixoperator= (const BTDMatrix &other)
 assignment
 
BTDMatrixoperator= (const field_type &k)
 assignment from scalar
 
template<class V >
void solve (V &x, const V &rhs) const
 Use the Thomas algorithm to solve the system Ax=b in O(n) time.
 
row_typeoperator[] (size_type i)
 random access to the rows
 
const row_typeoperator[] (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 beforeEnd ()
 
ConstIterator beforeEnd () const
 
Iterator beforeBegin ()
 
ConstIterator beforeBegin () const
 
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.
 
void setImplicitBuildModeParameters (size_type _avg, double compressionBufferSize)
 Set parameters needed for creation in implicit build mode.
 
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)
 
template<typename It >
void setIndicesNoSort (size_type row, It begin, It end)
 Set all column indices for row from the given iterator range.
 
template<typename It >
void setIndices (size_type row, It begin, It end)
 Set all column indices for row from the given iterator range.
 
B & entry (size_type row, size_type col)
 Returns reference to entry (row,col) of the matrix.
 
CompressionStatistics compress ()
 Finishes the buildstage in implicit mode.
 
BCRSMatrixoperator*= (const field_type &k)
 vector space multiplication with scalar
 
BCRSMatrixoperator/= (const field_type &k)
 vector space division by scalar
 
BCRSMatrixoperator+= (const BCRSMatrix &b)
 Add the entries of another matrix to this one.
 
BCRSMatrixoperator-= (const BCRSMatrix &b)
 Subtract the entries of another matrix from this one.
 
BCRSMatrixaxpy (field_type alpha, const BCRSMatrix &b)
 Add the scaled 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 , class F >
void usmv (F &&alpha, const X &x, Y &y) const
 y += alpha 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 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
 
FieldTraits< field_type >::real_type frobenius_norm2 () const
 square of frobenius norm, need for block recursion
 
FieldTraits< field_type >::real_type frobenius_norm () const
 frobenius norm: sqrt(sum over squared values of entries)
 
template<typename ft = field_type, typename std::enable_if<!HasNaN< ft >::value, int >::type = 0>
FieldTraits< ft >::real_type infinity_norm () const
 infinity norm (row sum norm, how to generalize for blocks?)
 
template<typename ft = field_type, typename std::enable_if< HasNaN< ft >::value, int >::type = 0>
FieldTraits< ft >::real_type infinity_norm () const
 infinity norm (row sum norm, how to generalize for blocks?)
 
template<typename ft = field_type, typename std::enable_if<!HasNaN< ft >::value, int >::type = 0>
FieldTraits< ft >::real_type infinity_norm_real () const
 simplified infinity norm (uses Manhattan norm for complex values)
 
template<typename ft = field_type, typename std::enable_if< HasNaN< ft >::value, int >::type = 0>
FieldTraits< ft >::real_type 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)
 
BuildStage buildStage () const
 The current build stage of the matrix.
 
BuildMode buildMode () const
 The currently selected build mode of the matrix.
 
bool exists (size_type i, size_type j) const
 return true if (i,j) is in pattern
 

Protected Types

typedef std::map< std::pair< size_type, size_type >, B > OverflowType
 

Protected Member Functions

void setWindowPointers (ConstRowIterator row)
 
void setColumnPointers (ConstRowIterator row)
 Copy row sizes from iterator range starting at row and set column index pointers for all rows.
 
void setDataPointers ()
 Set data pointers for all rows.
 
void copyWindowStructure (const BCRSMatrix &Mat)
 Copy the window structure from another matrix.
 
void deallocate (bool deallocateRows=true)
 deallocate memory of the matrix.
 
void allocate (size_type rows, size_type columns, size_type allocationSize, bool allocateRows, bool allocate_data)
 Allocate memory for the matrix structure.
 
void allocateData ()
 
void implicit_allocate (size_type _n, size_type _m)
 organizes allocation implicit mode calculates correct array size to be allocated and sets the the window pointers to their correct positions for insertion. internally uses allocate() for the real allocation.
 

Protected Attributes

BuildMode build_mode
 
BuildStage ready
 
std::allocator_traits< A >::template rebind_alloc< B > allocator_
 
std::allocator_traits< A >::template rebind_alloc< row_typerowAllocator_
 
std::allocator_traits< A >::template rebind_alloc< size_typesizeAllocator_
 
size_type n
 
size_type m
 
size_type nnz_
 
size_type allocationSize_
 
row_typer
 
B * a
 
std::shared_ptr< size_typej_
 
size_type avg
 
double compressionBufferSize_
 
OverflowType overflow
 

Detailed Description

template<class B, class A = std::allocator<B>>
class Dune::BTDMatrix< B, A >

A block-tridiagonal matrix.

Todo
It would be safer and more efficient to have a real implementation of a block-tridiagonal 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>>
A Dune::BTDMatrix< B, A >::allocator_type

export the allocator type

◆ block_type

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

export the type representing the components

◆ ColIterator

template<typename B , typename A >
row_type::Iterator Dune::BCRSMatrix< B, A >::ColIterator
inherited

Iterator for the entries of each row.

◆ CompressionStatistics

template<typename B , typename A >
::Dune::CompressionStatistics<size_type> Dune::BCRSMatrix< B, A >::CompressionStatistics
inherited

The type for the statistics object returned by compress()

◆ const_iterator

template<typename B , typename A >
RealRowIterator<const row_type> Dune::BCRSMatrix< B, A >::const_iterator
inherited

The const iterator over the matrix rows.

◆ ConstColIterator

template<typename B , typename A >
row_type::ConstIterator Dune::BCRSMatrix< B, A >::ConstColIterator
inherited

Const iterator to the entries of a row.

◆ ConstIterator

template<typename B , typename A >
RealRowIterator<const row_type> Dune::BCRSMatrix< B, A >::ConstIterator
inherited

◆ ConstRowIterator

template<typename B , typename A >
ConstIterator Dune::BCRSMatrix< B, A >::ConstRowIterator
inherited

rename the const row iterator for easier access

◆ field_type

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

export the type representing the field

◆ Iterator

template<typename B , typename A >
RealRowIterator<row_type> Dune::BCRSMatrix< B, A >::Iterator
inherited

◆ iterator

template<typename B , typename A >
RealRowIterator<row_type> Dune::BCRSMatrix< B, A >::iterator
inherited

The iterator over the (mutable matrix rows.

◆ OverflowType

template<typename B , typename A >
std::map<std::pair<size_type,size_type>, B> Dune::BCRSMatrix< B, A >::OverflowType
protectedinherited

◆ row_type

template<typename B , typename A >
Imp::CompressedBlockVectorWindow<B,size_type> Dune::BCRSMatrix< B, A >::row_type
inherited

implement row_type with compressed vector

◆ RowIterator

template<typename B , typename A >
Iterator Dune::BCRSMatrix< B, A >::RowIterator
inherited

rename the iterators for easier access

◆ size_type

template<class B , class A = std::allocator<B>>
A::size_type Dune::BTDMatrix< B, A >::size_type

implement row_type with compressed vector

The type for the index access and the size

Member Enumeration Documentation

◆ BuildMode

template<typename B , typename A >
enum Dune::BCRSMatrix::BuildMode
inherited

we support two modes

Enumerator
row_wise 

Build in a row-wise manner.

Rows are built up in sequential order. Size of the row and the column indices are defined. A row can be used as soon as it is initialized. With respect to memory there are two variants of this scheme: (a) number of non-zeroes known in advance (application finite difference schemes), (b) number of non-zeroes not known in advance (application: Sparse LU, ILU(n)).

random 

Build entries randomly.

For general finite element implementations the number of rows n is known, the number of non-zeroes might also be known (e.g. #edges + #nodes for P2) but the size of a row and the indices of a row cannot be defined in sequential order.

implicit 

Build entries randomly with an educated guess for the number of entries per row.

Allows random order generation as in random mode, but row sizes do not need to be given first. Instead an average number of non-zeroes per row is passed to the constructor. Matrix setup is finished with compress(), full data access during build stage is possible.

unknown 

Build mode not set!

◆ BuildStage

template<typename B , typename A >
enum Dune::BCRSMatrix::BuildStage
inherited
Enumerator
notbuilt 

Matrix is not built at all, no memory has been allocated, build mode and size can still be set.

notAllocated 

Matrix is not built at all, no memory has been allocated, build mode and size can still be set.

building 

Matrix is currently being built, some memory has been allocated, build mode and size are fixed.

rowSizesBuilt 

The row sizes of the matrix are known.

Only used in random mode.

built 

The matrix structure is fully built.

Constructor & Destructor Documentation

◆ BTDMatrix() [1/2]

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

Default constructor.

◆ BTDMatrix() [2/2]

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

Member Function Documentation

◆ allocate()

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::allocate ( size_type rows,
size_type columns,
size_type allocationSize,
bool allocateRows,
bool allocate_data )
inlineprotectedinherited

Allocate memory for the matrix structure.

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 lost. Please call deallocate() before calling allocate in this case.
Parameters
rowsThe number of rows the matrix should contain.
columnsthe number of columns the matrix should contain.
allocationSizeThe number of nonzero entries the matrix should hold (if omitted defaults to 0).
allocateRowsWhether we have to allocate the row pointers, too. (Defaults to true)
allocate_dataWhether data array needs to be allocated

◆ allocateData()

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::allocateData ( )
inlineprotectedinherited

◆ axpy()

template<typename B , typename A >
BCRSMatrix & Dune::BCRSMatrix< B, A >::axpy ( field_type alpha,
const BCRSMatrix< B, A > & b )
inlineinherited

Add the scaled entries of another matrix to this one.

Matrix axpy operation: *this += alpha * b

Parameters
alphaScaling factor.
bThe matrix to add to this one. Its sparsity pattern has to be subset of the sparsity pattern of this matrix.

◆ beforeBegin() [1/2]

template<typename B , typename A >
Iterator Dune::BCRSMatrix< B, A >::beforeBegin ( )
inlineinherited
Returns
an iterator that is positioned before the first row of the matrix.

◆ beforeBegin() [2/2]

template<typename B , typename A >
ConstIterator Dune::BCRSMatrix< B, A >::beforeBegin ( ) const
inlineinherited
Returns
an iterator that is positioned before the first row of the matrix.

◆ beforeEnd() [1/2]

template<typename B , typename A >
Iterator Dune::BCRSMatrix< B, A >::beforeEnd ( )
inlineinherited
Returns
an iterator that is positioned before the end iterator of the rows, i.e. at the last row.

◆ beforeEnd() [2/2]

template<typename B , typename A >
ConstIterator Dune::BCRSMatrix< B, A >::beforeEnd ( ) const
inlineinherited
Returns
an iterator that is positioned before the end iterator of the rows. i.e. at the last row.

◆ begin() [1/2]

template<typename B , typename A >
Iterator Dune::BCRSMatrix< B, A >::begin ( )
inlineinherited

Get iterator to first row.

◆ begin() [2/2]

template<typename B , typename A >
ConstIterator Dune::BCRSMatrix< B, A >::begin ( ) const
inlineinherited

Get const iterator to first row.

◆ buildMode()

template<typename B , typename A >
BuildMode Dune::BCRSMatrix< B, A >::buildMode ( ) const
inlineinherited

The currently selected build mode of the matrix.

◆ buildStage()

template<typename B , typename A >
BuildStage Dune::BCRSMatrix< B, A >::buildStage ( ) const
inlineinherited

The current build stage of the matrix.

◆ compress()

template<typename B , typename A >
CompressionStatistics Dune::BCRSMatrix< B, A >::compress ( )
inlineinherited

Finishes the buildstage in implicit mode.

Performs compression of index and data arrays with linear complexity in the number of nonzeroes.

After calling this method, the matrix is in the built state and no more entries can be added.

Returns
An object with some statistics about the compression for future optimization.

◆ copyWindowStructure()

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::copyWindowStructure ( const BCRSMatrix< B, A > & Mat)
inlineprotectedinherited

Copy the window structure from another matrix.

◆ createbegin()

template<typename B , typename A >
CreateIterator Dune::BCRSMatrix< B, A >::createbegin ( )
inlineinherited

get initial create iterator

◆ createend()

template<typename B , typename A >
CreateIterator Dune::BCRSMatrix< B, A >::createend ( )
inlineinherited

get create iterator pointing to one after the last block

◆ deallocate()

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::deallocate ( bool deallocateRows = true)
inlineprotectedinherited

deallocate memory of the matrix.

Parameters
deallocateRowsWhether we have to deallocate the row pointers, too. If false they will not be touched. (Defaults to true).

◆ end() [1/2]

template<typename B , typename A >
Iterator Dune::BCRSMatrix< B, A >::end ( )
inlineinherited

Get iterator to one beyond last row.

◆ end() [2/2]

template<typename B , typename A >
ConstIterator Dune::BCRSMatrix< B, A >::end ( ) const
inlineinherited

Get const iterator to one beyond last row.

◆ entry()

template<typename B , typename A >
B & Dune::BCRSMatrix< B, A >::entry ( size_type row,
size_type col )
inlineinherited

Returns reference to entry (row,col) of the matrix.

This method can only be used when the matrix is in implicit building mode.

A reference to entry (row, col) of the matrix is returned. If entry (row, col) is accessed for the first time, it is created on the fly.

This method can only be used while building the matrix, after compression operator[] gives a much better performance.

◆ exists()

template<typename B , typename A >
bool Dune::BCRSMatrix< B, A >::exists ( size_type i,
size_type j ) const
inlineinherited

return true if (i,j) is in pattern

◆ frobenius_norm()

template<typename B , typename A >
FieldTraits< field_type >::real_type Dune::BCRSMatrix< B, A >::frobenius_norm ( ) const
inlineinherited

frobenius norm: sqrt(sum over squared values of entries)

◆ frobenius_norm2()

template<typename B , typename A >
FieldTraits< field_type >::real_type Dune::BCRSMatrix< B, A >::frobenius_norm2 ( ) const
inlineinherited

square of frobenius norm, need for block recursion

◆ getrowsize()

template<typename B , typename A >
size_type Dune::BCRSMatrix< B, A >::getrowsize ( size_type i) const
inlineinherited

get current number of indices in row i

◆ implicit_allocate()

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::implicit_allocate ( size_type _n,
size_type _m )
inlineprotectedinherited

organizes allocation implicit mode calculates correct array size to be allocated and sets the the window pointers to their correct positions for insertion. internally uses allocate() for the real allocation.

◆ incrementrowsize()

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::incrementrowsize ( size_type i,
size_type s = 1 )
inlineinherited

increment size of row i by s (1 by default)

◆ infinity_norm() [1/2]

template<typename B , typename A >
template<typename ft = field_type, typename std::enable_if<!HasNaN< ft >::value, int >::type = 0>
FieldTraits< ft >::real_type Dune::BCRSMatrix< B, A >::infinity_norm ( ) const
inlineinherited

infinity norm (row sum norm, how to generalize for blocks?)

◆ infinity_norm() [2/2]

template<typename B , typename A >
template<typename ft = field_type, typename std::enable_if< HasNaN< ft >::value, int >::type = 0>
FieldTraits< ft >::real_type Dune::BCRSMatrix< B, A >::infinity_norm ( ) const
inlineinherited

infinity norm (row sum norm, how to generalize for blocks?)

◆ infinity_norm_real() [1/2]

template<typename B , typename A >
template<typename ft = field_type, typename std::enable_if<!HasNaN< ft >::value, int >::type = 0>
FieldTraits< ft >::real_type Dune::BCRSMatrix< B, A >::infinity_norm_real ( ) const
inlineinherited

simplified infinity norm (uses Manhattan norm for complex values)

◆ infinity_norm_real() [2/2]

template<typename B , typename A >
template<typename ft = field_type, typename std::enable_if< HasNaN< ft >::value, int >::type = 0>
FieldTraits< ft >::real_type Dune::BCRSMatrix< B, A >::infinity_norm_real ( ) const
inlineinherited

simplified infinity norm (uses Manhattan norm for complex values)

◆ M()

template<typename B , typename A >
size_type Dune::BCRSMatrix< B, A >::M ( ) const
inlineinherited

number of columns (counted in blocks)

◆ mmhv()

template<typename B , typename A >
template<class X , class Y >
void Dune::BCRSMatrix< B, A >::mmhv ( const X & x,
Y & y ) const
inlineinherited

y -= A^H x

◆ mmtv()

template<typename B , typename A >
template<class X , class Y >
void Dune::BCRSMatrix< B, A >::mmtv ( const X & x,
Y & y ) const
inlineinherited

y -= A^T x

◆ mmv()

template<typename B , typename A >
template<class X , class Y >
void Dune::BCRSMatrix< B, A >::mmv ( const X & x,
Y & y ) const
inlineinherited

y -= A x

◆ mtv()

template<typename B , typename A >
template<class X , class Y >
void Dune::BCRSMatrix< B, A >::mtv ( const X & x,
Y & y ) const
inlineinherited

y = A^T x

◆ mv()

template<typename B , typename A >
template<class X , class Y >
void Dune::BCRSMatrix< B, A >::mv ( const X & x,
Y & y ) const
inlineinherited

y = A x

◆ N()

template<typename B , typename A >
size_type Dune::BCRSMatrix< B, A >::N ( ) const
inlineinherited

number of rows (counted in blocks)

◆ nonzeroes()

template<typename B , typename A >
size_type Dune::BCRSMatrix< B, A >::nonzeroes ( ) const
inlineinherited

number of blocks that are stored (the number of blocks that possibly are nonzero)

◆ operator*=()

template<typename B , typename A >
BCRSMatrix & Dune::BCRSMatrix< B, A >::operator*= ( const field_type & k)
inlineinherited

vector space multiplication with scalar

◆ operator+=()

template<typename B , typename A >
BCRSMatrix & Dune::BCRSMatrix< B, A >::operator+= ( const BCRSMatrix< B, A > & b)
inlineinherited

Add the entries of another matrix to this one.

Parameters
bThe matrix to add to this one. Its sparsity pattern has to be subset of the sparsity pattern of this matrix.

◆ operator-=()

template<typename B , typename A >
BCRSMatrix & Dune::BCRSMatrix< B, A >::operator-= ( const BCRSMatrix< B, A > & b)
inlineinherited

Subtract the entries of another matrix from this one.

Parameters
bThe matrix to subtract from this one. Its sparsity pattern has to be subset of the sparsity pattern of this matrix.

◆ operator/=()

template<typename B , typename A >
BCRSMatrix & Dune::BCRSMatrix< B, A >::operator/= ( const field_type & k)
inlineinherited

vector space division by scalar

◆ operator=() [1/2]

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

assignment

◆ operator=() [2/2]

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

assignment from scalar

◆ operator[]() [1/2]

template<typename B , typename A >
row_type & Dune::BCRSMatrix< B, A >::operator[] ( size_type i)
inlineinherited

random access to the rows

◆ operator[]() [2/2]

template<typename B , typename A >
const row_type & Dune::BCRSMatrix< B, A >::operator[] ( size_type i) const
inlineinherited

same for read only access

◆ setBuildMode()

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::setBuildMode ( BuildMode bm)
inlineinherited

Sets the build mode of the matrix.

Parameters
bmThe build mode to use.

◆ setColumnPointers()

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::setColumnPointers ( ConstRowIterator row)
inlineprotectedinherited

Copy row sizes from iterator range starting at row and set column index pointers for all rows.

This method does not modify the data pointers, as those are set only after building the pattern (to allow for a delayed allocation).

◆ setDataPointers()

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::setDataPointers ( )
inlineprotectedinherited

Set data pointers for all rows.

This method assumes that column pointers and row sizes have been correctly set up by a prior call to setColumnPointers().

◆ setImplicitBuildModeParameters()

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::setImplicitBuildModeParameters ( size_type _avg,
double compressionBufferSize )
inlineinherited

Set parameters needed for creation in implicit build mode.

Use this method before setSize() to define storage behaviour of a matrix in implicit build mode

Parameters
_avgexpected average number of entries per row
compressionBufferSizefraction of _n*_avg which is expected to be needed for elements that exceed _avg entries per row.

◆ setIndices()

template<typename B , typename A >
template<typename It >
void Dune::BCRSMatrix< B, A >::setIndices ( size_type row,
It begin,
It end )
inlineinherited

Set all column indices for row from the given iterator range.

The iterator range has to be of the same length as the previously set row size. The entries in the iterator range do not have to be in any particular order, but must not contain duplicate values. This method will insert the indices and sort them afterwards.

Calling this method overwrites any previously set column indices!

◆ setIndicesNoSort()

template<typename B , typename A >
template<typename It >
void Dune::BCRSMatrix< B, A >::setIndicesNoSort ( size_type row,
It begin,
It end )
inlineinherited

Set all column indices for row from the given iterator range.

The iterator range has to be of the same length as the previously set row size. The entries in the iterator range must be sorted and must not contain duplicate values. This method will insert the indices in the given order.

Calling this method overwrites any previously set column indices!

◆ setSize() [1/2]

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::setSize ( size_type rows,
size_type columns,
size_type nnz = 0 )
inlineinherited

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
rowsThe number of rows the matrix should contain.
columnsthe number of columns the matrix should contain.
nnzThe number of nonzero entries the matrix should hold (if omitted defaults to 0). Must be omitted in implicit mode.

◆ setSize() [2/2]

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

Resize the matrix. Invalidates the content!

◆ setWindowPointers()

template<typename B , typename A >
void Dune::BCRSMatrix< B, A >::setWindowPointers ( ConstRowIterator row)
inlineprotectedinherited

◆ solve()

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

Use the Thomas algorithm to solve the system Ax=b in O(n) time.

Exceptions
ISTLErrorif the matrix is singular

◆ umhv()

template<typename B , typename A >
template<class X , class Y >
void Dune::BCRSMatrix< B, A >::umhv ( const X & x,
Y & y ) const
inlineinherited

y += A^H x

◆ umtv()

template<typename B , typename A >
template<class X , class Y >
void Dune::BCRSMatrix< B, A >::umtv ( const X & x,
Y & y ) const
inlineinherited

y += A^T x

◆ umv()

template<typename B , typename A >
template<class X , class Y >
void Dune::BCRSMatrix< B, A >::umv ( const X & x,
Y & y ) const
inlineinherited

y += A x

◆ usmhv()

template<typename B , typename A >
template<class X , class Y >
void Dune::BCRSMatrix< B, A >::usmhv ( const field_type & alpha,
const X & x,
Y & y ) const
inlineinherited

y += alpha A^H x

◆ usmtv()

template<typename B , typename A >
template<class X , class Y >
void Dune::BCRSMatrix< B, A >::usmtv ( const field_type & alpha,
const X & x,
Y & y ) const
inlineinherited

y += alpha A^T x

◆ usmv()

template<typename B , typename A >
template<class X , class Y , class F >
void Dune::BCRSMatrix< B, A >::usmv ( F && alpha,
const X & x,
Y & y ) const
inlineinherited

y += alpha A x

Member Data Documentation

◆ a

template<typename B , typename A >
B* Dune::BCRSMatrix< B, A >::a
protectedinherited

◆ allocationSize_

template<typename B , typename A >
size_type Dune::BCRSMatrix< B, A >::allocationSize_
protectedinherited

◆ allocator_

template<typename B , typename A >
std::allocator_traits<A>::template rebind_alloc<B> Dune::BCRSMatrix< B, A >::allocator_
protectedinherited

◆ avg

template<typename B , typename A >
size_type Dune::BCRSMatrix< B, A >::avg
protectedinherited

◆ build_mode

template<typename B , typename A >
BuildMode Dune::BCRSMatrix< B, A >::build_mode
protectedinherited

◆ compressionBufferSize_

template<typename B , typename A >
double Dune::BCRSMatrix< B, A >::compressionBufferSize_
protectedinherited

◆ j_

template<typename B , typename A >
std::shared_ptr<size_type> Dune::BCRSMatrix< B, A >::j_
protectedinherited

◆ m

template<typename B , typename A >
size_type Dune::BCRSMatrix< B, A >::m
protectedinherited

◆ n

template<typename B , typename A >
size_type Dune::BCRSMatrix< B, A >::n
protectedinherited

◆ nnz_

template<typename B , typename A >
size_type Dune::BCRSMatrix< B, A >::nnz_
mutableprotectedinherited

◆ overflow

template<typename B , typename A >
OverflowType Dune::BCRSMatrix< B, A >::overflow
protectedinherited

◆ r

template<typename B , typename A >
row_type* Dune::BCRSMatrix< B, A >::r
protectedinherited

◆ ready

template<typename B , typename A >
BuildStage Dune::BCRSMatrix< B, A >::ready
protectedinherited

◆ rowAllocator_

template<typename B , typename A >
std::allocator_traits<A>::template rebind_alloc<row_type> Dune::BCRSMatrix< B, A >::rowAllocator_
protectedinherited

◆ sizeAllocator_

template<typename B , typename A >
std::allocator_traits<A>::template rebind_alloc<size_type> Dune::BCRSMatrix< B, A >::sizeAllocator_
protectedinherited

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