Rate This Document
Findability
Accuracy
Completeness
Readability

?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

  • When SIDE = 'L', A := P*A.
  • When SIDE = 'R', A := A*PT

Input

PIVOT

Character

  • = 'V': Variable pivot. The rotation is performed for the plane (k, k+1).
  • = 'T': Top pivot. The rotation is performed for the plane (1, k+1).
  • = 'B': Bottom pivot. The rotation is performed for the plane (k, z).

Input

DIRECT

Character

  • = 'F': forward, P = P(z-1)*...*P(2)*P(1)
  • = 'B': backward, P = P(1)*P(2)*...*P(z-1)

Input

M

Integer

Number of rows in matrix A

Input

N

Integer

Number of columns in matrix A

Input

C

  • For slasr/clasr, C is a single-precision floating-point array.
  • For dlasr/zlasr, C is a double-precision floating-point array.

Cosine value of plane rotation.

Input

S

  • For slasr/clasr, S is a single-precision floating-point array.
  • For dlasr/zlasr, S is a double-precision floating-point array.

Sine value of plane rotation.

Input

A

  • For slasr, A is a single-precision floating-point array.
  • For dlasr, A is a double-precision floating-point array.
  • For clasr, A is a single-precision complex number array.
  • For zlasr, A is a double-precision complex number array.

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