|
| TridiagInvDF () |
| Allocate nothing, Call construct method before usage. More...
|
|
| TridiagInvDF (const ContainerType ©able) |
| Construct from vector. More...
|
|
| TridiagInvDF (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::TridiagInvDF< ContainerType, DiaMatrix, CooMatrix >
USE THIS ONE Compute the inverse of a general tridiagonal matrix. The algorithm does not rely on the determinant.
- Note
- For some special cases division by zero occurs (can be fixed if necessary cf. 2nd paper) This is the algorihm of "On the inverses of general tridiagonal matrices" by Hou-Biao Li, Ting-Zhu Huang, Xing-Ping Liu, Hong Li Appears to be the same as the algorithm in "ON AN INVERSE FORMULA OF A TRIDIAGONAL MATRIX" by Tomoyuki Sugimoto
- 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::TridiagInvDF< 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 |