|
| 1 | +KokkosBatched::Tbsv |
| 2 | +################### |
| 3 | + |
| 4 | +Defined in header: :code:`KokkosBatched_Tbsv.hpp` |
| 5 | + |
| 6 | +.. code:: c++ |
| 7 | + |
| 8 | + template <typename ArgUplo, typename ArgTrans, typename ArgDiag, typename ArgAlgo> |
| 9 | + struct SerialTbsv { |
| 10 | + template <typename AViewType, typename XViewType> |
| 11 | + KOKKOS_INLINE_FUNCTION static int invoke(const AViewType &A, const XViewType &X, const int k); |
| 12 | + }; |
| 13 | + |
| 14 | + |
| 15 | +Solves a system of the linear equations :math:`A \cdot X = B` or :math:`A^T \cdot X = B` or :math:`A^H \cdot X = B` where :math:`A` is an n-by-n unit or non-unit, upper or lower triangular band matrix with :math:`(k + 1)` diagonals. |
| 16 | + |
| 17 | +1. For a real band matrix :math:`A`, this solves a system of the linear equations :math:`A \cdot X = B` or :math:`A^T \cdot X = B`. |
| 18 | + This operation is equivalent to the BLAS routine ``STBSV`` or ``DTBSV`` for single or double precision. |
| 19 | + |
| 20 | +2. For a complex band matrix :math:`A`, this solves a system of the linear equations :math:`A \cdot X = B` or :math:`A^T \cdot X = B` or :math:`A^H \cdot X = B`. |
| 21 | + This operation is equivalent to the BLAS routine ``CTBSV`` or ``ZTBSV`` for single or double precision. |
| 22 | + |
| 23 | +.. note:: |
| 24 | + |
| 25 | + No test for singularity or near-singularity is included in this routine. Such tests must be performed before calling this routine. |
| 26 | + |
| 27 | +Parameters |
| 28 | +========== |
| 29 | + |
| 30 | +:A: Input view containing the upper or lower triangular band matrix. See `LAPACK reference <https://www.netlib.org/lapack/lug/node124.html>`_ for the band storage format. |
| 31 | +:X: Input/output view containing the right-hand side on input and the solution on output. |
| 32 | +:k: The number of superdiagonals or subdiagonals within the band of :math:`A`. :math:`k >= 0` |
| 33 | + |
| 34 | + |
| 35 | +Type Requirements |
| 36 | +----------------- |
| 37 | + |
| 38 | +- ``ArgUplo`` must be one of the following: |
| 39 | + - ``KokkosBatched::Uplo::Upper`` for upper triangular solve |
| 40 | + - ``KokkosBatched::Uplo::Lower`` for lower triangular solve |
| 41 | + |
| 42 | +- ``ArgTrans`` must be one of the following: |
| 43 | + - ``KokkosBatched::Trans::NoTranspose`` to solve a system :math:`A \cdot X = B` |
| 44 | + - ``KokkosBatched::Trans::Transpose`` to solve a system :math:`A^T \cdot X = B` |
| 45 | + - ``KokkosBatched::Trans::ConjTranspose`` to solve a system :math:`A^H \cdot X = B` |
| 46 | + |
| 47 | +- ``ArgDiag`` must be one of the following: |
| 48 | + - ``KokkosBatched::Diag::Unit`` for the unit triangular matrix :math:`A` |
| 49 | + - ``KokkosBatched::Diag::NonUnit`` for the non-unit triangular matrix :math:`A` |
| 50 | + |
| 51 | +- ``ArgAlgo`` must be ``KokkosBatched::Algo::tbsv::Unblocked`` for the unblocked algorithm |
| 52 | +- ``AViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 2 containing the band matrix A |
| 53 | +- ``XViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 1 containing the right-hand side that satisfies |
| 54 | + - ``std::is_same_v<typename XViewType::value_type, typename XViewType::non_const_value_type> == true`` |
| 55 | + |
| 56 | +Example |
| 57 | +======= |
| 58 | + |
| 59 | +.. literalinclude:: ../../../../../example/batched_solve/serial_tbsv.cpp |
| 60 | + :language: c++ |
| 61 | + |
| 62 | +output: |
| 63 | + |
| 64 | +.. code:: |
| 65 | +
|
| 66 | + tbsv works correctly! |
0 commit comments