LAPACK 3.3.0
|
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).NE.0.0d0) GO TO 10 00022 C = 0.0d0 00023 S = (1.0d0,0.0d0) 00024 CA = CB 00025 GO TO 20 00026 10 CONTINUE 00027 SCALE = CDABS(CA) + CDABS(CB) 00028 NORM = SCALE*DSQRT((CDABS(CA/DCMPLX(SCALE,0.0d0)))**2+ 00029 + (CDABS(CB/DCMPLX(SCALE,0.0d0)))**2) 00030 ALPHA = CA/CDABS(CA) 00031 C = CDABS(CA)/NORM 00032 S = ALPHA*DCONJG(CB)/NORM 00033 CA = ALPHA*NORM 00034 20 CONTINUE 00035 RETURN 00036 END