CLAQR1(3f)

NAME

SYNOPSIS

SUBROUTINE CLAQR1(
    N, H, LDH, S1, S2, V )

COMPLEX
    S1, S2

INTEGER
    LDH, N

COMPLEX
    H( LDH, * ), V( * )

COMPLEX
    ZERO

PARAMETER
    ( ZERO = ( 0.0e0, 0.0e0 ) )

REAL
    RZERO

PARAMETER
    ( RZERO = 0.0e0 )

COMPLEX
    CDUM

REAL
    H21S, H31S, S

INTRINSIC
    ABS, AIMAG, REAL

REAL
    CABS1

CABS1(
    CDUM ) = ABS( REAL( CDUM ) ) + ABS( AIMAG( CDUM ) )

IF( N.EQ.2 ) THEN

S   = CABS1( H( 1, 1 )-S2 ) + CABS1( H( 2, 1 ) )

IF( S.EQ.RZERO ) THEN

V(  1 ) = ZERO

V(  2 ) = ZERO

ELSE

H21S
    = H( 2, 1 ) / S

V(  1 ) = H21S*H( 1, 2 ) + ( H( 1, 1 )-S1 )* ( ( H( 1, 1 )-S2 ) / S )

V(  2 ) = H21S*( H( 1, 1 )+H( 2, 2 )-S1-S2 )

END IF

ELSE

S   = CABS1( H( 1, 1 )-S2 ) + CABS1( H( 2, 1 ) ) + CABS1( H( 3, 1 ) )

IF( S.EQ.ZERO ) THEN

V(  1 ) = ZERO

V(  2 ) = ZERO

V(  3 ) = ZERO

ELSE

H21S
    = H( 2, 1 ) / S

H31S
    = H( 3, 1 ) / S

V(  1 ) = ( H( 1, 1 )-S1 )*( ( H( 1, 1 )-S2 ) / S ) + H( 1, 2 )*H21S + H( 1, 3 )*H31S

V(  2 ) = H21S*( H( 1, 1 )+H( 2, 2 )-S1-S2 ) + H( 2, 3 )*H31S

V(  3 ) = H31S*( H( 1, 1 )+H( 3, 3 )-S1-S2 ) + H21S*H( 3, 2 )

END IF

END IF

END

PURPOSE