Loading...
Searching...
No Matches
Dune::BTDMatrix< B, A > Class Template Reference
Iterative Solvers Template Library (ISTL) » Sparse Matrix and Vector classes

A block-tridiagonal matrix. More...

`#include <dune/istl/btdmatrix.hh>`

Inheritance diagram for Dune::BTDMatrix< B, A >:

## 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_type > | row_type
| implement row_type with compressed vector
typedef ::Dune::CompressionStatistics< size_type > | CompressionStatistics
| The type for the statistics object returned by compress().
typedef RealRowIterator< row_type > | iterator
| The iterator over the (mutable matrix rows.
typedef RealRowIterator< row_type > | Iterator
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 RealRowIterator< const row_type > | ConstIterator
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!
BTDMatrix & | operator= (const BTDMatrix &other)
| assignment
BTDMatrix & | operator= (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_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 | 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.
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)
| Subtract the entries of another matrix from this one.
BCRSMatrix & | axpy (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_type > | rowAllocator_
std::allocator_traits< A >::template rebind_alloc< size_type > | sizeAllocator_
size_type | n
size_type | m
size_type | nnz_
size_type | allocationSize_
row_type * | r
B * | a
std::shared_ptr< size_type > | j_
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>>

typedef A Dune::BTDMatrix< B, A >::allocator_type

export the allocator type

## block_type

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

typedef B Dune::BTDMatrix< B, A >::block_type

export the type representing the components

## ColIterator

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

typedef row_type::Iterator Dune::BCRSMatrix< B, A >::ColIterator

inherited

Iterator for the entries of each row.

## CompressionStatistics

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

typedef ::Dune::CompressionStatistics<size_type> Dune::BCRSMatrix< B, A >::CompressionStatistics

inherited

The type for the statistics object returned by compress().

## const_iterator

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

typedef RealRowIterator<const row_type> Dune::BCRSMatrix< B, A >::const_iterator

inherited

The const iterator over the matrix rows.

## ConstColIterator

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

typedef row_type::ConstIterator Dune::BCRSMatrix< B, A >::ConstColIterator

inherited

Const iterator to the entries of a row.

## ConstIterator

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

typedef RealRowIterator<const row_type> Dune::BCRSMatrix< B, A >::ConstIterator

inherited

## ConstRowIterator

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

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

typedef RealRowIterator<row_type> Dune::BCRSMatrix< B, A >::Iterator

inherited

## iterator

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

typedef RealRowIterator<row_type> Dune::BCRSMatrix< B, A >::iterator

inherited

The iterator over the (mutable matrix rows.

## OverflowType

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

typedef std::map<std::pair<size_type,size_type>, B> Dune::BCRSMatrix< B, A >::OverflowType

protected inherited

## row_type

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

typedef Imp::CompressedBlockVectorWindow<B,size_type> Dune::BCRSMatrix< B, A >::row_type

inherited

implement row_type with compressed vector

## RowIterator

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

typedef Iterator Dune::BCRSMatrix< B, A >::RowIterator

inherited

rename the iterators for easier access

## size_type

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

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

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

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 | ) |

inline explicit

## Member Function Documentation

## allocate()

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

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

inline protected inherited

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

  rows | The number of rows the matrix should contain.
  columns | the number of columns the matrix should contain.
  allocationSize | The number of nonzero entries the matrix should hold (if omitted defaults to 0).
  allocateRows | Whether we have to allocate the row pointers, too. (Defaults to true)
  allocate_data | Whether data array needs to be allocated

## allocateData()

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

void Dune::BCRSMatrix< B, A >::allocateData | ( |  | ) |

inline protected inherited

## axpy()

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

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

inline inherited

Add the scaled entries of another matrix to this one.

Matrix axpy operation: *this += alpha * b

Parameters

  alpha | Scaling factor.
  b | The matrix to add to this one. Its sparsity pattern has to be subset of the sparsity pattern of this matrix.

## beforeBegin() [1/2]

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

Iterator Dune::BCRSMatrix< B, A >::beforeBegin | ( |  | ) |

inline inherited

Returns
  an iterator that is positioned before the first row of the matrix.

## beforeBegin() [2/2]

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

ConstIterator Dune::BCRSMatrix< B, A >::beforeBegin | ( |  | ) | const

inline inherited

Returns
  an iterator that is positioned before the first row of the matrix.

## beforeEnd() [1/2]

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

Iterator Dune::BCRSMatrix< B, A >::beforeEnd | ( |  | ) |

inline inherited

Returns
  an iterator that is positioned before the end iterator of the rows, i.e. at the last row.

## beforeEnd() [2/2]

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

ConstIterator Dune::BCRSMatrix< B, A >::beforeEnd | ( |  | ) | const

inline inherited

Returns
  an iterator that is positioned before the end iterator of the rows. i.e. at the last row.

## begin() [1/2]

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

Iterator Dune::BCRSMatrix< B, A >::begin | ( |  | ) |

inline inherited

Get iterator to first row.

## begin() [2/2]

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

ConstIterator Dune::BCRSMatrix< B, A >::begin | ( |  | ) | const

inline inherited

Get const iterator to first row.

## buildMode()

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

BuildMode Dune::BCRSMatrix< B, A >::buildMode | ( |  | ) | const

inline inherited

The currently selected build mode of the matrix.

## buildStage()

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

BuildStage Dune::BCRSMatrix< B, A >::buildStage | ( |  | ) | const

inline inherited

The current build stage of the matrix.

## compress()

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

CompressionStatistics Dune::BCRSMatrix< B, A >::compress | ( |  | ) |

inline inherited

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

void Dune::BCRSMatrix< B, A >::copyWindowStructure | ( | const BCRSMatrix< B, A > & | Mat | ) |

inline protected inherited

Copy the window structure from another matrix.

## createbegin()

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

CreateIterator Dune::BCRSMatrix< B, A >::createbegin | ( |  | ) |

inline inherited

get initial create iterator

## createend()

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

CreateIterator Dune::BCRSMatrix< B, A >::createend | ( |  | ) |

inline inherited

get create iterator pointing to one after the last block

## deallocate()

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

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

inline protected inherited

deallocate memory of the matrix.

Parameters

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

## end() [1/2]

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

Iterator Dune::BCRSMatrix< B, A >::end | ( |  | ) |

inline inherited

Get iterator to one beyond last row.

## end() [2/2]

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

ConstIterator Dune::BCRSMatrix< B, A >::end | ( |  | ) | const

inline inherited

Get const iterator to one beyond last row.

## entry()

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

B & Dune::BCRSMatrix< B, A >::entry | ( | size_type | row,
|  | size_type | col )

inline inherited

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

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

inline inherited

return true if (i,j) is in pattern

## frobenius_norm()

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

FieldTraits< field_type >::real_type Dune::BCRSMatrix< B, A >::frobenius_norm | ( |  | ) | const

inline inherited

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

## frobenius_norm2()

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

FieldTraits< field_type >::real_type Dune::BCRSMatrix< B, A >::frobenius_norm2 | ( |  | ) | const

inline inherited

square of frobenius norm, need for block recursion

## getrowsize()

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

size_type Dune::BCRSMatrix< B, A >::getrowsize | ( | size_type | i | ) | const

inline inherited

get current number of indices in row i

## implicit_allocate()

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

void Dune::BCRSMatrix< B, A >::implicit_allocate | ( | size_type | _n,
|  | size_type | _m )

inline protected inherited

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

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

inline inherited

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

## infinity_norm() [1/2]

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

inline inherited

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

## infinity_norm() [2/2]

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

inline inherited

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

## infinity_norm_real() [1/2]

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

inline inherited

simplified infinity norm (uses Manhattan norm for complex values)

## infinity_norm_real() [2/2]

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

inline inherited

simplified infinity norm (uses Manhattan norm for complex values)

## M()

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

size_type Dune::BCRSMatrix< B, A >::M | ( |  | ) | const

inline inherited

number of columns (counted in blocks)

## mmhv()

template<class B, class A = std::allocator<B>>
template<class X, class Y>

void Dune::BCRSMatrix< B, A >::mmhv | ( | const X & | x,
|  | Y & | y ) const

inline inherited

y -= A^H x

## mmtv()

template<class B, class A = std::allocator<B>>
template<class X, class Y>

void Dune::BCRSMatrix< B, A >::mmtv | ( | const X & | x,
|  | Y & | y ) const

inline inherited

y -= A^T x

## mmv()

template<class B, class A = std::allocator<B>>
template<class X, class Y>

void Dune::BCRSMatrix< B, A >::mmv | ( | const X & | x,
|  | Y & | y ) const

inline inherited

y -= A x

## mtv()

template<class B, class A = std::allocator<B>>
template<class X, class Y>

void Dune::BCRSMatrix< B, A >::mtv | ( | const X & | x,
|  | Y & | y ) const

inline inherited

y = A^T x

## mv()

template<class B, class A = std::allocator<B>>
template<class X, class Y>

void Dune::BCRSMatrix< B, A >::mv | ( | const X & | x,
|  | Y & | y ) const

inline inherited

y = A x

## N()

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

size_type Dune::BCRSMatrix< B, A >::N | ( |  | ) | const

inline inherited

number of rows (counted in blocks)

## nonzeroes()

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

size_type Dune::BCRSMatrix< B, A >::nonzeroes | ( |  | ) | const

inline inherited

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

## operator*=()

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

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

inline inherited

vector space multiplication with scalar

## operator+=()

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

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.

## operator-=()

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

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

inline inherited

Subtract the entries of another matrix from this one.

Parameters

  b | The matrix to subtract from this one. Its sparsity pattern has to be subset of the sparsity pattern of this matrix.

## operator/=()

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

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

inline inherited

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

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

inline inherited

random access to the rows

## operator[]() [2/2]

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

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

inline inherited

same for read only access

## setBuildMode()

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

void Dune::BCRSMatrix< B, A >::setBuildMode | ( | BuildMode | bm | ) |

inline inherited

Sets the build mode of the matrix.

Parameters

  bm | The build mode to use.

## setColumnPointers()

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

void Dune::BCRSMatrix< B, A >::setColumnPointers | ( | ConstRowIterator | row | ) |

inline protected inherited

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

void Dune::BCRSMatrix< B, A >::setDataPointers | ( |  | ) |

inline protected inherited

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

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

inline inherited

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

  _avg | expected average number of entries per row
  compressionBufferSize | fraction of _n*_avg which is expected to be needed for elements that exceed _avg entries per row.

## setIndices()

template<class B, class A = std::allocator<B>>
template<typename It>

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

inline inherited

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

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

inline inherited

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

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

void Dune::BCRSMatrix< B, A >::setWindowPointers | ( | ConstRowIterator | row | ) |

inline protected inherited

## 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

  ISTLError | if the matrix is singular

## umhv()

template<class B, class A = std::allocator<B>>
template<class X, class Y>

void Dune::BCRSMatrix< B, A >::umhv | ( | const X & | x,
|  | Y & | y ) const

inline inherited

y += A^H x

## umtv()

template<class B, class A = std::allocator<B>>
template<class X, class Y>

void Dune::BCRSMatrix< B, A >::umtv | ( | const X & | x,
|  | Y & | y ) const

inline inherited

y += A^T x

## umv()

template<class B, class A = std::allocator<B>>
template<class X, class Y>

void Dune::BCRSMatrix< B, A >::umv | ( | const X & | x,
|  | Y & | y ) const

inline inherited

y += A x

## usmhv()

template<class B, class A = std::allocator<B>>
template<class X, class Y>

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

inline inherited

y += alpha A^H x

## usmtv()

template<class B, class A = std::allocator<B>>
template<class X, class Y>

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

inline inherited

y += alpha A^T x

## usmv()

template<class B, class A = std::allocator<B>>
template<class X, class Y, class F>

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

inline inherited

y += alpha A x

## Member Data Documentation

## a

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

B* Dune::BCRSMatrix< B, A >::a

protected inherited

## allocationSize_

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

size_type Dune::BCRSMatrix< B, A >::allocationSize_

protected inherited

## allocator_

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

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

protected inherited

## avg

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

size_type Dune::BCRSMatrix< B, A >::avg

protected inherited

## build_mode

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

BuildMode Dune::BCRSMatrix< B, A >::build_mode

protected inherited

## compressionBufferSize_

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

double Dune::BCRSMatrix< B, A >::compressionBufferSize_

protected inherited

## j_

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

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

protected inherited

## m

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

size_type Dune::BCRSMatrix< B, A >::m

protected inherited

## n

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

size_type Dune::BCRSMatrix< B, A >::n

protected inherited

## nnz_

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

size_type Dune::BCRSMatrix< B, A >::nnz_

mutable protected inherited

## overflow

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

OverflowType Dune::BCRSMatrix< B, A >::overflow

protected inherited

## r

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

row_type* Dune::BCRSMatrix< B, A >::r

protected inherited

## ready

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

BuildStage Dune::BCRSMatrix< B, A >::ready

protected inherited

## rowAllocator_

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

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

protected inherited

## sizeAllocator_

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

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

protected inherited

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

- btdmatrix.hh