|
| TridiagInvD () |
| Allocate nothing, Call construct method before usage. More...
|
|
| TridiagInvD (const ContainerType ©able) |
| Construct from vector. More...
|
|
| TridiagInvD (unsigned size) |
| Construct from size of vector. More...
|
|
void | resize (unsigned new_size) |
| Resize inverse tridiagonal matrix and helper vectors. More...
|
|
void | operator() (const DiaMatrix &T, CooMatrix &Tinv) |
| Compute the inverse of a tridiagonal matrix T. More...
|
|
CooMatrix | operator() (const DiaMatrix &T) |
| Compute the inverse of a tridiagonal matrix T. More...
|
|
template<class ContainerType0 , class ContainerType1 , class ContainerType2 > |
void | operator() (const ContainerType0 &a, const ContainerType1 &b, const ContainerType2 &c, CooMatrix &Tinv) |
| Compute the inverse of a tridiagonal matrix with diagonal vectors a,b,c. More...
|
|
template<class ContainerType, class DiaMatrix, class CooMatrix>
class dg::mat::TridiagInvD< ContainerType, DiaMatrix, CooMatrix >
Compute the inverse of a general tridiagonal matrix.
- Attention
- If roughly the matrix size m>150 the algorithm is unstable. However, it performs extremely fast if it stays below this value. This is the algorihm of "Inversion of a Tridiagonal Jacobi Matrix" by Riaz A. Usmani
- Template Parameters
-
ContainerType | thrust::host_vector<value_type> or similar shared memory host vector |
CooMatrix | cusp::coo_matrix<int, value_type, cusp::host_memory> ; |
DiaMatrix | cusp::dia_matrix<int, value_type, cusp::host_memory> ; |
template<class ContainerType , class DiaMatrix , class CooMatrix >
template<class ContainerType0 , class ContainerType1 , class ContainerType2 >
void dg::mat::TridiagInvD< ContainerType, DiaMatrix, CooMatrix >::operator() |
( |
const ContainerType0 & |
a, |
|
|
const ContainerType1 & |
b, |
|
|
const ContainerType2 & |
c, |
|
|
CooMatrix & |
Tinv |
|
) |
| |
|
inline |
Compute the inverse of a tridiagonal matrix with diagonal vectors a,b,c.
The diagonal vectors are given as in the cusp dia_matrix format
- Parameters
-
a | "0" diagonal vector (index 0 is on row 0) |
b | "+1" diagonal vector (index 0 is on row 0, last index outside) |
c | "-1" diagonal vector (index 0 is on row 0, outside of matrix) |
Tinv | the inverse of the tridiagonal matrix (coordinate format) gets resized if necessary |