|
Discontinuous Galerkin Library
#include "dg/algorithm.h"
|
Fast (shared memory) tridiagonal sparse matrix. More...
Public Types | |
| using | value_type = dg::get_value_type<Container> |
Public Member Functions | |
| TriDiagonal ()=default | |
| TriDiagonal (unsigned size) | |
| Allocate size elements for M, O and P. | |
| TriDiagonal (Container M, Container O, Container P) | |
| Directly construct from M, O and P. | |
| template<class Container2 > | |
| TriDiagonal (const TriDiagonal< Container2 > &other) | |
| Assign M, O, and P from other matrix. | |
| unsigned | size () const |
| void | resize (unsigned size) |
| Resize M, O, and P to given size. | |
| void | operator() (const Container &x, Container &y) const |
| Compute Matrix-vector product \(y = Tx\). | |
| dg::IHMatrix_t< value_type > | asIMatrix () const |
| convert to a sparse matrix format | |
Public Attributes | |
| Container | M |
Subdiagonal ["Minus" -1] M[0] is ignored M[1] maps to T_10 | |
| Container | O |
Diagonal ["zerO" 0] O[0] maps to T_00 | |
| Container | P |
Uper diagonal ["Plus" +1] P[0] maps to T_01 | |
Fast (shared memory) tridiagonal sparse matrix.
Consists of the three diagonal vectors [M, O, P] (for "Minus" -1, "ZerO" 0, "Plus +1), i.e. M is the subdiagonal, O the diagonal and P the superdiagonal vector. \( M_0 \) and \( P_{N-1}\) are ignored
\[ T = \begin{pmatrix} O_0 & P_0 & & & & \\ M_1 & O_1 & P_1 & & & \\ & M_2 & O_2 & P_2 & & \\ & & M_3 & O_3 & P_3 & \\ & & &...& & \end{pmatrix}\]
| Container | One of the shared memory containers |
| using dg::TriDiagonal< Container >::value_type = dg::get_value_type<Container> |
|
default |
|
inline |
Allocate size elements for M, O and P.
|
inline |
Directly construct from M, O and P.
| M | Subdiagonal |
| O | Diagonal |
| P | Superdiagonal |
|
inline |
Assign M, O, and P from other matrix.
| Container2 |
| other |
|
inline |
convert to a sparse matrix format
|
inline |
Compute Matrix-vector product \(y = Tx\).
dg::blas2::parallel_for (which only works on shared memory vectors) | x | input |
| y | result |
|
inline |
Resize M, O, and P to given size.
| size | New size |
|
inline |
| Container dg::TriDiagonal< Container >::M |
Subdiagonal ["Minus" -1] M[0] is ignored M[1] maps to T_10
| Container dg::TriDiagonal< Container >::O |
Diagonal ["zerO" 0] O[0] maps to T_00
| Container dg::TriDiagonal< Container >::P |
Uper diagonal ["Plus" +1] P[0] maps to T_01