?rotm
Perform conversion based on the modified Givens.


x and y are vectors containing n elements, and h is a transformation matrix element.
Interface Definition
C interface:
void cblas_srotm(const BLASINT N, float *X, const BLASINT incX, float *Y, const BLASINT incY, const float *P);
void cblas_drotm(const BLASINT N, double *X, const BLASINT incX, double *Y, const BLASINT incY, const double *P);
Fortran interface:
CALL SROTM(N, SX, INCX, SY, INCY, DTEMP)
CALL DROTM(N, SX, INCX, SY, INCY, DTEMP)
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
N |
Integer |
Number of elements in the X vector |
Input |
X |
|
Vector X. The vector size is at least (1+(n-1)*abs(incx)). |
Input/Output |
incX |
Integer |
Increment for the elements of vector x |
Input |
Y |
|
Vector Y. The vector scale is at least (1+(n-1)*abs(incy)). |
Input/Output |
incY |
Integer |
Increment for elements in vector Y |
Input |
P |
|
Conversion matrix H |
Input |
Dependencies
#include "kblas.h"
Examples
C interface:
double d1 = 10.0, d2 = 2.0;
double x1 = 2.0, x2 = 1.0;
double p[5];
int n = 5, incx = 1, incy = 1;
double x[5]={1.0, 2.0, 1.0, 3.0, 1.0};
double y[5]={3.0, 1.0, 1.0, 5.0, 1.0};
cblas_drotmg(&d1, &d2, &x1, x2, p);
cblas_drotm(n, x, incx, y, incy, p);
/*
* Output x: 1.300000, 2.100000, 1.100000, 3.500000, 1.100000
* Output y: 2.500000, 0.000000, 0.500000, 3.500000, 0.500000
*/
Fortran interface:
REAL(8) :: D1=10.0
REAL(8) :: D2=2.0
REAL(8) :: X1=2.0
REAL(8) :: X2=1.0
REAL(8) :: P(5)
INTEGER :: N=5
INTEGER :: INCX=1
INTEGER :: INCY=1
REAL(8) :: X(5)
DATA X/1.0, 2.0, 1.0, 3.0, 1.0/
REAL(8) :: Y(5)
DATA Y/3.0, 1.0, 1.0, 5.0, 1.0/
EXTERNAL DROTMG
CALL DROTMG(D1, D2, X1, X2, P)
EXTERNAL DROTM
CALL DROTM(N, X, INCX, Y, INCY, P)
* Output X: 1.300000, 2.100000, 1.100000, 3.500000, 1.100000
* Output Y: 2.500000, 0.000000, 0.500000, 3.500000, 0.500000