?lasr
Perform a plane rotation operation on matrix A.
Interface Definition
C interface:
void slasr_(const char *SIDE, const char *PIVOT, const char *DIRECT, const int *M, const int *N, float *C, float *S, float *A, const int *LDA);
void dlasr_(const char *SIDE, const char *PIVOT, const char *DIRECT, const int *M, const int *N, double *C, double *S, double *A, const int *LDA);
void clasr_(const char *SIDE, const char *PIVOT, const char *DIRECT, const int *M, const int *N, float *C, float *S, float _Complex *A, const int *LDA);
void zlasr_(const char *SIDE, const char *PIVOT, const char *DIRECT, const int *M, const int *N, double *C, double *S, double _Complex *A, const int *LDA);
Fortran interface:
SLASR(SIDE, PIVOT, DIRECT, M, N, C, S, A, LDA);
DLASR(SIDE, PIVOT, DIRECT, M, N, C, S, A, LDA);
CLASR(SIDE, PIVOT, DIRECT, M, N, C, S, A, LDA);
ZLASR(SIDE, PIVOT, DIRECT, M, N, C, S, A, LDA);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
SIDE |
Character |
|
Input |
PIVOT |
Character |
|
Input |
DIRECT |
Character |
|
Input |
M |
Integer |
Number of rows in matrix A |
Input |
N |
Integer |
Number of columns in matrix A |
Input |
C |
|
Cosine value of plane rotation. |
Input |
S |
|
Sine value of plane rotation. |
Input |
A |
|
Matrix A, with a dimension of (LDA, N). |
Input/output |
LDA |
Integer |
Leading dimension of matrix A. |
Input |
Dependencies
#include "klapack.h"
Examples
C interface:
const char side = 'L';
const char pivot = 'V';
const char direct = 'F';
int m = 4;
int n = 4;
int lda = m;
double c[] = {0.000000, 0.900000, 1.100000};
double s[] = {0.181818, 0.545455, 0.000000};
double a[] = {0.600000,0.200000,0.900000,0.100000,
0.200000,0.700000,0.000000,0.900000,
0.300000,0.600000,0.000000,0.600000,
0.200000,0.600000,0.100000,0.800000};
dlasr_(&side, &pivot, &direct, &m, &n, c, s, a, &lda);
/*
* Output:
* a output (stored in column-major)
* 0.036364 0.392727 0.956455 0.110000
* 0.127273 -0.032727 0.021818 0.990000
* 0.109091 -0.049091 0.032727 0.660000
* 0.109091 0.021818 0.120818 0.880000
Fortran interface:
CHARACTER :: side = "L" CHARACTER :: pivot = "V" CHARACTER :: direct = "F" PARAMETER (m = 4) PARAMETER (n = 4) PARAMETER (lda = 4) REAL(8) :: c(m-1) REAL(8) :: s(m-1) REAL(8) :: a(lda, n) DATA c / 0.000000, 0.900000, 1.100000 / DATA s / 0.181818, 0.545455, 0.000000 / DATA a / 0.600000,0.200000,0.900000,0.100000, $ 0.200000,0.700000,0.000000,0.900000, $ 0.300000,0.600000,0.000000,0.600000, $ 0.200000,0.600000,0.100000,0.800000 / EXTERNAL DLASR CALL DLASR(side, pivot, direct, m, n, c, s, a, lda); * * Output: * a output (stored in column-major) * 0.036364 0.392727 0.956455 0.110000 * 0.127273 -0.032727 0.021818 0.990000 * 0.109091 -0.049091 0.032727 0.660000 * 0.109091 0.021818 0.120818 0.880000