|
| 1 | +KokkosBatched::Gbtrs |
| 2 | +#################### |
| 3 | + |
| 4 | +Defined in header: :code:`KokkosBatched_Gbtrs.hpp` |
| 5 | + |
| 6 | +.. code:: c++ |
| 7 | + |
| 8 | + template <typename ArgTrans, typename ArgAlgo> |
| 9 | + struct SerialGbtrs { |
| 10 | + template <typename AViewType, typename PivViewType, typename BViewType> |
| 11 | + KOKKOS_INLINE_FUNCTION static int invoke(const AViewType &A, const PivViewType &piv, const BViewType &b, const int kl, |
| 12 | + const int ku); |
| 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` with a general n-by-n band matrix :math:`A` using :math:`LU` factorization computed by ``Gbtrf``. |
| 16 | +This operation is equivalent to the LAPACK routine ``SGBTRS`` (``CGBTRS``) or ``DGBTRS`` (``ZGBTRS``) for single or double precision for real (complex) matrix. |
| 17 | + |
| 18 | +Parameters |
| 19 | +========== |
| 20 | + |
| 21 | +:A: Input view containing the factors :math:`L` and :math:`U` from the factorization :math:`A = P \cdot L \cdot U` of the band matrix :math:`A` computed by ``Gbtrf``. See `LAPACK reference <https://www.netlib.org/lapack/lug/node124.html>`_ for the band storage format. |
| 22 | +:piv: The pivot indices computed by ``Gbtrf``. |
| 23 | +:B: Input/output view containing the right-hand side on input and the solution on output. |
| 24 | +:kl: The number of subdiagonals within the band of :math:`A`. kl >= 0 |
| 25 | +:ku: The number of superdiagonals within the band of :math:`A`. ku >= 0 |
| 26 | + |
| 27 | +Type Requirements |
| 28 | +----------------- |
| 29 | + |
| 30 | +- ``ArgTrans`` must be one of the following: |
| 31 | + - ``KokkosBatched::Trans::NoTranspose`` to solve a system :math:`A \cdot X = B` |
| 32 | + - ``KokkosBatched::Trans::Transpose`` to solve a system :math:`A^T \cdot X = B` |
| 33 | + - ``KokkosBatched::Trans::ConjTranspose`` to solve a system :math:`A^H \cdot X = B` |
| 34 | +- ``ArgAlgo`` must be ``KokkosBatched::Algo::Gbtrs::Unblocked`` for the unblocked algorithm |
| 35 | +- ``AViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 2 containing the general band matrix :math:`A` |
| 36 | +- ``PivViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 1 containing the pivot indices |
| 37 | +- ``BViewType`` 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 |
| 38 | + - ``std::is_same_v<typename BViewType::value_type, typename BViewType::non_const_value_type> == true`` |
| 39 | + |
| 40 | +Example |
| 41 | +======= |
| 42 | + |
| 43 | +.. literalinclude:: ../../../../../example/batched_solve/serial_gbtrs.cpp |
| 44 | + :language: c++ |
| 45 | + |
| 46 | +output: |
| 47 | + |
| 48 | +.. code:: |
| 49 | +
|
| 50 | + gbtrf/gbtrs works correctly! |
0 commit comments