DROT(3) BLAS routine of NEC Numeric Library Collection DROT(3)
NAME
DROT - BLAS level one, plane rotation subroutines
SYNOPSIS
SUBROUTINE DROT ( n, x, incx, y, incy, c, s )
INTEGER n, incx, incy
DOUBLE PRECISION x, y, c, s
DESCRIPTION
DROT applies a plane rotation matrix to a real sequence of ordered
pairs:
(x , y ), for all i = 1, 2, ..., n.
i i
ARGUMENTS
n INTEGER. (input)
Number of ordered pairs (planar points in DROT) to be rotated.
If n <= 0, this routine returns without computation.
x DOUBLE PRECISION, (input and output)
Array of dimension (n-1) * |incx| + 1. On input, array x con-
tains the x-coordinate of each planar point to be rotated. On
output, array x contains the x-coordinate of each rotated pla-
nar point.
incx INTEGER. (input)
Increment between elements of x. If incx = 0, the results will
be unpredictable.
y DOUBLE PRECISION, (input and output)
array of dimension (n-1) * |incy| + 1.
On input, array y contains the y-coordinate of each planar
point to be rotated. On output, array y contains the y-coordi-
nate of each rotated planar point.
incy INTEGER. (input)
Increment between elements of y. If incy = 0, the results will
be unpredictable.
c DOUBLE PRECISION, Cosine of the angle of rotation.
(input)
s DOUBLE PRECISION, Sine of the angle of rotation. (input)
NOTES
This routine is Level 1 Basic Linear Algebra Subprograms (Level 1
BLAS). It applies the following plane rotation to each pair of elements
(x , y ):
i i
_ _ _ _ _ _
| x(i) | <-- | c s | . | x(i) |
| y(i) | |-s c | | y(i) |
- - - - - -
for i = 1,...,n
2 2
If coefficients c and s satisfy c + s = 1.0, the rotation matrix
is orthogonal, and the transformation is called a Givens plane
rotation. If c = 1 and s = 0, DROT returns without modifying any
input parameters.
To calculate the Givens coefficients c and s from a two-element
vector to determine the angle of rotation, use SROTG(3S).
When working backward (incx < 0 or incy < 0), each routine starts
at the end of the vector and moves backward, as follows:
x(1-incx * (n-1)), x(1-incx * (n-2)), ..., x(1)
y(1-incy * (n-1)), y(1-incy * (n-2)), ..., y(1)
SEE ALSO
DROTG(l), DROTM(l), DROTMG(l)
BLAS routine DROT(3)