Content |
BLAS Level 1: rotg, rot
rotg, rot are defined in namespace flens::blas.
-
rotg computes parameters for a Givens rotation. For given scalars \(a\) and \(b\) the routine computes \(c\) and \(s\) that define a unitary matrix such that
\[ \begin{pmatrix} c & s \\ -s & c \end{pmatrix} \begin{pmatrix} a \\ b \end{pmatrix} = \begin{pmatrix} r \\ 0 \end{pmatrix} \quad\text{with}\;r := \sqrt{|a|^2 + |b|^2}. \]The routine further computes the value \(z\) defined as follows:
\[ z = \begin{cases} s & \text{if}\; |a| > |b|, \\ 1/c & \text{if}\; |a| \leq |b| \;\text{and}\; c \neq 0, \\ 1 & \text{else}. \end{cases} \] -
rot applies the Given rotation. Given two vectors \(x\) and \(y\), each vector element of these vectors is replaced as follows:
\[ \begin{eqnarray*} x_i &\leftarrow& c x_i + s y_i \\ y_i &\leftarrow& -s x_i + c y_i \end{eqnarray*} \]i.e.
\[ \begin{pmatrix} x^T \\ y^T \end{pmatrix} \leftarrow \begin{pmatrix} c & s \\ -s & c \end{pmatrix} \begin{pmatrix} x^T \\ y^T \end{pmatrix} \]
rotg
a |
(input/output) real scalar |
b |
(input/output) real scalar |
c |
(output) real scalar |
s |
(output) real scalar |
a |
(input/output) complex scalar On entry, the \(x\)-coordinate of the point \(p = (a,b)^T\) subject to being rotated. |
b |
(input/output) complex scalar |
c |
(output) real scalar |
s |
(output) complex scalar |
rot
x |
(input/output) real or complex DenseVector |
y |
(input/output) real or complex DenseVector |
c |
(input) real or complex scalar |
s |
(input) real or complex scalar |