Previous Next Contents Generated Index Doc Set Home



Applied Modified Given's Transformation

The subroutines in this section apply Gentleman's modified Given's plane rotation as defined by:

Calling Sequence

CALL DROTM 
(N, DX, INCX, DY, INCY, DPARAM)
CALL SROTM 
(N, SX, INCX, SY, INCY, SPARAM)






void drotm 
(int n, double *dx, int incx, double *dy, int incy, 
double *dparam)
void srotm 
(int n, float *sx, int incx, float *sy, int incy, float 
sc, float *sparam)

Arguments

N

Number of elements in the vector. N 0.

xX

Input vector X; the size of array X must be at least max(1,N*|INCX|).

INCX

Specifies the storage spacing between successive elements of the vector X. A value of one indicates that the elements of the vector are consecutive in memory.

If X refers to a two-dimensional array and the value of INCX is equal to the leading dimension of X then the elements of the vector will be a row of X.

If X refers to a two-dimensional array and the value of INCX is equal to the leading dimension of X plus one then the elements of the vector will be a diagonal of X.

xY

Result vector Y; the size of array Y must be at least max(1,N*|INCY|).

INCY

Specifies the storage spacing between successive elements of the vector Y. A value of one indicates that the elements of the vector are consecutive in memory.

If Y refers to a two-dimensional array and the value of INCY is equal to the leading dimension of Y then the elements of the vector will be a row of Y.

If Y refers to a two-dimensional array and the value of INCY is equal to the leading dimension of Y plus one then the elements of the vector will be a diagonal of Y.

xPARAM

Value of the PARAM argument from xROTMG.

Sample Program

 
      PROGRAM TEST
      IMPLICIT NONE
C
      INTEGER           N
      PARAMETER        (N = 4)
C
      DOUBLE PRECISION  B1, B2, D1, D2, PARAM(5), X(N), Y(N)
      INTEGER           I, INCX, INCY
C
      EXTERNAL DROTM, DROTMG
C
C     Initialize the arrays X and Y to store the vectors x and y
C     shown below.
C
C         5         2
C     x = 5    y =  4
C         5         8
C         5        16
C
      DATA X / 5.0D0, 5.0D0, 5.0D0, 5.0D0 /
      DATA Y / 2.0D0, 4.0D0, 8.0D0, 1.6D1 /
C
      PARAM(1) = -2
      PRINT 1000
      PRINT 1010, (X(I), Y(I), I = 1, N)
C
C     Set up the rotation that will eliminate the third element.
C
      D1 = 1.0D0
      D2 = 1.0D0
      B1 = X(3)
      B2 = Y(3)
      CALL DROTMG (D1, D2, B1, B2, PARAM)
C
C     Apply the rotation to eliminate the third element and print
C     the results.
C
      INCX = 1
      INCY = 1
      CALL DROTM (N, X, INCX, Y, INCY, PARAM)
      PRINT 1020
      PRINT 1010, (X(I), Y(I), I = 1, N)
C
 1000 FORMAT (1X, 6X, 'x', 9X, 'y')
 1010 FORMAT (2(3X, F7.4))
 1020 FORMAT (/1X, 6X, 'x''', 8X, 'y''')
C
      END
 

Sample Output

 
       x         y
    5.0000    2.0000
    5.0000    4.0000
    5.0000    8.0000
    5.0000   16.0000



       x'        y'
    5.1250   -3.7500
    7.1250   -2.5000
   11.1250    0.0000
   19.1250    5.0000






Previous Next Contents Generated Index Doc Set Home