BLAS++ 2024.05.31
BLAS C++ API
Loading...
Searching...
No Matches
rotg: Generate Givens plane rotation

Functions

template<typename TA , typename TB >
void blas::rotg (TA *a, TB *b, blas::real_type< TA, TB > *c, blas::real_type< TA, TB > *s)
 Construct plane rotation that eliminates b, such that:
 
template<typename TA , typename TB >
void blas::rotg (std::complex< TA > *a, std::complex< TB > *b, blas::real_type< TA, TB > *c, blas::complex_type< TA, TB > *s)
 Construct plane rotation that eliminates b, such that:
 
void blas::rotg (float *a, float *b, float *c, float *s)
 
void blas::rotg (double *a, double *b, double *c, double *s)
 
void blas::rotg (std::complex< float > *a, std::complex< float > *b, float *c, std::complex< float > *s)
 
void blas::rotg (std::complex< double > *a, std::complex< double > *b, double *c, std::complex< double > *s)
 

Detailed Description

Function Documentation

◆ rotg() [1/2]

template<typename TA , typename TB >
void blas::rotg ( std::complex< TA > *  a,
std::complex< TB > *  b,
blas::real_type< TA, TB > *  c,
blas::complex_type< TA, TB > *  s 
)

Construct plane rotation that eliminates b, such that:

\[ \begin{bmatrix} r \\ 0 \end{bmatrix} = \begin{bmatrix} c & s \\ -conjg(s) & c \end{bmatrix} \begin{bmatrix} a \\ b \end{bmatrix}. \]

See also
rot to apply the rotation.

Generic implementation for arbitrary data types.

Parameters
[in,out]aOn entry, scalar a. On exit, set to r.
[in,out]bOn entry, scalar b. On exit, set to s, 1/c, or 0.
[out]cCosine of rotation; real.
[out]sSine of rotation; complex.

Further details

Anderson E (2017) Algorithm 978: Safe scaling in the level 1 BLAS. ACM Trans Math Softw 44:. https://doi.org/10.1145/3061665

◆ rotg() [2/2]

template<typename TA , typename TB >
void blas::rotg ( TA *  a,
TB *  b,
blas::real_type< TA, TB > *  c,
blas::real_type< TA, TB > *  s 
)

Construct plane rotation that eliminates b, such that:

\[ \begin{bmatrix} r \\ 0 \end{bmatrix} = \begin{bmatrix} c & s \\ -s & c \end{bmatrix} \begin{bmatrix} a \\ b \end{bmatrix}. \]

See also
rot to apply the rotation.

Generic implementation for arbitrary data types.

Parameters
[in,out]aOn entry, scalar a. On exit, set to r.
[in,out]bOn entry, scalar b. On exit, set to s, 1/c, or 0.
[out]cCosine of rotation; real.
[out]sSine of rotation; real.

Further details

Anderson E (2017) Algorithm 978: Safe scaling in the level 1 BLAS. ACM Trans Math Softw 44:. https://doi.org/10.1145/3061665