drotmg.c
Go to the documentation of this file.
00001 /* drotmg.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Subroutine */ int drotmg_(doublereal *dd1, doublereal *dd2, doublereal *
00017         dx1, doublereal *dy1, doublereal *dparam)
00018 {
00019     /* Initialized data */
00020 
00021     static doublereal zero = 0.;
00022     static doublereal one = 1.;
00023     static doublereal two = 2.;
00024     static doublereal gam = 4096.;
00025     static doublereal gamsq = 16777216.;
00026     static doublereal rgamsq = 5.9604645e-8;
00027 
00028     /* Format strings */
00029     static char fmt_120[] = "";
00030     static char fmt_150[] = "";
00031     static char fmt_180[] = "";
00032     static char fmt_210[] = "";
00033 
00034     /* System generated locals */
00035     doublereal d__1;
00036 
00037     /* Local variables */
00038     doublereal du, dp1, dp2, dq1, dq2, dh11, dh12, dh21, dh22;
00039     integer igo;
00040     doublereal dflag, dtemp;
00041 
00042     /* Assigned format variables */
00043     static char *igo_fmt;
00044 
00045 /*     .. Scalar Arguments .. */
00046 /*     .. */
00047 /*     .. Array Arguments .. */
00048 /*     .. */
00049 
00050 /*  Purpose */
00051 /*  ======= */
00052 
00053 /*     CONSTRUCT THE MODIFIED GIVENS TRANSFORMATION MATRIX H WHICH ZEROS */
00054 /*     THE SECOND COMPONENT OF THE 2-VECTOR  (DSQRT(DD1)*DX1,DSQRT(DD2)* */
00055 /*     DY2)**T. */
00056 /*     WITH DPARAM(1)=DFLAG, H HAS ONE OF THE FOLLOWING FORMS.. */
00057 
00058 /*     DFLAG=-1.D0     DFLAG=0.D0        DFLAG=1.D0     DFLAG=-2.D0 */
00059 
00060 /*       (DH11  DH12)    (1.D0  DH12)    (DH11  1.D0)    (1.D0  0.D0) */
00061 /*     H=(          )    (          )    (          )    (          ) */
00062 /*       (DH21  DH22),   (DH21  1.D0),   (-1.D0 DH22),   (0.D0  1.D0). */
00063 /*     LOCATIONS 2-4 OF DPARAM CONTAIN DH11, DH21, DH12, AND DH22 */
00064 /*     RESPECTIVELY. (VALUES OF 1.D0, -1.D0, OR 0.D0 IMPLIED BY THE */
00065 /*     VALUE OF DPARAM(1) ARE NOT STORED IN DPARAM.) */
00066 
00067 /*     THE VALUES OF GAMSQ AND RGAMSQ SET IN THE DATA STATEMENT MAY BE */
00068 /*     INEXACT.  THIS IS OK AS THEY ARE ONLY USED FOR TESTING THE SIZE */
00069 /*     OF DD1 AND DD2.  ALL ACTUAL SCALING OF DATA IS DONE USING GAM. */
00070 
00071 
00072 /*  Arguments */
00073 /*  ========= */
00074 
00075 /*  DD1    (input/output) DOUBLE PRECISION */
00076 
00077 /*  DD2    (input/output) DOUBLE PRECISION */
00078 
00079 /*  DX1    (input/output) DOUBLE PRECISION */
00080 
00081 /*  DY1    (input) DOUBLE PRECISION */
00082 
00083 /*  DPARAM (input/output)  DOUBLE PRECISION array, dimension 5 */
00084 /*     DPARAM(1)=DFLAG */
00085 /*     DPARAM(2)=DH11 */
00086 /*     DPARAM(3)=DH21 */
00087 /*     DPARAM(4)=DH12 */
00088 /*     DPARAM(5)=DH22 */
00089 
00090 /*  ===================================================================== */
00091 
00092 /*     .. Local Scalars .. */
00093 /*     .. */
00094 /*     .. Intrinsic Functions .. */
00095 /*     .. */
00096 /*     .. Data statements .. */
00097 
00098     /* Parameter adjustments */
00099     --dparam;
00100 
00101     /* Function Body */
00102 /*     .. */
00103     if (! (*dd1 < zero)) {
00104         goto L10;
00105     }
00106 /*       GO ZERO-H-D-AND-DX1.. */
00107     goto L60;
00108 L10:
00109 /*     CASE-DD1-NONNEGATIVE */
00110     dp2 = *dd2 * *dy1;
00111     if (! (dp2 == zero)) {
00112         goto L20;
00113     }
00114     dflag = -two;
00115     goto L260;
00116 /*     REGULAR-CASE.. */
00117 L20:
00118     dp1 = *dd1 * *dx1;
00119     dq2 = dp2 * *dy1;
00120     dq1 = dp1 * *dx1;
00121 
00122     if (! (abs(dq1) > abs(dq2))) {
00123         goto L40;
00124     }
00125     dh21 = -(*dy1) / *dx1;
00126     dh12 = dp2 / dp1;
00127 
00128     du = one - dh12 * dh21;
00129 
00130     if (! (du <= zero)) {
00131         goto L30;
00132     }
00133 /*         GO ZERO-H-D-AND-DX1.. */
00134     goto L60;
00135 L30:
00136     dflag = zero;
00137     *dd1 /= du;
00138     *dd2 /= du;
00139     *dx1 *= du;
00140 /*         GO SCALE-CHECK.. */
00141     goto L100;
00142 L40:
00143     if (! (dq2 < zero)) {
00144         goto L50;
00145     }
00146 /*         GO ZERO-H-D-AND-DX1.. */
00147     goto L60;
00148 L50:
00149     dflag = one;
00150     dh11 = dp1 / dp2;
00151     dh22 = *dx1 / *dy1;
00152     du = one + dh11 * dh22;
00153     dtemp = *dd2 / du;
00154     *dd2 = *dd1 / du;
00155     *dd1 = dtemp;
00156     *dx1 = *dy1 * du;
00157 /*         GO SCALE-CHECK */
00158     goto L100;
00159 /*     PROCEDURE..ZERO-H-D-AND-DX1.. */
00160 L60:
00161     dflag = -one;
00162     dh11 = zero;
00163     dh12 = zero;
00164     dh21 = zero;
00165     dh22 = zero;
00166 
00167     *dd1 = zero;
00168     *dd2 = zero;
00169     *dx1 = zero;
00170 /*         RETURN.. */
00171     goto L220;
00172 /*     PROCEDURE..FIX-H.. */
00173 L70:
00174     if (! (dflag >= zero)) {
00175         goto L90;
00176     }
00177 
00178     if (! (dflag == zero)) {
00179         goto L80;
00180     }
00181     dh11 = one;
00182     dh22 = one;
00183     dflag = -one;
00184     goto L90;
00185 L80:
00186     dh21 = -one;
00187     dh12 = one;
00188     dflag = -one;
00189 L90:
00190     switch (igo) {
00191         case 0: goto L120;
00192         case 1: goto L150;
00193         case 2: goto L180;
00194         case 3: goto L210;
00195     }
00196 /*     PROCEDURE..SCALE-CHECK */
00197 L100:
00198 L110:
00199     if (! (*dd1 <= rgamsq)) {
00200         goto L130;
00201     }
00202     if (*dd1 == zero) {
00203         goto L160;
00204     }
00205     igo = 0;
00206     igo_fmt = fmt_120;
00207 /*              FIX-H.. */
00208     goto L70;
00209 L120:
00210 /* Computing 2nd power */
00211     d__1 = gam;
00212     *dd1 *= d__1 * d__1;
00213     *dx1 /= gam;
00214     dh11 /= gam;
00215     dh12 /= gam;
00216     goto L110;
00217 L130:
00218 L140:
00219     if (! (*dd1 >= gamsq)) {
00220         goto L160;
00221     }
00222     igo = 1;
00223     igo_fmt = fmt_150;
00224 /*              FIX-H.. */
00225     goto L70;
00226 L150:
00227 /* Computing 2nd power */
00228     d__1 = gam;
00229     *dd1 /= d__1 * d__1;
00230     *dx1 *= gam;
00231     dh11 *= gam;
00232     dh12 *= gam;
00233     goto L140;
00234 L160:
00235 L170:
00236     if (! (abs(*dd2) <= rgamsq)) {
00237         goto L190;
00238     }
00239     if (*dd2 == zero) {
00240         goto L220;
00241     }
00242     igo = 2;
00243     igo_fmt = fmt_180;
00244 /*              FIX-H.. */
00245     goto L70;
00246 L180:
00247 /* Computing 2nd power */
00248     d__1 = gam;
00249     *dd2 *= d__1 * d__1;
00250     dh21 /= gam;
00251     dh22 /= gam;
00252     goto L170;
00253 L190:
00254 L200:
00255     if (! (abs(*dd2) >= gamsq)) {
00256         goto L220;
00257     }
00258     igo = 3;
00259     igo_fmt = fmt_210;
00260 /*              FIX-H.. */
00261     goto L70;
00262 L210:
00263 /* Computing 2nd power */
00264     d__1 = gam;
00265     *dd2 /= d__1 * d__1;
00266     dh21 *= gam;
00267     dh22 *= gam;
00268     goto L200;
00269 L220:
00270     if (dflag < 0.) {
00271         goto L250;
00272     } else if (dflag == 0) {
00273         goto L230;
00274     } else {
00275         goto L240;
00276     }
00277 L230:
00278     dparam[3] = dh21;
00279     dparam[4] = dh12;
00280     goto L260;
00281 L240:
00282     dparam[2] = dh11;
00283     dparam[5] = dh22;
00284     goto L260;
00285 L250:
00286     dparam[2] = dh11;
00287     dparam[3] = dh21;
00288     dparam[4] = dh12;
00289     dparam[5] = dh22;
00290 L260:
00291     dparam[1] = dflag;
00292     return 0;
00293 } /* drotmg_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:48