XLPack 7.0
XLPack Numerical Library (Excel VBA) Reference Manual
Loading...
Searching...
No Matches

◆ Drotmg()

Sub Drotmg ( D1 As  Double,
D2 As  Double,
X1 As  Double,
Y1 As  Double,
P() As  Double 
)

Construct modified Givens plane rotation (BLAS 1)

Purpose
This routine constructs the modified Givens plane rotation H for the point (x1, y1) as below.
( sqrt(d1') 0 ) * H * ( x1 ) = ( sqrt(d1')*x1' )
( 0 sqrt(d2') ) ( y1 ) ( 0 )
The input values of scaling factors d1, d2 and the output values d1', d2' have the following relationship.
( d1 0 ) = H^T * ( d1' 0 ) * H
( 0 d2 ) ( 0 d2')
The constructed matrix H can be used by drotm to convert the points to the new coordinate system.
Parameters
[in,out]D1[in] The input value of scaling factor d1. On the first call to the routine, this value is typically 1. Subsequent calls typically use the value from the previous call.
[out] The update scaling factor d1'
[in,out]D2[in] The input value of scaling factor d2. On the first call to the routine, this value is typically 1. Subsequent calls typically use the value from the previous call.
[out] The update scaling factor d2'
[in,out]X1[in] X-coordinate value x1.
[out] X-coordinate of the rotated vector, before scaling. (= x1')
[in]Y1Y-coordinate value y1.
[out]P()Array P(LP - 1) (LP >= 5)
Rotation matrix H.
P(0): -1, 0, 1 or -2. Each value specifies how the matrix is stored as shown below.
P(1), P(2), P(3), P(4): The values of H11, H21, H12 and H22. The values 0, 1 or -1 shown below are not stored in the corresponding elements in the array P().
If P(0) = 1,
  H11 = P(1), H21 = -1, H12 = 1, H22 = P(4)
If P(0) = 0,
  H11 = 1, H21 = P(2), H12 = P(3), H22 = 1
If P(0) = -1,
  H11 = P(1), H21 = P(2), H12 = P(3), H22 = P(4)
If P(0) = -2,
  H11 = 1, H21 = 0, H12 = 0, H22 = 1 (H = I)
If size of array P() is insufficient, returns without computation.
Reference
BLAS