Skip to content

num::givens_rotation

Defined in header <container/small_matrix.hpp>

struct givens_rotation;

Givens rotation \(G = \begin{bmatrix} c & s \\ -s & c \end{bmatrix}\).

Members

member description
real c = 1
real s = 0
static constexpr givens_rotation from(real a, real b) noexcept Construct the Givens rotation that zeroes \(b\): \(G (a, b)^T = (r, 0)^T\).
constexpr void apply(real &x, real &y) const noexcept Rotate a pair: \((x, y) \leftarrow G (x, y)\).
constexpr void apply_t(real &x, real &y) const noexcept Rotate a pair by the transpose: \((x, y) \leftarrow G^T (x, y)\).
constexpr small_matrix<2, 2> matrix() const noexcept Return the rotation as a \(2 \times 2\) matrix.