?lasr
对矩阵A做平面旋转操作。
接口定义
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);
参数
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
SIDE |
字符型 |
|
输入 |
PIVOT |
字符型 |
|
输入 |
DIRECT |
字符型 |
|
输入 |
M |
整数型 |
矩阵A的行数。 |
输入 |
N |
整数型 |
矩阵A的列数。 |
输入 |
C |
|
平面旋转的cosine值。 |
输入 |
S |
|
平面旋转的sine值。 |
输入 |
A |
|
矩阵A,维度为(LDA,N)。 |
输入,输出 |
LDA |
整数型 |
矩阵A的主维。 |
输入 |
依赖
#include "klapack.h"
示例
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