| 1 | /* lapack/double/dlartg.f -- translated by f2c (version 20050501). |
| 2 | You must link the resulting object file with libf2c: |
| 3 | on Microsoft Windows system, link with libf2c.lib; |
| 4 | on Linux or Unix systems, link with .../path/to/libf2c.a -lm |
| 5 | or, if you install libf2c.a in a standard place, with -lf2c -lm |
| 6 | -- in that order, at the end of the command line, as in |
| 7 | cc *.o -lf2c -lm |
| 8 | Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., |
| 9 | |
| 10 | http://www.netlib.org/f2c/libf2c.zip |
| 11 | */ |
| 12 | |
| 13 | #ifdef __cplusplus |
| 14 | extern "C" { |
| 15 | #endif |
| 16 | #include "v3p_netlib.h"cxx . . $ `<file>/Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib.h`/ |
| 17 | |
| 18 | /* Initialization function just calls the function once so that its |
| 19 | runtime-initialized constants are initialized. After the first |
| 20 | call it is safe to call the function from multiple threads at |
| 21 | once. */ |
| 22 | void v3p_netlib_dlartg_initcxx . . $ v3p_netlib_dlartg_init(d878ad36e69247c7).() |
| 23 | { |
| 24 | doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! f=0, g=0, cs=0, sn=0, r=0; |
| 25 | dlartg_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:93:9`!(&f, &g, &cs, &sn, &r); |
| 26 | } |
| 27 | |
| 28 | /*< SUBROUTINE DLARTG( F, G, CS, SN, R ) >*/ |
| 29 | /* Subroutine */ int dlartg_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:93:9`!(doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *f, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *g, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *cs, |
| 30 | doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *sn, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *r__) |
| 31 | { |
| 32 | /* Initialized data */ |
| 33 | |
| 34 | static logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! first = TRUE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:29:9`!; /* runtime-initialized constant */ |
| 35 | |
| 36 | /* System generated locals */ |
| 37 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__1; |
| 38 | doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! d__1, d__2; |
| 39 | |
| 40 | /* Builtin functions */ |
| 41 | double logcxx . . $ log(447c67c6676f75c3).(doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`!), pow_dicxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:18:9`!(doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *), sqrtcxx . . $ sqrt(447c67c6676f75c3).(doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`!); |
| 42 | |
| 43 | /* Local variables */ |
| 44 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__; |
| 45 | doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! f1, g1, eps, scale; |
| 46 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! count; |
| 47 | static doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! safmn2, safmx2; /* runtime-initialized constant */ |
| 48 | extern doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! dlamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:81:9`!(char *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!); |
| 49 | static doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! safmin; /* runtime-initialized constant */ |
| 50 | |
| 51 | |
| 52 | /* -- LAPACK auxiliary routine (version 3.0) -- */ |
| 53 | /* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., */ |
| 54 | /* Courant Institute, Argonne National Lab, and Rice University */ |
| 55 | /* September 30, 1994 */ |
| 56 | |
| 57 | /* .. Scalar Arguments .. */ |
| 58 | /*< DOUBLE PRECISION CS, F, G, R, SN >*/ |
| 59 | /* .. */ |
| 60 | |
| 61 | /* Purpose */ |
| 62 | /* ======= */ |
| 63 | |
| 64 | /* DLARTG generate a plane rotation so that */ |
| 65 | |
| 66 | /* [ CS SN ] . [ F ] = [ R ] where CS**2 + SN**2 = 1. */ |
| 67 | /* [ -SN CS ] [ G ] [ 0 ] */ |
| 68 | |
| 69 | /* This is a slower, more accurate version of the BLAS1 routine DROTG, */ |
| 70 | /* with the following other differences: */ |
| 71 | /* F and G are unchanged on return. */ |
| 72 | /* If G=0, then CS=1 and SN=0. */ |
| 73 | /* If F=0 and (G .ne. 0), then CS=0 and SN=1 without doing any */ |
| 74 | /* floating point operations (saves work in DBDSQR when */ |
| 75 | /* there are zeros on the diagonal). */ |
| 76 | |
| 77 | /* If F exceeds G in magnitude, CS will be positive. */ |
| 78 | |
| 79 | /* Arguments */ |
| 80 | /* ========= */ |
| 81 | |
| 82 | /* F (input) DOUBLE PRECISION */ |
| 83 | /* The first component of vector to be rotated. */ |
| 84 | |
| 85 | /* G (input) DOUBLE PRECISION */ |
| 86 | /* The second component of vector to be rotated. */ |
| 87 | |
| 88 | /* CS (output) DOUBLE PRECISION */ |
| 89 | /* The cosine of the rotation. */ |
| 90 | |
| 91 | /* SN (output) DOUBLE PRECISION */ |
| 92 | /* The sine of the rotation. */ |
| 93 | |
| 94 | /* R (output) DOUBLE PRECISION */ |
| 95 | /* The nonzero component of the rotated vector. */ |
| 96 | |
| 97 | /* ===================================================================== */ |
| 98 | |
| 99 | /* .. Parameters .. */ |
| 100 | /*< DOUBLE PRECISION ZERO >*/ |
| 101 | /*< PARAMETER ( ZERO = 0.0D0 ) >*/ |
| 102 | /*< DOUBLE PRECISION ONE >*/ |
| 103 | /*< PARAMETER ( ONE = 1.0D0 ) >*/ |
| 104 | /*< DOUBLE PRECISION TWO >*/ |
| 105 | /*< PARAMETER ( TWO = 2.0D0 ) >*/ |
| 106 | /* .. */ |
| 107 | /* .. Local Scalars .. */ |
| 108 | /*< LOGICAL FIRST >*/ |
| 109 | /*< INTEGER COUNT, I >*/ |
| 110 | /*< DOUBLE PRECISION EPS, F1, G1, SAFMIN, SAFMN2, SAFMX2, SCALE >*/ |
| 111 | /* .. */ |
| 112 | /* .. External Functions .. */ |
| 113 | /*< DOUBLE PRECISION DLAMCH >*/ |
| 114 | /*< EXTERNAL DLAMCH >*/ |
| 115 | /* .. */ |
| 116 | /* .. Intrinsic Functions .. */ |
| 117 | /*< INTRINSIC ABS, INT, LOG, MAX, SQRT >*/ |
| 118 | /* .. */ |
| 119 | /* .. Save statement .. */ |
| 120 | /*< SAVE FIRST, SAFMX2, SAFMIN, SAFMN2 >*/ |
| 121 | /* .. */ |
| 122 | /* .. Data statements .. */ |
| 123 | /*< DATA FIRST / .TRUE. / >*/ |
| 124 | /* .. */ |
| 125 | /* .. Executable Statements .. */ |
| 126 | |
| 127 | /*< IF( FIRST ) THEN >*/ |
| 128 | if (first) { |
| 129 | /*< FIRST = .FALSE. >*/ |
| 130 | first = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 131 | /*< SAFMIN = DLAMCH( 'S' ) >*/ |
| 132 | safmin = dlamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:81:9`!("S", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1); |
| 133 | /*< EPS = DLAMCH( 'E' ) >*/ |
| 134 | eps = dlamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:81:9`!("E", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1); |
| 135 | /*< >*/ |
| 136 | d__1 = dlamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:81:9`!("B", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1); |
| 137 | i__1 = (integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`!) (logcxx . . $ log(447c67c6676f75c3).(safmin / eps) / logcxx . . $ log(447c67c6676f75c3).(dlamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:81:9`!("B", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1)) / |
| 138 | 2.); |
| 139 | safmn2 = pow_dicxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:18:9`!(&d__1, &i__1); |
| 140 | /*< SAFMX2 = ONE / SAFMN2 >*/ |
| 141 | safmx2 = 1. / safmn2; |
| 142 | /*< END IF >*/ |
| 143 | } |
| 144 | /*< IF( G.EQ.ZERO ) THEN >*/ |
| 145 | if (*g == 0.) { |
| 146 | /*< CS = ONE >*/ |
| 147 | *cs = 1.; |
| 148 | /*< SN = ZERO >*/ |
| 149 | *sn = 0.; |
| 150 | /*< R = F >*/ |
| 151 | *r__ = *f; |
| 152 | /*< ELSE IF( F.EQ.ZERO ) THEN >*/ |
| 153 | } else if (*f == 0.) { |
| 154 | /*< CS = ZERO >*/ |
| 155 | *cs = 0.; |
| 156 | /*< SN = ONE >*/ |
| 157 | *sn = 1.; |
| 158 | /*< R = G >*/ |
| 159 | *r__ = *g; |
| 160 | /*< ELSE >*/ |
| 161 | } else { |
| 162 | /*< F1 = F >*/ |
| 163 | f1 = *f; |
| 164 | /*< G1 = G >*/ |
| 165 | g1 = *g; |
| 166 | /*< SCALE = MAX( ABS( F1 ), ABS( G1 ) ) >*/ |
| 167 | /* Computing MAX */ |
| 168 | d__1 = abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(f1), d__2 = abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(g1); |
| 169 | scale = maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(d__1,d__2); |
| 170 | /*< IF( SCALE.GE.SAFMX2 ) THEN >*/ |
| 171 | if (scale >= safmx2) { |
| 172 | /*< COUNT = 0 >*/ |
| 173 | count = 0; |
| 174 | /*< 10 CONTINUE >*/ |
| 175 | L10: |
| 176 | /*< COUNT = COUNT + 1 >*/ |
| 177 | ++count; |
| 178 | /*< F1 = F1*SAFMN2 >*/ |
| 179 | f1 *= safmn2; |
| 180 | /*< G1 = G1*SAFMN2 >*/ |
| 181 | g1 *= safmn2; |
| 182 | /*< SCALE = MAX( ABS( F1 ), ABS( G1 ) ) >*/ |
| 183 | /* Computing MAX */ |
| 184 | d__1 = abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(f1), d__2 = abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(g1); |
| 185 | scale = maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(d__1,d__2); |
| 186 | /*< >*/ |
| 187 | if (scale >= safmx2) { |
| 188 | goto L10; |
| 189 | } |
| 190 | /*< R = SQRT( F1**2+G1**2 ) >*/ |
| 191 | /* Computing 2nd power */ |
| 192 | d__1 = f1; |
| 193 | /* Computing 2nd power */ |
| 194 | d__2 = g1; |
| 195 | *r__ = sqrtcxx . . $ sqrt(447c67c6676f75c3).(d__1 * d__1 + d__2 * d__2); |
| 196 | /*< CS = F1 / R >*/ |
| 197 | *cs = f1 / *r__; |
| 198 | /*< SN = G1 / R >*/ |
| 199 | *sn = g1 / *r__; |
| 200 | /*< DO 20 I = 1, COUNT >*/ |
| 201 | i__1 = count; |
| 202 | for (i__ = 1; i__ <= i__1; ++i__) { |
| 203 | /*< R = R*SAFMX2 >*/ |
| 204 | *r__ *= safmx2; |
| 205 | /*< 20 CONTINUE >*/ |
| 206 | /* L20: */ |
| 207 | } |
| 208 | /*< ELSE IF( SCALE.LE.SAFMN2 ) THEN >*/ |
| 209 | } else if (scale <= safmn2) { |
| 210 | /*< COUNT = 0 >*/ |
| 211 | count = 0; |
| 212 | /*< 30 CONTINUE >*/ |
| 213 | L30: |
| 214 | /*< COUNT = COUNT + 1 >*/ |
| 215 | ++count; |
| 216 | /*< F1 = F1*SAFMX2 >*/ |
| 217 | f1 *= safmx2; |
| 218 | /*< G1 = G1*SAFMX2 >*/ |
| 219 | g1 *= safmx2; |
| 220 | /*< SCALE = MAX( ABS( F1 ), ABS( G1 ) ) >*/ |
| 221 | /* Computing MAX */ |
| 222 | d__1 = abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(f1), d__2 = abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(g1); |
| 223 | scale = maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(d__1,d__2); |
| 224 | /*< >*/ |
| 225 | if (scale <= safmn2) { |
| 226 | goto L30; |
| 227 | } |
| 228 | /*< R = SQRT( F1**2+G1**2 ) >*/ |
| 229 | /* Computing 2nd power */ |
| 230 | d__1 = f1; |
| 231 | /* Computing 2nd power */ |
| 232 | d__2 = g1; |
| 233 | *r__ = sqrtcxx . . $ sqrt(447c67c6676f75c3).(d__1 * d__1 + d__2 * d__2); |
| 234 | /*< CS = F1 / R >*/ |
| 235 | *cs = f1 / *r__; |
| 236 | /*< SN = G1 / R >*/ |
| 237 | *sn = g1 / *r__; |
| 238 | /*< DO 40 I = 1, COUNT >*/ |
| 239 | i__1 = count; |
| 240 | for (i__ = 1; i__ <= i__1; ++i__) { |
| 241 | /*< R = R*SAFMN2 >*/ |
| 242 | *r__ *= safmn2; |
| 243 | /*< 40 CONTINUE >*/ |
| 244 | /* L40: */ |
| 245 | } |
| 246 | /*< ELSE >*/ |
| 247 | } else { |
| 248 | /*< R = SQRT( F1**2+G1**2 ) >*/ |
| 249 | /* Computing 2nd power */ |
| 250 | d__1 = f1; |
| 251 | /* Computing 2nd power */ |
| 252 | d__2 = g1; |
| 253 | *r__ = sqrtcxx . . $ sqrt(447c67c6676f75c3).(d__1 * d__1 + d__2 * d__2); |
| 254 | /*< CS = F1 / R >*/ |
| 255 | *cs = f1 / *r__; |
| 256 | /*< SN = G1 / R >*/ |
| 257 | *sn = g1 / *r__; |
| 258 | /*< END IF >*/ |
| 259 | } |
| 260 | /*< IF( ABS( F ).GT.ABS( G ) .AND. CS.LT.ZERO ) THEN >*/ |
| 261 | if (abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(*f) > abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(*g) && *cs < 0.) { |
| 262 | /*< CS = -CS >*/ |
| 263 | *cs = -(*cs); |
| 264 | /*< SN = -SN >*/ |
| 265 | *sn = -(*sn); |
| 266 | /*< R = -R >*/ |
| 267 | *r__ = -(*r__); |
| 268 | /*< END IF >*/ |
| 269 | } |
| 270 | /*< END IF >*/ |
| 271 | } |
| 272 | /*< RETURN >*/ |
| 273 | return 0; |
| 274 | |
| 275 | /* End of DLARTG */ |
| 276 | |
| 277 | /*< END >*/ |
| 278 | } /* dlartg_ */ |
| 279 | |
| 280 | #ifdef __cplusplus |
| 281 | } |
| 282 | #endif |