KokkosBatched::Rot ################## Defined in header: :code:`KokkosBatched_Rot.hpp` .. code:: c++ template struct SerialRot { template KOKKOS_INLINE_FUNCTION static int invoke(const XViewType &x, const YViewType &y, const CType c, const SType s); }; template struct TeamAxpy { template KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const XViewType &x, const YViewType &y, const CType c, const SType s); }; template struct TeamVectorRot { template KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const XViewType &x, const YViewType &y, const CType c, const SType s); }; Applies a plane rotation to vectors :math:`x` and :math:`y`: .. math:: \begin{align} x &= c * x + s * y \\ y &= -s * x + c * y \: \text{(if Conj is false)} \\ y &= -s * conj(x) + c * y \: \text{(if Conj is true)} \end{align} 1. For real vectors :math:`X` and :math:`Y`, this operation is equivalent to the BLAS routine ``SROT`` or ``DROT`` for single or double precision. 2. For complex vectors :math:`X` and :math:`Y`, this operation is equivalent to the BLAS routine ``CSROT`` or ``ZDROT`` for single or double precision if ``Conj`` is false. If ``Conj`` is true, this operation is equivalent to the BLAS routine ``CROT`` or ``ZROT`` for single or double precision. Parameters ========== :x: On input, :math:`x` is a length :math:`n` vector. On output, :math:`x` is overwritten by the rotated vector. :y: On input, :math:`y` is a length :math:`n` vector. On output, :math:`y` is overwritten by the rotated vector. :c: A scalar of cosine of the rotation (real scalar) :s: A scalar of sine of the rotation (real or complex scalar) Type Requirements ----------------- - ``Conj`` must be a boolean template parameter that indicates whether the rotation is a conjugate rotation or not. - ``MemberType`` must be a Kokkos team member handle (only for ``TeamRot`` and ``TeamVectorRot``). - ``XViewType`` must be a Kokkos `View `_ of rank 1 containing a vector :math:`X` that satisfies ``std::is_same_v`` - ``YViewType`` must be a Kokkos `View `_ of rank 1 containing a vector :math:`Y` that satisfies ``std::is_same_v`` - ``CType`` must be a built-in real type like ``float``, or ``double`` - ``SType`` must be a built-in arithmetic type like ``float``, ``double``, ``Kokkos::complex``, or ``Kokkos::complex`` Example ======= .. literalinclude:: ../../../../../example/batched_solve/serial_rot.cpp :language: c++ :linenos: :lines: 4- output: .. code:: rot/rotg works correctly!