A structure for solving a set of independant tridiagonal systems using a direct method. More...
Public Member Functions | |
MatrixBatchTridiag (const int batch_size, const int mat_size, DKokkosView2D const aa, DKokkosView2D const bb, DKokkosView2D const cc) | |
Creates an instance of the MatrixBatchTridiag class. | |
bool | check_stability () const |
Check if the matrices are in the stability area of the solver. | |
void | setup_solver () final |
Perform a pre-process operation on the solver. | |
void | solve (BatchedRHS const b) const final |
Solve the batched linear problem Ax=b. | |
Public Member Functions inherited from MatrixBatch< ExecSpace > | |
virtual | ~MatrixBatch ()=default |
Destruct. | |
std::size_t | size () const |
Get the size of the square matrix corresponding to a single batch in one of its dimensions. | |
std::size_t | batch_size () const |
Get the batch size of the linear problem. | |
Additional Inherited Members | |
Public Types inherited from MatrixBatch< ExecSpace > | |
using | BatchedRHS = Kokkos::View< double **, Kokkos::LayoutRight, ExecSpace > |
The type of a Kokkos::View storing batched right-hand sides. Second dimenion is batch dimension. | |
Protected Member Functions inherited from MatrixBatch< ExecSpace > | |
MatrixBatch (const std::size_t batch_size, const std::size_t mat_size) | |
The constructor for MatrixBatch class. | |
A structure for solving a set of independant tridiagonal systems using a direct method.
The parallelism operates on the whole collection by dispatching to threads. Each problem is treated sequentially, by the tridiagonal matrix algorithm (TDMA). This solver is stable for tridiagonal matrices which satisfy one of the following conditions:
ExecSpace | The execution space related to Kokkos. |
|
inlineexplicit |
Creates an instance of the MatrixBatchTridiag class.
First dimension is the batch, second one refers to matrix entries indexed by line. The entries aa,bb,cc are 2D Kokkos views and have the same dimensions. LayoutRight: means that the "last" dimension is the contiguous one. aa(batch_idx,0) and cc(batch_idx,mat_size-1) are not used for any values of batch_idx.
[in] | batch_size | The size of the set of linear problems. |
[in] | mat_size | The common size of each individual matrix . |
[in] | aa | 2d Kokkos View which stores subdiagonal components for all matrices. |
[in] | bb | 2d Kokkos View which stores diagonal components for all matrices. |
[in] | cc | 2d Kokkos View which stores upper diagonal components for all matrices. |
|
inline |
Check if the matrices are in the stability area of the solver.
It checks if each matrix of the batch has one of the following structures:
|
inlinefinalvirtual |
Perform a pre-process operation on the solver.
Must be called after filling the matrix.
It calls check_stability function to verify if the matrices data is in range of validity of the solver.
The stopping criterion is a reduction factor ||Ax-b||/||b||<tol with max_iter maximum iterations.
Implements MatrixBatch< ExecSpace >.
|
inlinefinalvirtual |
Solve the batched linear problem Ax=b.
[in,out] | b | A 2D Kokkos::View storing the batched right-hand sides of the problem and receiving the corresponding solutions. |
Implements MatrixBatch< ExecSpace >.