BLAS++ 2024.05.31
BLAS C++ API
Loading...
Searching...
No Matches
rot: Apply Givens plane rotation

Functions

template<typename TX , typename TY >
void blas::rot (int64_t n, TX *x, int64_t incx, TY *y, int64_t incy, blas::real_type< TX, TY > c, blas::scalar_type< TX, TY > s)
 Apply plane rotation:
 
void blas::rot (int64_t n, float *x, int64_t incx, float *y, int64_t incy, float c, float s)
 
void blas::rot (int64_t n, double *x, int64_t incx, double *y, int64_t incy, double c, double s)
 
void blas::rot (int64_t n, std::complex< float > *x, int64_t incx, std::complex< float > *y, int64_t incy, float c, float s)
 real cosine, real sine Applies a real Givens rotation (e.g., in real tridiagonal eig) to a complex matrix (e.g., complex eigenvectors).
 
void blas::rot (int64_t n, std::complex< double > *x, int64_t incx, std::complex< double > *y, int64_t incy, double c, double s)
 real cosine, real sine Applies a real Givens rotation (e.g., in real tridiagonal eig) to a complex matrix (e.g., complex eigenvectors).
 
void blas::rot (int64_t n, std::complex< float > *x, int64_t incx, std::complex< float > *y, int64_t incy, float c, std::complex< float > s)
 real cosine, complex sine Applies a complex Givens rotation to a complex matrix (e.g., in complex GMRES).
 
void blas::rot (int64_t n, std::complex< double > *x, int64_t incx, std::complex< double > *y, int64_t incy, double c, std::complex< double > s)
 real cosine, complex sine Applies a complex Givens rotation to a complex matrix (e.g., in complex GMRES).
 

Detailed Description

Function Documentation

◆ rot() [1/5]

void blas::rot ( int64_t  n,
std::complex< double > *  x,
int64_t  incx,
std::complex< double > *  y,
int64_t  incy,
double  c,
double  s 
)

real cosine, real sine Applies a real Givens rotation (e.g., in real tridiagonal eig) to a complex matrix (e.g., complex eigenvectors).

real cosine, real sine

◆ rot() [2/5]

void blas::rot ( int64_t  n,
std::complex< double > *  x,
int64_t  incx,
std::complex< double > *  y,
int64_t  incy,
double  c,
std::complex< double >  s 
)

real cosine, complex sine Applies a complex Givens rotation to a complex matrix (e.g., in complex GMRES).

real cosine, complex sine

◆ rot() [3/5]

void blas::rot ( int64_t  n,
std::complex< float > *  x,
int64_t  incx,
std::complex< float > *  y,
int64_t  incy,
float  c,
float  s 
)

real cosine, real sine Applies a real Givens rotation (e.g., in real tridiagonal eig) to a complex matrix (e.g., complex eigenvectors).

real cosine, real sine This variant, with real sine, is used in the SVD or EVD where a real Givens rotation, that eliminates entries in the real bi- or tridiagonal matrix, is applied to complex singular or eigen vectors.

◆ rot() [4/5]

void blas::rot ( int64_t  n,
std::complex< float > *  x,
int64_t  incx,
std::complex< float > *  y,
int64_t  incy,
float  c,
std::complex< float >  s 
)

real cosine, complex sine Applies a complex Givens rotation to a complex matrix (e.g., in complex GMRES).

real cosine, complex sine This variant, with complex sine, is used to eliminate entries in a complex matrix.

◆ rot() [5/5]

template<typename TX , typename TY >
void blas::rot ( int64_t  n,
TX *  x,
int64_t  incx,
TY *  y,
int64_t  incy,
blas::real_type< TX, TY >  c,
blas::scalar_type< TX, TY >  s 
)

Apply plane rotation:

\[ \begin{bmatrix} x^T \\ y^T \end{bmatrix} = \begin{bmatrix} c & s \\ -s & c \end{bmatrix} \begin{bmatrix} x^T \\ y^T \end{bmatrix}. \]

See also
rotg to generate the rotation.

Generic implementation for arbitrary data types.

Parameters
[in]nNumber of elements in x and y. n >= 0.
[in,out]xThe n-element vector x, in an array of length (n-1)*abs(incx) + 1.
[in]incxStride between elements of x. incx must not be zero. If incx < 0, uses elements of x in reverse order: x(n-1), ..., x(0).
[in,out]yThe n-element vector y, in an array of length (n-1)*abs(incy) + 1.
[in]incyStride between elements of y. incy must not be zero. If incy < 0, uses elements of y in reverse order: y(n-1), ..., y(0).
[in]cCosine of rotation; real.
[in]sSine of rotation; complex.