LAPACK 3.3.1
Linear Algebra PACKage

crotg.f

Go to the documentation of this file.
00001       SUBROUTINE CROTG(CA,CB,C,S)
00002 *     .. Scalar Arguments ..
00003       COMPLEX CA,CB,S
00004       REAL C
00005 *     ..
00006 *
00007 *  Purpose
00008 *  =======
00009 *
00010 *  CROTG determines a complex Givens rotation.
00011 *
00012 *  =====================================================================
00013 *
00014 *     .. Local Scalars ..
00015       COMPLEX ALPHA
00016       REAL NORM,SCALE
00017 *     ..
00018 *     .. Intrinsic Functions ..
00019       INTRINSIC CABS,CONJG,SQRT
00020 *     ..
00021       IF (CABS(CA).EQ.0.) THEN
00022          C = 0.
00023          S = (1.,0.)
00024          CA = CB
00025       ELSE
00026          SCALE = CABS(CA) + CABS(CB)
00027          NORM = SCALE*SQRT((CABS(CA/SCALE))**2+ (CABS(CB/SCALE))**2)
00028          ALPHA = CA/CABS(CA)
00029          C = CABS(CA)/NORM
00030          S = ALPHA*CONJG(CB)/NORM
00031          CA = ALPHA*NORM
00032       END IF
00033       RETURN
00034       END
 All Files Functions