SROTMG(3)       BLAS routine of NEC Numeric Library Collection       SROTMG(3)



NAME
       SROTMG - BLAS Level 1. Constructs a modified Givens plane rotation


SYNOPSIS
           SUBROUTINE SROTMG ( d1, d2, b1, b2, rparam )

           REAL                d1, d2, b1, b2, rparam

DESCRIPTION
       SROTMG  computes  the  elements  of  a  modified  Givens plane rotation
       matrix.

ARGUMENTS
       d1      (input and output) REAL

               First diagonal element.

               On input, this value is the first diagonal element of the scal-
               ing  matrix D.  On the first call to the routine, this value is
               typically 1.0.  Subsequent calls typically use the  value  from
               the previous call.  On output, this value is the first diagonal
               element of the updated scaling matrix D'.


       d2      (input and output) REAL

               Second diagonal element.

               On input, this is the second diagonal element  of  the  scaling
               matrix D.  On the first call to the routine, this value is typ-
               ically 1.0.  Subsequent calls typically use the value from  the
               previous  call.   On  output, this value is the second diagonal
               element of the updated scaling matrix D'.



       b1      (input) REAL

               x-coordinate.

               on input, this value is the x-coordinate of the vector used  to
               define  the  angle  of rotation, before scaling (multiplying by
               the matrix D).  On output, this value is  the  x-coordinate  of
               the  rotated  vector, before scaling (multiplying by the matrix
               D').


       b2      (input) REAL

               y-coordinate.

               On input, this value is the y-coordinate of the vector used  to
               define  the  angle  of rotation, before scaling (multiplying by
               the matrix D).  It is unchanged on output.


       rparam  (output) REAL

               Real array of dimension 5.

               This array contains rotation matrix information.   The  routine
               sets up the computed elements in rparam from inputs d1, d2, b1,
               and b2.



RETURN VALUES
       Meaning of the Output Values:

       The output values are  returned  through  arguments  d1,  d2,  b1,  and
       rparam.

       The  scaling  factors  d1 and d2 are updated with each call to the rou-
       tine.  Although SROTM does not  need  the  updated  factors,  they  are
       needed in two other important contexts:

       As  input for subsequent calls to this routine.  As scaling factors for
       rotated but unscaled points (x(i), y(i)), which are output from  SROTM.

       In  this  second  usage,  the  actual (scaled) points would be given by
       (sqrt(d1)*x(i), sqrt(d2)*y(i)).  Doing this operation frequently on all
       of  your  points is counterproductive.  The main advantage of the modi-
       fied rotation algorithm is to reduce the number of operations.  If  you
       fold in the scaling factors after each rotation, you are performing the
       same number of operations as in the standard Givens rotation.

       These two uses for the scaling factors are mutually exclusive; that is,
       if  you  fold  the  scaling  factors  back into all your points, you no
       longer need those factors for this routine.  After folding in the scal-
       ing  factors,  and  before  the next call to SROTMG, reset d1 and d2 to
       1.0.

       On output, b1 represents  the  new  x-coordinate  after  rotating  (but
       before scaling) the rotation vector.  Although the y-coordinate of this
       vector is 0.0 (see the  the  previous  discussion),  the  corresponding
       value b2 is unchanged on output.

       The  output array argument rparam specifies the format of matrix H, and
       it holds the nonunit values of H.  This is the only output of this rou-
       tine  that SROTM requires.  Each element of rparam has a specific mean-
       ing, as follows:

       rparam(1)  a flag parameter that specifies how the matrix is stored
              0.0 =>  Off-diagonal elements of H are units.

              1.0 =>  Diagonal elements of H are units.

             -1.0 =>  Rescaling case (see the following subsection).

             -2.0 =>  H is the identity matrix; no rotation needed.

         rparam(2)  = h    if needed
                       1,1
         rparam(3)  = h    if needed
                       2,1
         rparam(4)  = h    if needed
                       1,2
         rparam(5)  = h    if needed
                       2,2


SEE ALSO
       SROT(3), SROTG(3), SROTM(3)

       Gentleman, W. M., "Least Squares Computations by Givens Transformations
       Without Square Roots," Journal of the Institute for Mathematical Appli-
       cations 12 (1973), pp. 329 - 336.

       Lawson, C., Hanson, R., Kincaid, D., and Krogh, F., "Basic Linear Alge-
       bra  Subprograms  for  Fortran Usage," ACM Transactions on Mathematical
       Software, 5 (1979),



BLAS routine                                                         SROTMG(3)