LAPACK 3.3.1
Linear Algebra PACKage

zrotg.f

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