F_SGEN_GROT/F_DGEN_GROT/F_CGEN_GROT/F_ZGEN_GROT

Generate Givens rotation

Name F_SGEN_GROT/F_DGEN_GROT/F_CGEN_GROT/F_ZGEN_GROT Generate Givens rotation

Purpose F_xGEN_GROT constructs a Givens plane rotation so that

c s

a

=

r

s c

 

b

 

0

where c is always a real scalar and

c2 + s 2 = 1

The scalars a and b are unchanged on exit. If b is equal to zero, then the pair

(c,s) is chosen to be equal to (1, 0). Otherwise, when a and b are real scalars and a is equal to zero, the pair (c,s) is chosen to be equal to (0, 1); when a and b are complex scalars and a is equal to zero, c is chosen to be zero and s is chosen so that r is real.

(c, s, r) ← rot(a, b)

Usage

VECLIB, VECLIB8

 

 

REAL*4

C

 

REAL*4

A, B, R, S

 

SUBROUTINE F_SGEN_GROT (A, B, C, S, R)

 

REAL*8

C

 

REAL*8

A, B, R, S

SUBROUTINE F_DGEN_GROT (A, B, C, S, R)

 

REAL*4

C

 

COMPLEX*8

A, B, R, S

 

SUBROUTINE F_CGEN_GROT (A, B, C, S, R)

 

REAL*8

C

 

COMPLEX*16

A, B, R, S

 

SUBROUTINE F_ZGEN_GROT (A, B, C, S, R)

Input

A

REAL or COMPLEX scalar. A is unchanged on exit.

 

B

REAL or COMPLEX scalar. B is unchanged on exit.

Output

C

REAL scalar.

 

R

The REAL or COMPLEX product of the operation.

 

S

REAL or COMPLEX scalar.

174HP MLIB User’s Guide