| 1 | /* linpack/sqrsl.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 | /* Table of constant values */ |
| 19 | |
| 20 | static integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! c__1cxx . . $ c__1. = 1; |
| 21 | |
| 22 | /*< subroutine sqrsl(x,ldx,n,k,qraux,y,qy,qty,b,rsd,xb,job,info) >*/ |
| 23 | /* Subroutine */ int sqrsl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:273:9`!(realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *x, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ldx, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *n, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *k, |
| 24 | realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *qraux, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *y, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *qy, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *qty, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *b, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *rsd, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! * |
| 25 | xb, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *job, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *info) |
| 26 | { |
| 27 | /* System generated locals */ |
| 28 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! x_dim1, x_offset, i__1, i__2; |
| 29 | |
| 30 | /* Local variables */ |
| 31 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__, j; |
| 32 | realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! t; |
| 33 | logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! cb; |
| 34 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! jj; |
| 35 | logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! cr; |
| 36 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! ju, kp1; |
| 37 | logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! cxb, cqy; |
| 38 | realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! temp; |
| 39 | extern doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! sdot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:232:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *); |
| 40 | logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! cqty; |
| 41 | extern /* Subroutine */ int scopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:230:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, |
| 42 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *), saxpy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:221:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *, |
| 43 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *); |
| 44 | |
| 45 | /*< integer ldx,n,k,job,info >*/ |
| 46 | /*< real x(ldx,1),qraux(1),y(1),qy(1),qty(1),b(1),rsd(1),xb(1) >*/ |
| 47 | |
| 48 | /* sqrsl applies the output of sqrdc to compute coordinate */ |
| 49 | /* transformations, projections, and least squares solutions. */ |
| 50 | /* for k .le. min(n,p), let xk be the matrix */ |
| 51 | |
| 52 | /* xk = (x(jpvt(1)),x(jpvt(2)), ... ,x(jpvt(k))) */ |
| 53 | |
| 54 | /* formed from columns jpvt(1), ... ,jpvt(k) of the original */ |
| 55 | /* n x p matrix x that was input to sqrdc (if no pivoting was */ |
| 56 | /* done, xk consists of the first k columns of x in their */ |
| 57 | /* original order). sqrdc produces a factored orthogonal matrix q */ |
| 58 | /* and an upper triangular matrix r such that */ |
| 59 | |
| 60 | /* xk = q * (r) */ |
| 61 | /* (0) */ |
| 62 | |
| 63 | /* this information is contained in coded form in the arrays */ |
| 64 | /* x and qraux. */ |
| 65 | |
| 66 | /* on entry */ |
| 67 | |
| 68 | /* x real(ldx,p). */ |
| 69 | /* x contains the output of sqrdc. */ |
| 70 | |
| 71 | /* ldx integer. */ |
| 72 | /* ldx is the leading dimension of the array x. */ |
| 73 | |
| 74 | /* n integer. */ |
| 75 | /* n is the number of rows of the matrix xk. it must */ |
| 76 | /* have the same value as n in sqrdc. */ |
| 77 | |
| 78 | /* k integer. */ |
| 79 | /* k is the number of columns of the matrix xk. k */ |
| 80 | /* must nnot be greater than min(n,p), where p is the */ |
| 81 | /* same as in the calling sequence to sqrdc. */ |
| 82 | |
| 83 | /* qraux real(p). */ |
| 84 | /* qraux contains the auxiliary output from sqrdc. */ |
| 85 | |
| 86 | /* y real(n) */ |
| 87 | /* y contains an n-vector that is to be manipulated */ |
| 88 | /* by sqrsl. */ |
| 89 | |
| 90 | /* job integer. */ |
| 91 | /* job specifies what is to be computed. job has */ |
| 92 | /* the decimal expansion abcde, with the following */ |
| 93 | /* meaning. */ |
| 94 | |
| 95 | /* if a.ne.0, compute qy. */ |
| 96 | /* if b,c,d, or e .ne. 0, compute qty. */ |
| 97 | /* if c.ne.0, compute b. */ |
| 98 | /* if d.ne.0, compute rsd. */ |
| 99 | /* if e.ne.0, compute xb. */ |
| 100 | |
| 101 | /* note that a request to compute b, rsd, or xb */ |
| 102 | /* automatically triggers the computation of qty, for */ |
| 103 | /* which an array must be provided in the calling */ |
| 104 | /* sequence. */ |
| 105 | |
| 106 | /* on return */ |
| 107 | |
| 108 | /* qy real(n). */ |
| 109 | /* qy conntains q*y, if its computation has been */ |
| 110 | /* requested. */ |
| 111 | |
| 112 | /* qty real(n). */ |
| 113 | /* qty contains trans(q)*y, if its computation has */ |
| 114 | /* been requested. here trans(q) is the */ |
| 115 | /* transpose of the matrix q. */ |
| 116 | |
| 117 | /* b real(k) */ |
| 118 | /* b contains the solution of the least squares problem */ |
| 119 | |
| 120 | /* minimize norm2(y - xk*b), */ |
| 121 | |
| 122 | /* if its computation has been requested. (note that */ |
| 123 | /* if pivoting was requested in sqrdc, the j-th */ |
| 124 | /* component of b will be associated with column jpvt(j) */ |
| 125 | /* of the original matrix x that was input into sqrdc.) */ |
| 126 | |
| 127 | /* rsd real(n). */ |
| 128 | /* rsd contains the least squares residual y - xk*b, */ |
| 129 | /* if its computation has been requested. rsd is */ |
| 130 | /* also the orthogonal projection of y onto the */ |
| 131 | /* orthogonal complement of the column space of xk. */ |
| 132 | |
| 133 | /* xb real(n). */ |
| 134 | /* xb contains the least squares approximation xk*b, */ |
| 135 | /* if its computation has been requested. xb is also */ |
| 136 | /* the orthogonal projection of y onto the column space */ |
| 137 | /* of x. */ |
| 138 | |
| 139 | /* info integer. */ |
| 140 | /* info is zero unless the computation of b has */ |
| 141 | /* been requested and r is exactly singular. in */ |
| 142 | /* this case, info is the index of the first zero */ |
| 143 | /* diagonal element of r and b is left unaltered. */ |
| 144 | |
| 145 | /* the parameters qy, qty, b, rsd, and xb are not referenced */ |
| 146 | /* if their computation is not requested and in this case */ |
| 147 | /* can be replaced by dummy variables in the calling program. */ |
| 148 | /* to save storage, the user may in some cases use the same */ |
| 149 | /* array for different parameters in the calling sequence. a */ |
| 150 | /* frequently occurring example is when one wishes to compute */ |
| 151 | /* any of b, rsd, or xb and does not need y or qty. in this */ |
| 152 | /* case one may identify y, qty, and one of b, rsd, or xb, while */ |
| 153 | /* providing separate arrays for anything else that is to be */ |
| 154 | /* computed. thus the calling sequence */ |
| 155 | |
| 156 | /* call sqrsl(x,ldx,n,k,qraux,y,dum,y,b,y,dum,110,info) */ |
| 157 | |
| 158 | /* will result in the computation of b and rsd, with rsd */ |
| 159 | /* overwriting y. more generally, each item in the following */ |
| 160 | /* list contains groups of permissible identifications for */ |
| 161 | /* a single callinng sequence. */ |
| 162 | |
| 163 | /* 1. (y,qty,b) (rsd) (xb) (qy) */ |
| 164 | |
| 165 | /* 2. (y,qty,rsd) (b) (xb) (qy) */ |
| 166 | |
| 167 | /* 3. (y,qty,xb) (b) (rsd) (qy) */ |
| 168 | |
| 169 | /* 4. (y,qy) (qty,b) (rsd) (xb) */ |
| 170 | |
| 171 | /* 5. (y,qy) (qty,rsd) (b) (xb) */ |
| 172 | |
| 173 | /* 6. (y,qy) (qty,xb) (b) (rsd) */ |
| 174 | |
| 175 | /* in any group the value returned in the array allocated to */ |
| 176 | /* the group corresponds to the last member of the group. */ |
| 177 | |
| 178 | /* linpack. this version dated 08/14/78 . */ |
| 179 | /* g.w. stewart, university of maryland, argonne national lab. */ |
| 180 | |
| 181 | /* sqrsl uses the following functions and subprograms. */ |
| 182 | |
| 183 | /* blas saxpy,scopy,sdot */ |
| 184 | /* fortran abs,min0,mod */ |
| 185 | |
| 186 | /* internal variables */ |
| 187 | |
| 188 | /*< integer i,j,jj,ju,kp1 >*/ |
| 189 | /*< real sdot,t,temp >*/ |
| 190 | /*< logical cb,cqy,cqty,cr,cxb >*/ |
| 191 | |
| 192 | |
| 193 | /* set info flag. */ |
| 194 | |
| 195 | /*< info = 0 >*/ |
| 196 | /* Parameter adjustments */ |
| 197 | x_dim1 = *ldx; |
| 198 | x_offset = 1 + x_dim1; |
| 199 | x -= x_offset; |
| 200 | --qraux; |
| 201 | --y; |
| 202 | --qy; |
| 203 | --qty; |
| 204 | --b; |
| 205 | --rsd; |
| 206 | --xb; |
| 207 | |
| 208 | /* Function Body */ |
| 209 | *info = 0; |
| 210 | |
| 211 | /* determine what is to be computed. */ |
| 212 | |
| 213 | /*< cqy = job/10000 .ne. 0 >*/ |
| 214 | cqy = *job / 10000 != 0; |
| 215 | /*< cqty = mod(job,10000) .ne. 0 >*/ |
| 216 | cqty = *job % 10000 != 0; |
| 217 | /*< cb = mod(job,1000)/100 .ne. 0 >*/ |
| 218 | cb = *job % 1000 / 100 != 0; |
| 219 | /*< cr = mod(job,100)/10 .ne. 0 >*/ |
| 220 | cr = *job % 100 / 10 != 0; |
| 221 | /*< cxb = mod(job,10) .ne. 0 >*/ |
| 222 | cxb = *job % 10 != 0; |
| 223 | /*< ju = min0(k,n-1) >*/ |
| 224 | /* Computing MIN */ |
| 225 | i__1 = *k, i__2 = *n - 1; |
| 226 | ju = mincxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:159:9`!(i__1,i__2); |
| 227 | |
| 228 | /* special action when n=1. */ |
| 229 | |
| 230 | /*< if (ju .ne. 0) go to 40 >*/ |
| 231 | if (ju != 0) { |
| 232 | goto L40; |
| 233 | } |
| 234 | /*< if (cqy) qy(1) = y(1) >*/ |
| 235 | if (cqy) { |
| 236 | qy[1] = y[1]; |
| 237 | } |
| 238 | /*< if (cqty) qty(1) = y(1) >*/ |
| 239 | if (cqty) { |
| 240 | qty[1] = y[1]; |
| 241 | } |
| 242 | /*< if (cxb) xb(1) = y(1) >*/ |
| 243 | if (cxb) { |
| 244 | xb[1] = y[1]; |
| 245 | } |
| 246 | /*< if (.not.cb) go to 30 >*/ |
| 247 | if (! cb) { |
| 248 | goto L30; |
| 249 | } |
| 250 | /*< if (x(1,1) .ne. 0.0e0) go to 10 >*/ |
| 251 | if (x[x_dim1 + 1] != (float)0.) { |
| 252 | goto L10; |
| 253 | } |
| 254 | /*< info = 1 >*/ |
| 255 | *info = 1; |
| 256 | /*< go to 20 >*/ |
| 257 | goto L20; |
| 258 | /*< 10 continue >*/ |
| 259 | L10: |
| 260 | /*< b(1) = y(1)/x(1,1) >*/ |
| 261 | b[1] = y[1] / x[x_dim1 + 1]; |
| 262 | /*< 20 continue >*/ |
| 263 | L20: |
| 264 | /*< 30 continue >*/ |
| 265 | L30: |
| 266 | /*< if (cr) rsd(1) = 0.0e0 >*/ |
| 267 | if (cr) { |
| 268 | rsd[1] = (float)0.; |
| 269 | } |
| 270 | /*< go to 250 >*/ |
| 271 | goto L250; |
| 272 | /*< 40 continue >*/ |
| 273 | L40: |
| 274 | |
| 275 | /* set up to compute qy or qty. */ |
| 276 | |
| 277 | /*< if (cqy) call scopy(n,y,1,qy,1) >*/ |
| 278 | if (cqy) { |
| 279 | scopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:230:9`!(n, &y[1], &c__1cxx . . $ c__1., &qy[1], &c__1cxx . . $ c__1.); |
| 280 | } |
| 281 | /*< if (cqty) call scopy(n,y,1,qty,1) >*/ |
| 282 | if (cqty) { |
| 283 | scopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:230:9`!(n, &y[1], &c__1cxx . . $ c__1., &qty[1], &c__1cxx . . $ c__1.); |
| 284 | } |
| 285 | /*< if (.not.cqy) go to 70 >*/ |
| 286 | if (! cqy) { |
| 287 | goto L70; |
| 288 | } |
| 289 | |
| 290 | /* compute qy. */ |
| 291 | |
| 292 | /*< do 60 jj = 1, ju >*/ |
| 293 | i__1 = ju; |
| 294 | for (jj = 1; jj <= i__1; ++jj) { |
| 295 | /*< j = ju - jj + 1 >*/ |
| 296 | j = ju - jj + 1; |
| 297 | /*< if (qraux(j) .eq. 0.0e0) go to 50 >*/ |
| 298 | if (qraux[j] == (float)0.) { |
| 299 | goto L50; |
| 300 | } |
| 301 | /*< temp = x(j,j) >*/ |
| 302 | temp = x[j + j * x_dim1]; |
| 303 | /*< x(j,j) = qraux(j) >*/ |
| 304 | x[j + j * x_dim1] = qraux[j]; |
| 305 | /*< t = -sdot(n-j+1,x(j,j),1,qy(j),1)/x(j,j) >*/ |
| 306 | i__2 = *n - j + 1; |
| 307 | t = -sdot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:232:9`!(&i__2, &x[j + j * x_dim1], &c__1cxx . . $ c__1., &qy[j], &c__1cxx . . $ c__1.) / x[j + j |
| 308 | * x_dim1]; |
| 309 | /*< call saxpy(n-j+1,t,x(j,j),1,qy(j),1) >*/ |
| 310 | i__2 = *n - j + 1; |
| 311 | saxpy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:221:9`!(&i__2, &t, &x[j + j * x_dim1], &c__1cxx . . $ c__1., &qy[j], &c__1cxx . . $ c__1.); |
| 312 | /*< x(j,j) = temp >*/ |
| 313 | x[j + j * x_dim1] = temp; |
| 314 | /*< 50 continue >*/ |
| 315 | L50: |
| 316 | /*< 60 continue >*/ |
| 317 | /* L60: */ |
| 318 | ; |
| 319 | } |
| 320 | /*< 70 continue >*/ |
| 321 | L70: |
| 322 | /*< if (.not.cqty) go to 100 >*/ |
| 323 | if (! cqty) { |
| 324 | goto L100; |
| 325 | } |
| 326 | |
| 327 | /* compute trans(q)*y. */ |
| 328 | |
| 329 | /*< do 90 j = 1, ju >*/ |
| 330 | i__1 = ju; |
| 331 | for (j = 1; j <= i__1; ++j) { |
| 332 | /*< if (qraux(j) .eq. 0.0e0) go to 80 >*/ |
| 333 | if (qraux[j] == (float)0.) { |
| 334 | goto L80; |
| 335 | } |
| 336 | /*< temp = x(j,j) >*/ |
| 337 | temp = x[j + j * x_dim1]; |
| 338 | /*< x(j,j) = qraux(j) >*/ |
| 339 | x[j + j * x_dim1] = qraux[j]; |
| 340 | /*< t = -sdot(n-j+1,x(j,j),1,qty(j),1)/x(j,j) >*/ |
| 341 | i__2 = *n - j + 1; |
| 342 | t = -sdot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:232:9`!(&i__2, &x[j + j * x_dim1], &c__1cxx . . $ c__1., &qty[j], &c__1cxx . . $ c__1.) / x[j + |
| 343 | j * x_dim1]; |
| 344 | /*< call saxpy(n-j+1,t,x(j,j),1,qty(j),1) >*/ |
| 345 | i__2 = *n - j + 1; |
| 346 | saxpy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:221:9`!(&i__2, &t, &x[j + j * x_dim1], &c__1cxx . . $ c__1., &qty[j], &c__1cxx . . $ c__1.); |
| 347 | /*< x(j,j) = temp >*/ |
| 348 | x[j + j * x_dim1] = temp; |
| 349 | /*< 80 continue >*/ |
| 350 | L80: |
| 351 | /*< 90 continue >*/ |
| 352 | /* L90: */ |
| 353 | ; |
| 354 | } |
| 355 | /*< 100 continue >*/ |
| 356 | L100: |
| 357 | |
| 358 | /* set up to compute b, rsd, or xb. */ |
| 359 | |
| 360 | /*< if (cb) call scopy(k,qty,1,b,1) >*/ |
| 361 | if (cb) { |
| 362 | scopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:230:9`!(k, &qty[1], &c__1cxx . . $ c__1., &b[1], &c__1cxx . . $ c__1.); |
| 363 | } |
| 364 | /*< kp1 = k + 1 >*/ |
| 365 | kp1 = *k + 1; |
| 366 | /*< if (cxb) call scopy(k,qty,1,xb,1) >*/ |
| 367 | if (cxb) { |
| 368 | scopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:230:9`!(k, &qty[1], &c__1cxx . . $ c__1., &xb[1], &c__1cxx . . $ c__1.); |
| 369 | } |
| 370 | /*< if (cr .and. k .lt. n) call scopy(n-k,qty(kp1),1,rsd(kp1),1) >*/ |
| 371 | if (cr && *k < *n) { |
| 372 | i__1 = *n - *k; |
| 373 | scopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:230:9`!(&i__1, &qty[kp1], &c__1cxx . . $ c__1., &rsd[kp1], &c__1cxx . . $ c__1.); |
| 374 | } |
| 375 | /*< if (.not.cxb .or. kp1 .gt. n) go to 120 >*/ |
| 376 | if (! cxb || kp1 > *n) { |
| 377 | goto L120; |
| 378 | } |
| 379 | /*< do 110 i = kp1, n >*/ |
| 380 | i__1 = *n; |
| 381 | for (i__ = kp1; i__ <= i__1; ++i__) { |
| 382 | /*< xb(i) = 0.0e0 >*/ |
| 383 | xb[i__] = (float)0.; |
| 384 | /*< 110 continue >*/ |
| 385 | /* L110: */ |
| 386 | } |
| 387 | /*< 120 continue >*/ |
| 388 | L120: |
| 389 | /*< if (.not.cr) go to 140 >*/ |
| 390 | if (! cr) { |
| 391 | goto L140; |
| 392 | } |
| 393 | /*< do 130 i = 1, k >*/ |
| 394 | i__1 = *k; |
| 395 | for (i__ = 1; i__ <= i__1; ++i__) { |
| 396 | /*< rsd(i) = 0.0e0 >*/ |
| 397 | rsd[i__] = (float)0.; |
| 398 | /*< 130 continue >*/ |
| 399 | /* L130: */ |
| 400 | } |
| 401 | /*< 140 continue >*/ |
| 402 | L140: |
| 403 | /*< if (.not.cb) go to 190 >*/ |
| 404 | if (! cb) { |
| 405 | goto L190; |
| 406 | } |
| 407 | |
| 408 | /* compute b. */ |
| 409 | |
| 410 | /*< do 170 jj = 1, k >*/ |
| 411 | i__1 = *k; |
| 412 | for (jj = 1; jj <= i__1; ++jj) { |
| 413 | /*< j = k - jj + 1 >*/ |
| 414 | j = *k - jj + 1; |
| 415 | /*< if (x(j,j) .ne. 0.0e0) go to 150 >*/ |
| 416 | if (x[j + j * x_dim1] != (float)0.) { |
| 417 | goto L150; |
| 418 | } |
| 419 | /*< info = j >*/ |
| 420 | *info = j; |
| 421 | /* ......exit */ |
| 422 | /*< go to 180 >*/ |
| 423 | goto L180; |
| 424 | /*< 150 continue >*/ |
| 425 | L150: |
| 426 | /*< b(j) = b(j)/x(j,j) >*/ |
| 427 | b[j] /= x[j + j * x_dim1]; |
| 428 | /*< if (j .eq. 1) go to 160 >*/ |
| 429 | if (j == 1) { |
| 430 | goto L160; |
| 431 | } |
| 432 | /*< t = -b(j) >*/ |
| 433 | t = -b[j]; |
| 434 | /*< call saxpy(j-1,t,x(1,j),1,b,1) >*/ |
| 435 | i__2 = j - 1; |
| 436 | saxpy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:221:9`!(&i__2, &t, &x[j * x_dim1 + 1], &c__1cxx . . $ c__1., &b[1], &c__1cxx . . $ c__1.); |
| 437 | /*< 160 continue >*/ |
| 438 | L160: |
| 439 | /*< 170 continue >*/ |
| 440 | /* L170: */ |
| 441 | ; |
| 442 | } |
| 443 | /*< 180 continue >*/ |
| 444 | L180: |
| 445 | /*< 190 continue >*/ |
| 446 | L190: |
| 447 | /*< if (.not.cr .and. .not.cxb) go to 240 >*/ |
| 448 | if (! cr && ! cxb) { |
| 449 | goto L240; |
| 450 | } |
| 451 | |
| 452 | /* compute rsd or xb as required. */ |
| 453 | |
| 454 | /*< do 230 jj = 1, ju >*/ |
| 455 | i__1 = ju; |
| 456 | for (jj = 1; jj <= i__1; ++jj) { |
| 457 | /*< j = ju - jj + 1 >*/ |
| 458 | j = ju - jj + 1; |
| 459 | /*< if (qraux(j) .eq. 0.0e0) go to 220 >*/ |
| 460 | if (qraux[j] == (float)0.) { |
| 461 | goto L220; |
| 462 | } |
| 463 | /*< temp = x(j,j) >*/ |
| 464 | temp = x[j + j * x_dim1]; |
| 465 | /*< x(j,j) = qraux(j) >*/ |
| 466 | x[j + j * x_dim1] = qraux[j]; |
| 467 | /*< if (.not.cr) go to 200 >*/ |
| 468 | if (! cr) { |
| 469 | goto L200; |
| 470 | } |
| 471 | /*< t = -sdot(n-j+1,x(j,j),1,rsd(j),1)/x(j,j) >*/ |
| 472 | i__2 = *n - j + 1; |
| 473 | t = -sdot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:232:9`!(&i__2, &x[j + j * x_dim1], &c__1cxx . . $ c__1., &rsd[j], &c__1cxx . . $ c__1.) / x[j + |
| 474 | j * x_dim1]; |
| 475 | /*< call saxpy(n-j+1,t,x(j,j),1,rsd(j),1) >*/ |
| 476 | i__2 = *n - j + 1; |
| 477 | saxpy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:221:9`!(&i__2, &t, &x[j + j * x_dim1], &c__1cxx . . $ c__1., &rsd[j], &c__1cxx . . $ c__1.); |
| 478 | /*< 200 continue >*/ |
| 479 | L200: |
| 480 | /*< if (.not.cxb) go to 210 >*/ |
| 481 | if (! cxb) { |
| 482 | goto L210; |
| 483 | } |
| 484 | /*< t = -sdot(n-j+1,x(j,j),1,xb(j),1)/x(j,j) >*/ |
| 485 | i__2 = *n - j + 1; |
| 486 | t = -sdot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:232:9`!(&i__2, &x[j + j * x_dim1], &c__1cxx . . $ c__1., &xb[j], &c__1cxx . . $ c__1.) / x[j + j |
| 487 | * x_dim1]; |
| 488 | /*< call saxpy(n-j+1,t,x(j,j),1,xb(j),1) >*/ |
| 489 | i__2 = *n - j + 1; |
| 490 | saxpy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:221:9`!(&i__2, &t, &x[j + j * x_dim1], &c__1cxx . . $ c__1., &xb[j], &c__1cxx . . $ c__1.); |
| 491 | /*< 210 continue >*/ |
| 492 | L210: |
| 493 | /*< x(j,j) = temp >*/ |
| 494 | x[j + j * x_dim1] = temp; |
| 495 | /*< 220 continue >*/ |
| 496 | L220: |
| 497 | /*< 230 continue >*/ |
| 498 | /* L230: */ |
| 499 | ; |
| 500 | } |
| 501 | /*< 240 continue >*/ |
| 502 | L240: |
| 503 | /*< 250 continue >*/ |
| 504 | L250: |
| 505 | /*< return >*/ |
| 506 | return 0; |
| 507 | /*< end >*/ |
| 508 | } /* sqrsl_ */ |
| 509 | |
| 510 | #ifdef __cplusplus |
| 511 | } |
| 512 | #endif |