{S,D}ROTMG (d1, d2, x1, y1, param)
d1 real*4 | real*8 On entry, the first scale factor for the modified Givens transform. On exit, d1 is updated. d2 real*4 | real*8 On entry, the second scale factor for the modified Givens transform. On exit, d2 is updated. x1 real*4 | real*8 On entry, the first element x(1) of the input vector. On exit, x1 is overwritten with the rotated element. y1 real*4 | real*8 On entry, the second element y(1) of the input vector. On exit, y1 is unchanged. param real*4 | real*8 On entry, param is unspecified. On exit, param contains an array defining the type of transform matrix H constructed: PARAM(1) specifies the flag characteristic: -1.0, 0.0, 1.0, -2.0 PARAM(2) specifies H(11) value PARAM(3) specifies H(21) value PARAM(4) specifies H(12) value PARAM(5) specifies H(22) value
The _ROTMG subroutines construct a modified Givens transform that eliminates the second element of a two-element vector and can be used to introduce zeros selectively into a matrix. These routine use the modification due to Gentleman of the Givens plane rotations. This modification eliminates the square root from the construction of the plane rotation and reduces the operation count when the modified Givens rotation, rather than the standard Givens rotations are applied. In most applications, the scale factors d1 and d2 are initially set to 1 and then modified by _ROTMG as necessary. Given real a and b in factored form: a = sqrt(d1) * x(1) b = sqrt(d2) * y(1) SROTMG and DROTMG construct the modified Givens plane rotation, d1', d2' and H as H(11) H(12) H(21) H(22) such that |- -| |- -| |- -| |- -| |sqrt(d1') 0 | | x(1) | | a | | r | | | * H * | | = G * | | = | | | 0 sqrt(d2') | | y(1) | | b | | 0 | |_ _| |_ _| |_ _| |_ _| where G is a 2 by 2 Givens plane rotation matrix which annihilates b, and where H is chosen for numerical stability and computational efficiency. The routine _ROTM applies the matrix H, as constructed by _ROTMG, to a pair of real vectors, x and y, each with n elements, as follows: |- -| |- -| | x(i) | | x(i) | | | = H * | | | y(i) | | y(i) | |_ _| |_ _| These vectors may be either rows or columns of matrices and the indexing of the vectors may be either forwards or backwards. Depending on the value of IPARAM(1), the matrix H is defined as follows: • PARAM(1)= -1.0 H(11) H(12) H(21) H(22) • PARAM(1)= 0.0 1.0 H(12) H(21) 1.0 • PARAM(1)= 1.0 H(11) 1.0 -1.0 H(22) • PARAM(1)= -2.0 1.0 0.0 0.0 1.0 The routines _ROTMG and _ROTM perform similar tasks to the routines _ROTG and _ROT, which construct and apply the standard Givens plane rotations. The modified Givens rotations reduce the operation count of constructing and applying the rotations at the cost of increased storage to represent the rotations.
See the example for SROTM.