SROTM/DROTM

Apply modified Givens rotation

Example 2 Reduce 10-by-10 matrix a stored in two-dimensional array A of dimension 20-by-21 to upper-triangular form via modified Givens rotations (compare with “Example 2” on page 117 in the description of SROT and DROT).

INTEGER*4

INCA,I,J,N

REAL*8

A(20,21),D(20),PARAM(5)

INCA = 20

 

DO 10 I =

1, 10

D(I) =

1.0D0

10CONTINUE

DO 30 I = 1, 9 N = 10 - I

DO 20 J = I+1, 10

CALL DROTMG (D(I),D(J),A(I,I),A(J,I),PARAM)

CALL DROTM (N,A(I,I+1),INCA,A(J,I+1),INCA,PARAM)

20CONTINUE

30CONTINUE

DO 40 I = 1, 10 N = 11 - I

CALL DSCAL (N,SQRT(D(I)),A(I,I),INCA)

40CONTINUE

126HP MLIB User’s Guide