| 1 | /* arpack/dsaitr.f -- translated by f2c (version 20090411). |
| 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 | /* Common Block Declarations */ |
| 19 | |
| 20 | /*Extern struct { */ |
| 21 | /* integer logfil, ndigit, mgetv0, msaupd, msaup2, msaitr, mseigt, msapps, */ |
| 22 | /* msgets, mseupd, mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, */ |
| 23 | /* mneupd, mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd; */ |
| 24 | /*} debug_; */ |
| 25 | |
| 26 | /*#define debug_1 debug_ */ |
| 27 | |
| 28 | /*Extern struct { */ |
| 29 | /* integer nopx, nbx, nrorth, nitref, nrstrt; */ |
| 30 | /* real tsaupd, tsaup2, tsaitr, tseigt, tsgets, tsapps, tsconv, tnaupd, */ |
| 31 | /* tnaup2, tnaitr, tneigh, tngets, tnapps, tnconv, tcaupd, tcaup2, */ |
| 32 | /* tcaitr, tceigh, tcgets, tcapps, tcconv, tmvopx, tmvbx, tgetv0, */ |
| 33 | /* titref, trvec; */ |
| 34 | /*} timing_; */ |
| 35 | |
| 36 | /*#define timing_1 timing_ */ |
| 37 | |
| 38 | /* Table of constant values */ |
| 39 | |
| 40 | static logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! c_falsecxx . . $ c_false. = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 41 | static integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! c__1cxx . . $ c__1. = 1; |
| 42 | static doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! c_b18cxx . . $ c_b18. = 1.; |
| 43 | static doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! c_b43cxx . . $ c_b43. = 0.; |
| 44 | static doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! c_b51cxx . . $ c_b51. = -1.; |
| 45 | |
| 46 | /* ----------------------------------------------------------------------- */ |
| 47 | /* \BeginDoc */ |
| 48 | |
| 49 | /* \Name: dsaitr */ |
| 50 | |
| 51 | /* \Description: */ |
| 52 | /* Reverse communication interface for applying NP additional steps to */ |
| 53 | /* a K step symmetric Arnoldi factorization. */ |
| 54 | |
| 55 | /* Input: OP*V_{k} - V_{k}*H = r_{k}*e_{k}^T */ |
| 56 | |
| 57 | /* with (V_{k}^T)*B*V_{k} = I, (V_{k}^T)*B*r_{k} = 0. */ |
| 58 | |
| 59 | /* Output: OP*V_{k+p} - V_{k+p}*H = r_{k+p}*e_{k+p}^T */ |
| 60 | |
| 61 | /* with (V_{k+p}^T)*B*V_{k+p} = I, (V_{k+p}^T)*B*r_{k+p} = 0. */ |
| 62 | |
| 63 | /* where OP and B are as in dsaupd. The B-norm of r_{k+p} is also */ |
| 64 | /* computed and returned. */ |
| 65 | |
| 66 | /* \Usage: */ |
| 67 | /* call dsaitr */ |
| 68 | /* ( IDO, BMAT, N, K, NP, MODE, RESID, RNORM, V, LDV, H, LDH, */ |
| 69 | /* IPNTR, WORKD, INFO ) */ |
| 70 | |
| 71 | /* \Arguments */ |
| 72 | /* IDO Integer. (INPUT/OUTPUT) */ |
| 73 | /* Reverse communication flag. */ |
| 74 | /* ------------------------------------------------------------- */ |
| 75 | /* IDO = 0: first call to the reverse communication interface */ |
| 76 | /* IDO = -1: compute Y = OP * X where */ |
| 77 | /* IPNTR(1) is the pointer into WORK for X, */ |
| 78 | /* IPNTR(2) is the pointer into WORK for Y. */ |
| 79 | /* This is for the restart phase to force the new */ |
| 80 | /* starting vector into the range of OP. */ |
| 81 | /* IDO = 1: compute Y = OP * X where */ |
| 82 | /* IPNTR(1) is the pointer into WORK for X, */ |
| 83 | /* IPNTR(2) is the pointer into WORK for Y, */ |
| 84 | /* IPNTR(3) is the pointer into WORK for B * X. */ |
| 85 | /* IDO = 2: compute Y = B * X where */ |
| 86 | /* IPNTR(1) is the pointer into WORK for X, */ |
| 87 | /* IPNTR(2) is the pointer into WORK for Y. */ |
| 88 | /* IDO = 99: done */ |
| 89 | /* ------------------------------------------------------------- */ |
| 90 | /* When the routine is used in the "shift-and-invert" mode, the */ |
| 91 | /* vector B * Q is already available and does not need to be */ |
| 92 | /* recomputed in forming OP * Q. */ |
| 93 | |
| 94 | /* BMAT Character*1. (INPUT) */ |
| 95 | /* BMAT specifies the type of matrix B that defines the */ |
| 96 | /* semi-inner product for the operator OP. See dsaupd. */ |
| 97 | /* B = 'I' -> standard eigenvalue problem A*x = lambda*x */ |
| 98 | /* B = 'G' -> generalized eigenvalue problem A*x = lambda*M*x */ |
| 99 | |
| 100 | /* N Integer. (INPUT) */ |
| 101 | /* Dimension of the eigenproblem. */ |
| 102 | |
| 103 | /* K Integer. (INPUT) */ |
| 104 | /* Current order of H and the number of columns of V. */ |
| 105 | |
| 106 | /* NP Integer. (INPUT) */ |
| 107 | /* Number of additional Arnoldi steps to take. */ |
| 108 | |
| 109 | /* MODE Integer. (INPUT) */ |
| 110 | /* Signifies which form for "OP". If MODE=2 then */ |
| 111 | /* a reduction in the number of B matrix vector multiplies */ |
| 112 | /* is possible since the B-norm of OP*x is equivalent to */ |
| 113 | /* the inv(B)-norm of A*x. */ |
| 114 | |
| 115 | /* RESID Double precision array of length N. (INPUT/OUTPUT) */ |
| 116 | /* On INPUT: RESID contains the residual vector r_{k}. */ |
| 117 | /* On OUTPUT: RESID contains the residual vector r_{k+p}. */ |
| 118 | |
| 119 | /* RNORM Double precision scalar. (INPUT/OUTPUT) */ |
| 120 | /* On INPUT the B-norm of r_{k}. */ |
| 121 | /* On OUTPUT the B-norm of the updated residual r_{k+p}. */ |
| 122 | |
| 123 | /* V Double precision N by K+NP array. (INPUT/OUTPUT) */ |
| 124 | /* On INPUT: V contains the Arnoldi vectors in the first K */ |
| 125 | /* columns. */ |
| 126 | /* On OUTPUT: V contains the new NP Arnoldi vectors in the next */ |
| 127 | /* NP columns. The first K columns are unchanged. */ |
| 128 | |
| 129 | /* LDV Integer. (INPUT) */ |
| 130 | /* Leading dimension of V exactly as declared in the calling */ |
| 131 | /* program. */ |
| 132 | |
| 133 | /* H Double precision (K+NP) by 2 array. (INPUT/OUTPUT) */ |
| 134 | /* H is used to store the generated symmetric tridiagonal matrix */ |
| 135 | /* with the subdiagonal in the first column starting at H(2,1) */ |
| 136 | /* and the main diagonal in the second column. */ |
| 137 | |
| 138 | /* LDH Integer. (INPUT) */ |
| 139 | /* Leading dimension of H exactly as declared in the calling */ |
| 140 | /* program. */ |
| 141 | |
| 142 | /* IPNTR Integer array of length 3. (OUTPUT) */ |
| 143 | /* Pointer to mark the starting locations in the WORK for */ |
| 144 | /* vectors used by the Arnoldi iteration. */ |
| 145 | /* ------------------------------------------------------------- */ |
| 146 | /* IPNTR(1): pointer to the current operand vector X. */ |
| 147 | /* IPNTR(2): pointer to the current result vector Y. */ |
| 148 | /* IPNTR(3): pointer to the vector B * X when used in the */ |
| 149 | /* shift-and-invert mode. X is the current operand. */ |
| 150 | /* ------------------------------------------------------------- */ |
| 151 | |
| 152 | /* WORKD Double precision work array of length 3*N. (REVERSE COMMUNICATION) */ |
| 153 | /* Distributed array to be used in the basic Arnoldi iteration */ |
| 154 | /* for reverse communication. The calling program should not */ |
| 155 | /* use WORKD as temporary workspace during the iteration !!!!!! */ |
| 156 | /* On INPUT, WORKD(1:N) = B*RESID where RESID is associated */ |
| 157 | /* with the K step Arnoldi factorization. Used to save some */ |
| 158 | /* computation at the first step. */ |
| 159 | /* On OUTPUT, WORKD(1:N) = B*RESID where RESID is associated */ |
| 160 | /* with the K+NP step Arnoldi factorization. */ |
| 161 | |
| 162 | /* INFO Integer. (OUTPUT) */ |
| 163 | /* = 0: Normal exit. */ |
| 164 | /* > 0: Size of an invariant subspace of OP is found that is */ |
| 165 | /* less than K + NP. */ |
| 166 | |
| 167 | /* \EndDoc */ |
| 168 | |
| 169 | /* ----------------------------------------------------------------------- */ |
| 170 | |
| 171 | /* \BeginLib */ |
| 172 | |
| 173 | /* \Local variables: */ |
| 174 | /* xxxxxx real */ |
| 175 | |
| 176 | /* \Routines called: */ |
| 177 | /* dgetv0 ARPACK routine to generate the initial vector. */ |
| 178 | /* ivout ARPACK utility routine that prints integers. */ |
| 179 | /* dmout ARPACK utility routine that prints matrices. */ |
| 180 | /* dlamch LAPACK routine that determines machine constants. */ |
| 181 | /* dlascl LAPACK routine for careful scaling of a matrix. */ |
| 182 | /* dgemv Level 2 BLAS routine for matrix vector multiplication. */ |
| 183 | /* daxpy Level 1 BLAS that computes a vector triad. */ |
| 184 | /* dscal Level 1 BLAS that scales a vector. */ |
| 185 | /* dcopy Level 1 BLAS that copies one vector to another . */ |
| 186 | /* ddot Level 1 BLAS that computes the scalar product of two vectors. */ |
| 187 | /* dnrm2 Level 1 BLAS that computes the norm of a vector. */ |
| 188 | |
| 189 | /* \Author */ |
| 190 | /* Danny Sorensen Phuong Vu */ |
| 191 | /* Richard Lehoucq CRPC / Rice University */ |
| 192 | /* Dept. of Computational & Houston, Texas */ |
| 193 | /* Applied Mathematics */ |
| 194 | /* Rice University */ |
| 195 | /* Houston, Texas */ |
| 196 | |
| 197 | /* \Revision history: */ |
| 198 | /* xx/xx/93: Version ' 2.4' */ |
| 199 | |
| 200 | /* \SCCS Information: @(#) */ |
| 201 | /* FILE: saitr.F SID: 2.6 DATE OF SID: 8/28/96 RELEASE: 2 */ |
| 202 | |
| 203 | /* \Remarks */ |
| 204 | /* The algorithm implemented is: */ |
| 205 | |
| 206 | /* restart = .false. */ |
| 207 | /* Given V_{k} = [v_{1}, ..., v_{k}], r_{k}; */ |
| 208 | /* r_{k} contains the initial residual vector even for k = 0; */ |
| 209 | /* Also assume that rnorm = || B*r_{k} || and B*r_{k} are already */ |
| 210 | /* computed by the calling program. */ |
| 211 | |
| 212 | /* betaj = rnorm ; p_{k+1} = B*r_{k} ; */ |
| 213 | /* For j = k+1, ..., k+np Do */ |
| 214 | /* 1) if ( betaj < tol ) stop or restart depending on j. */ |
| 215 | /* if ( restart ) generate a new starting vector. */ |
| 216 | /* 2) v_{j} = r(j-1)/betaj; V_{j} = [V_{j-1}, v_{j}]; */ |
| 217 | /* p_{j} = p_{j}/betaj */ |
| 218 | /* 3) r_{j} = OP*v_{j} where OP is defined as in dsaupd */ |
| 219 | /* For shift-invert mode p_{j} = B*v_{j} is already available. */ |
| 220 | /* wnorm = || OP*v_{j} || */ |
| 221 | /* 4) Compute the j-th step residual vector. */ |
| 222 | /* w_{j} = V_{j}^T * B * OP * v_{j} */ |
| 223 | /* r_{j} = OP*v_{j} - V_{j} * w_{j} */ |
| 224 | /* alphaj <- j-th component of w_{j} */ |
| 225 | /* rnorm = || r_{j} || */ |
| 226 | /* betaj+1 = rnorm */ |
| 227 | /* If (rnorm > 0.717*wnorm) accept step and go back to 1) */ |
| 228 | /* 5) Re-orthogonalization step: */ |
| 229 | /* s = V_{j}'*B*r_{j} */ |
| 230 | /* r_{j} = r_{j} - V_{j}*s; rnorm1 = || r_{j} || */ |
| 231 | /* alphaj = alphaj + s_{j}; */ |
| 232 | /* 6) Iterative refinement step: */ |
| 233 | /* If (rnorm1 > 0.717*rnorm) then */ |
| 234 | /* rnorm = rnorm1 */ |
| 235 | /* accept step and go back to 1) */ |
| 236 | /* Else */ |
| 237 | /* rnorm = rnorm1 */ |
| 238 | /* If this is the first time in step 6), go to 5) */ |
| 239 | /* Else r_{j} lies in the span of V_{j} numerically. */ |
| 240 | /* Set r_{j} = 0 and rnorm = 0; go to 1) */ |
| 241 | /* EndIf */ |
| 242 | /* End Do */ |
| 243 | |
| 244 | /* \EndLib */ |
| 245 | |
| 246 | /* ----------------------------------------------------------------------- */ |
| 247 | |
| 248 | /*< >*/ |
| 249 | /* Subroutine */ int dsaitr_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:128:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ido, char *bmat, 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, |
| 250 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *np, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *mode, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *resid, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *rnorm, |
| 251 | doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *v, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ldv, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *h__, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ldh, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! * |
| 252 | ipntr, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *workd, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *info, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`! bmat_len) |
| 253 | { |
| 254 | /* Initialized data */ |
| 255 | |
| 256 | 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`!; |
| 257 | |
| 258 | /* System generated locals */ |
| 259 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! h_dim1, h_offset, v_dim1, v_offset, i__1; |
| 260 | |
| 261 | /* Builtin functions */ |
| 262 | double sqrtcxx . . $ sqrt(447c67c6676f75c3).(doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`!); |
| 263 | |
| 264 | /* Local variables */ |
| 265 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__; |
| 266 | static integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! j; |
| 267 | /* static real t0, t1, t2, t3, t4, t5; */ |
| 268 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! jj; |
| 269 | static integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! ipj, irj, ivj; |
| 270 | extern doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! ddot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:43:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63: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`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, |
| 271 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *); |
| 272 | static integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! ierr, iter, itry; |
| 273 | extern doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! dnrm2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:108:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63: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`! *); |
| 274 | doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! temp1; |
| 275 | static logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! orth1, orth2, step3, step4; |
| 276 | extern /* Subroutine */ int dscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:132:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, |
| 277 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *), dgemv_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:46:9`!(char *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, |
| 278 | 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`! *, 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`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, |
| 279 | 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`! *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!); |
| 280 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! infol; |
| 281 | extern /* Subroutine */ int dcopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:40:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63: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`! *, |
| 282 | 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`! *); |
| 283 | /* doublereal xtemp[2]; */ |
| 284 | static doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! wnorm; |
| 285 | extern /* Subroutine */ int dgetv0_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:53:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, char *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! |
| 286 | *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63: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`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, |
| 287 | 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`! *, 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`! *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!); |
| 288 | static doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! rnorm1; |
| 289 | 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`!); |
| 290 | extern /* Subroutine */ int dlascl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:95:9`!(char *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, |
| 291 | doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57: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`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, |
| 292 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!), second_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:233:9`!(realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *); |
| 293 | static doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! safmin; |
| 294 | static logicalcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:65:9`! rstart; |
| 295 | /* static integer msglvl; */ |
| 296 | |
| 297 | |
| 298 | /* %----------------------------------------------------% */ |
| 299 | /* | Include files for debugging and timing information | */ |
| 300 | /* %----------------------------------------------------% */ |
| 301 | |
| 302 | /*< include 'debug.h' >*/ |
| 303 | /*< include 'stat.h' >*/ |
| 304 | |
| 305 | /* \SCCS Information: @(#) */ |
| 306 | /* FILE: debug.h SID: 2.3 DATE OF SID: 11/16/95 RELEASE: 2 */ |
| 307 | |
| 308 | /* %---------------------------------% */ |
| 309 | /* | See debug.doc for documentation | */ |
| 310 | /* %---------------------------------% */ |
| 311 | /*< >*/ |
| 312 | /*< character bmat*1 >*/ |
| 313 | |
| 314 | /* %------------------% */ |
| 315 | /* | Scalar Arguments | */ |
| 316 | /* %------------------% */ |
| 317 | |
| 318 | /* %--------------------------------% */ |
| 319 | /* | See stat.doc for documentation | */ |
| 320 | /* %--------------------------------% */ |
| 321 | |
| 322 | /* \SCCS Information: @(#) */ |
| 323 | /* FILE: stat.h SID: 2.2 DATE OF SID: 11/16/95 RELEASE: 2 */ |
| 324 | |
| 325 | /*< save t0, t1, t2, t3, t4, t5 >*/ |
| 326 | |
| 327 | /*< integer nopx, nbx, nrorth, nitref, nrstrt >*/ |
| 328 | /*< >*/ |
| 329 | /*< >*/ |
| 330 | /*< integer ido, info, k, ldh, ldv, n, mode, np >*/ |
| 331 | /*< >*/ |
| 332 | |
| 333 | /* %-----------------% */ |
| 334 | /* | Array Arguments | */ |
| 335 | /* %-----------------% */ |
| 336 | |
| 337 | /*< integer ipntr(3) >*/ |
| 338 | /*< >*/ |
| 339 | |
| 340 | /* %------------% */ |
| 341 | /* | Parameters | */ |
| 342 | /* %------------% */ |
| 343 | |
| 344 | /*< >*/ |
| 345 | /*< parameter (one = 1.0D+0, zero = 0.0D+0) >*/ |
| 346 | |
| 347 | /* %---------------% */ |
| 348 | /* | Local Scalars | */ |
| 349 | /* %---------------% */ |
| 350 | |
| 351 | /*< logical first, orth1, orth2, rstart, step3, step4 >*/ |
| 352 | /*< >*/ |
| 353 | /*< >*/ |
| 354 | /*< >*/ |
| 355 | |
| 356 | /* %-----------------------% */ |
| 357 | /* | Local Array Arguments | */ |
| 358 | /* %-----------------------% */ |
| 359 | |
| 360 | /*< >*/ |
| 361 | |
| 362 | /* %----------------------% */ |
| 363 | /* | External Subroutines | */ |
| 364 | /* %----------------------% */ |
| 365 | |
| 366 | /*< >*/ |
| 367 | |
| 368 | /* %--------------------% */ |
| 369 | /* | External Functions | */ |
| 370 | /* %--------------------% */ |
| 371 | |
| 372 | /*< >*/ |
| 373 | /*< external ddot, dnrm2, dlamch >*/ |
| 374 | |
| 375 | /* %-----------------% */ |
| 376 | /* | Data statements | */ |
| 377 | /* %-----------------% */ |
| 378 | |
| 379 | /*< data first / .true. / >*/ |
| 380 | /* Parameter adjustments */ |
| 381 | --workd; |
| 382 | --resid; |
| 383 | v_dim1 = *ldv; |
| 384 | v_offset = 1 + v_dim1; |
| 385 | v -= v_offset; |
| 386 | h_dim1 = *ldh; |
| 387 | h_offset = 1 + h_dim1; |
| 388 | h__ -= h_offset; |
| 389 | --ipntr; |
| 390 | |
| 391 | /* Function Body */ |
| 392 | |
| 393 | /* %-----------------------% */ |
| 394 | /* | Executable Statements | */ |
| 395 | /* %-----------------------% */ |
| 396 | |
| 397 | /*< if (first) then >*/ |
| 398 | if (first) { |
| 399 | /*< first = .false. >*/ |
| 400 | first = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 401 | |
| 402 | /* %--------------------------------% */ |
| 403 | /* | safmin = safe minimum is such | */ |
| 404 | /* | that 1/sfmin does not overflow | */ |
| 405 | /* %--------------------------------% */ |
| 406 | |
| 407 | /*< safmin = dlamch('safmin') >*/ |
| 408 | safmin = dlamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:81:9`!("safmin", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)6); |
| 409 | /*< end if >*/ |
| 410 | } |
| 411 | |
| 412 | /*< if (ido .eq. 0) then >*/ |
| 413 | if (*ido == 0) { |
| 414 | |
| 415 | /* %-------------------------------% */ |
| 416 | /* | Initialize timing statistics | */ |
| 417 | /* | & message level for debugging | */ |
| 418 | /* %-------------------------------% */ |
| 419 | |
| 420 | /*< call second (t0) >*/ |
| 421 | /* second_(&t0); */ |
| 422 | /*< msglvl = msaitr >*/ |
| 423 | /* msglvl = debug_1.msaitr; */ |
| 424 | |
| 425 | /* %------------------------------% */ |
| 426 | /* | Initial call to this routine | */ |
| 427 | /* %------------------------------% */ |
| 428 | |
| 429 | /*< info = 0 >*/ |
| 430 | *info = 0; |
| 431 | /*< step3 = .false. >*/ |
| 432 | step3 = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 433 | /*< step4 = .false. >*/ |
| 434 | step4 = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 435 | /*< rstart = .false. >*/ |
| 436 | rstart = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 437 | /*< orth1 = .false. >*/ |
| 438 | orth1 = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 439 | /*< orth2 = .false. >*/ |
| 440 | orth2 = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 441 | |
| 442 | /* %--------------------------------% */ |
| 443 | /* | Pointer to the current step of | */ |
| 444 | /* | the factorization to build | */ |
| 445 | /* %--------------------------------% */ |
| 446 | |
| 447 | /*< j = k + 1 >*/ |
| 448 | j = *k + 1; |
| 449 | |
| 450 | /* %------------------------------------------% */ |
| 451 | /* | Pointers used for reverse communication | */ |
| 452 | /* | when using WORKD. | */ |
| 453 | /* %------------------------------------------% */ |
| 454 | |
| 455 | /*< ipj = 1 >*/ |
| 456 | ipj = 1; |
| 457 | /*< irj = ipj + n >*/ |
| 458 | irj = ipj + *n; |
| 459 | /*< ivj = irj + n >*/ |
| 460 | ivj = irj + *n; |
| 461 | /*< end if >*/ |
| 462 | } |
| 463 | |
| 464 | /* %-------------------------------------------------% */ |
| 465 | /* | When in reverse communication mode one of: | */ |
| 466 | /* | STEP3, STEP4, ORTH1, ORTH2, RSTART | */ |
| 467 | /* | will be .true. | */ |
| 468 | /* | STEP3: return from computing OP*v_{j}. | */ |
| 469 | /* | STEP4: return from computing B-norm of OP*v_{j} | */ |
| 470 | /* | ORTH1: return from computing B-norm of r_{j+1} | */ |
| 471 | /* | ORTH2: return from computing B-norm of | */ |
| 472 | /* | correction to the residual vector. | */ |
| 473 | /* | RSTART: return from OP computations needed by | */ |
| 474 | /* | dgetv0. | */ |
| 475 | /* %-------------------------------------------------% */ |
| 476 | |
| 477 | /*< if (step3) go to 50 >*/ |
| 478 | if (step3) { |
| 479 | goto L50; |
| 480 | } |
| 481 | /*< if (step4) go to 60 >*/ |
| 482 | if (step4) { |
| 483 | goto L60; |
| 484 | } |
| 485 | /*< if (orth1) go to 70 >*/ |
| 486 | if (orth1) { |
| 487 | goto L70; |
| 488 | } |
| 489 | /*< if (orth2) go to 90 >*/ |
| 490 | if (orth2) { |
| 491 | goto L90; |
| 492 | } |
| 493 | /*< if (rstart) go to 30 >*/ |
| 494 | if (rstart) { |
| 495 | goto L30; |
| 496 | } |
| 497 | |
| 498 | /* %------------------------------% */ |
| 499 | /* | Else this is the first step. | */ |
| 500 | /* %------------------------------% */ |
| 501 | |
| 502 | /* %--------------------------------------------------------------% */ |
| 503 | /* | | */ |
| 504 | /* | A R N O L D I I T E R A T I O N L O O P | */ |
| 505 | /* | | */ |
| 506 | /* | Note: B*r_{j-1} is already in WORKD(1:N)=WORKD(IPJ:IPJ+N-1) | */ |
| 507 | /* %--------------------------------------------------------------% */ |
| 508 | |
| 509 | /*< 1000 continue >*/ |
| 510 | L1000: |
| 511 | |
| 512 | /* if (msglvl .gt. 2) then */ |
| 513 | /* call ivout (logfil, 1, j, ndigit, */ |
| 514 | /* & '_saitr: generating Arnoldi vector no.') */ |
| 515 | /* call dvout (logfil, 1, rnorm, ndigit, */ |
| 516 | /* & '_saitr: B-norm of the current residual =') */ |
| 517 | /* end if */ |
| 518 | |
| 519 | /* %---------------------------------------------------------% */ |
| 520 | /* | Check for exact zero. Equivalent to determining whether | */ |
| 521 | /* | a j-step Arnoldi factorization is present. | */ |
| 522 | /* %---------------------------------------------------------% */ |
| 523 | |
| 524 | /*< if (rnorm .gt. zero) go to 40 >*/ |
| 525 | if (*rnorm > 0.) { |
| 526 | goto L40; |
| 527 | } |
| 528 | |
| 529 | /* %---------------------------------------------------% */ |
| 530 | /* | Invariant subspace found, generate a new starting | */ |
| 531 | /* | vector which is orthogonal to the current Arnoldi | */ |
| 532 | /* | basis and continue the iteration. | */ |
| 533 | /* %---------------------------------------------------% */ |
| 534 | |
| 535 | /* if (msglvl .gt. 0) then */ |
| 536 | /* call ivout (logfil, 1, j, ndigit, */ |
| 537 | /* & '_saitr: ****** restart at step ******') */ |
| 538 | /* end if */ |
| 539 | |
| 540 | /* %---------------------------------------------% */ |
| 541 | /* | ITRY is the loop variable that controls the | */ |
| 542 | /* | maximum amount of times that a restart is | */ |
| 543 | /* | attempted. NRSTRT is used by stat.h | */ |
| 544 | /* %---------------------------------------------% */ |
| 545 | |
| 546 | /*< nrstrt = nrstrt + 1 >*/ |
| 547 | /* ++timing_1.nrstrt; */ |
| 548 | /*< itry = 1 >*/ |
| 549 | itry = 1; |
| 550 | /*< 20 continue >*/ |
| 551 | L20: |
| 552 | /*< rstart = .true. >*/ |
| 553 | rstart = TRUE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:29:9`!; |
| 554 | /*< ido = 0 >*/ |
| 555 | *ido = 0; |
| 556 | /*< 30 continue >*/ |
| 557 | L30: |
| 558 | |
| 559 | /* %--------------------------------------% */ |
| 560 | /* | If in reverse communication mode and | */ |
| 561 | /* | RSTART = .true. flow returns here. | */ |
| 562 | /* %--------------------------------------% */ |
| 563 | |
| 564 | /*< >*/ |
| 565 | dgetv0_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:53:9`!(ido, bmat, &itry, &c_falsecxx . . $ c_false., n, &j, &v[v_offset], ldv, &resid[1], |
| 566 | rnorm, &ipntr[1], &workd[1], &ierr, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1); |
| 567 | /*< if (ido .ne. 99) go to 9000 >*/ |
| 568 | if (*ido != 99) { |
| 569 | goto L9000; |
| 570 | } |
| 571 | /*< if (ierr .lt. 0) then >*/ |
| 572 | if (ierr < 0) { |
| 573 | /*< itry = itry + 1 >*/ |
| 574 | ++itry; |
| 575 | /*< if (itry .le. 3) go to 20 >*/ |
| 576 | if (itry <= 3) { |
| 577 | goto L20; |
| 578 | } |
| 579 | |
| 580 | /* %------------------------------------------------% */ |
| 581 | /* | Give up after several restart attempts. | */ |
| 582 | /* | Set INFO to the size of the invariant subspace | */ |
| 583 | /* | which spans OP and exit. | */ |
| 584 | /* %------------------------------------------------% */ |
| 585 | |
| 586 | /*< info = j - 1 >*/ |
| 587 | *info = j - 1; |
| 588 | /*< call second (t1) >*/ |
| 589 | /* second_(&t1); */ |
| 590 | /*< tsaitr = tsaitr + (t1 - t0) >*/ |
| 591 | /* timing_1.tsaitr += t1 - t0; */ |
| 592 | /*< ido = 99 >*/ |
| 593 | *ido = 99; |
| 594 | /*< go to 9000 >*/ |
| 595 | goto L9000; |
| 596 | /*< end if >*/ |
| 597 | } |
| 598 | |
| 599 | /*< 40 continue >*/ |
| 600 | L40: |
| 601 | |
| 602 | /* %---------------------------------------------------------% */ |
| 603 | /* | STEP 2: v_{j} = r_{j-1}/rnorm and p_{j} = p_{j}/rnorm | */ |
| 604 | /* | Note that p_{j} = B*r_{j-1}. In order to avoid overflow | */ |
| 605 | /* | when reciprocating a small RNORM, test against lower | */ |
| 606 | /* | machine bound. | */ |
| 607 | /* %---------------------------------------------------------% */ |
| 608 | |
| 609 | /*< call dcopy (n, resid, 1, v(1,j), 1) >*/ |
| 610 | dcopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:40:9`!(n, &resid[1], &c__1cxx . . $ c__1., &v[j * v_dim1 + 1], &c__1cxx . . $ c__1.); |
| 611 | /*< if (rnorm .ge. safmin) then >*/ |
| 612 | if (*rnorm >= safmin) { |
| 613 | /*< temp1 = one / rnorm >*/ |
| 614 | temp1 = 1. / *rnorm; |
| 615 | /*< call dscal (n, temp1, v(1,j), 1) >*/ |
| 616 | dscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:132:9`!(n, &temp1, &v[j * v_dim1 + 1], &c__1cxx . . $ c__1.); |
| 617 | /*< call dscal (n, temp1, workd(ipj), 1) >*/ |
| 618 | dscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:132:9`!(n, &temp1, &workd[ipj], &c__1cxx . . $ c__1.); |
| 619 | /*< else >*/ |
| 620 | } else { |
| 621 | |
| 622 | /* %-----------------------------------------% */ |
| 623 | /* | To scale both v_{j} and p_{j} carefully | */ |
| 624 | /* | use LAPACK routine SLASCL | */ |
| 625 | /* %-----------------------------------------% */ |
| 626 | |
| 627 | /*< >*/ |
| 628 | dlascl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:95:9`!("General", &i__, &i__, rnorm, &c_b18cxx . . $ c_b18., n, &c__1cxx . . $ c__1., &v[j * v_dim1 |
| 629 | + 1], n, &infol, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)7); |
| 630 | /*< >*/ |
| 631 | dlascl_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:95:9`!("General", &i__, &i__, rnorm, &c_b18cxx . . $ c_b18., n, &c__1cxx . . $ c__1., &workd[ipj], |
| 632 | n, &infol, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)7); |
| 633 | /*< end if >*/ |
| 634 | } |
| 635 | |
| 636 | /* %------------------------------------------------------% */ |
| 637 | /* | STEP 3: r_{j} = OP*v_{j}; Note that p_{j} = B*v_{j} | */ |
| 638 | /* | Note that this is not quite yet r_{j}. See STEP 4 | */ |
| 639 | /* %------------------------------------------------------% */ |
| 640 | |
| 641 | /*< step3 = .true. >*/ |
| 642 | step3 = TRUE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:29:9`!; |
| 643 | /*< nopx = nopx + 1 >*/ |
| 644 | /* ++timing_1.nopx; */ |
| 645 | /*< call second (t2) >*/ |
| 646 | /* second_(&t2); */ |
| 647 | /*< call dcopy (n, v(1,j), 1, workd(ivj), 1) >*/ |
| 648 | dcopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:40:9`!(n, &v[j * v_dim1 + 1], &c__1cxx . . $ c__1., &workd[ivj], &c__1cxx . . $ c__1.); |
| 649 | /*< ipntr(1) = ivj >*/ |
| 650 | ipntr[1] = ivj; |
| 651 | /*< ipntr(2) = irj >*/ |
| 652 | ipntr[2] = irj; |
| 653 | /*< ipntr(3) = ipj >*/ |
| 654 | ipntr[3] = ipj; |
| 655 | /*< ido = 1 >*/ |
| 656 | *ido = 1; |
| 657 | |
| 658 | /* %-----------------------------------% */ |
| 659 | /* | Exit in order to compute OP*v_{j} | */ |
| 660 | /* %-----------------------------------% */ |
| 661 | |
| 662 | /*< go to 9000 >*/ |
| 663 | goto L9000; |
| 664 | /*< 50 continue >*/ |
| 665 | L50: |
| 666 | |
| 667 | /* %-----------------------------------% */ |
| 668 | /* | Back from reverse communication; | */ |
| 669 | /* | WORKD(IRJ:IRJ+N-1) := OP*v_{j}. | */ |
| 670 | /* %-----------------------------------% */ |
| 671 | |
| 672 | /*< call second (t3) >*/ |
| 673 | /* second_(&t3); */ |
| 674 | /*< tmvopx = tmvopx + (t3 - t2) >*/ |
| 675 | /* timing_1.tmvopx += t3 - t2; */ |
| 676 | |
| 677 | /*< step3 = .false. >*/ |
| 678 | step3 = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 679 | |
| 680 | /* %------------------------------------------% */ |
| 681 | /* | Put another copy of OP*v_{j} into RESID. | */ |
| 682 | /* %------------------------------------------% */ |
| 683 | |
| 684 | /*< call dcopy (n, workd(irj), 1, resid, 1) >*/ |
| 685 | dcopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:40:9`!(n, &workd[irj], &c__1cxx . . $ c__1., &resid[1], &c__1cxx . . $ c__1.); |
| 686 | |
| 687 | /* %-------------------------------------------% */ |
| 688 | /* | STEP 4: Finish extending the symmetric | */ |
| 689 | /* | Arnoldi to length j. If MODE = 2 | */ |
| 690 | /* | then B*OP = B*inv(B)*A = A and | */ |
| 691 | /* | we don't need to compute B*OP. | */ |
| 692 | /* | NOTE: If MODE = 2 WORKD(IVJ:IVJ+N-1) is | */ |
| 693 | /* | assumed to have A*v_{j}. | */ |
| 694 | /* %-------------------------------------------% */ |
| 695 | |
| 696 | /*< if (mode .eq. 2) go to 65 >*/ |
| 697 | if (*mode == 2) { |
| 698 | goto L65; |
| 699 | } |
| 700 | /*< call second (t2) >*/ |
| 701 | /* second_(&t2); */ |
| 702 | /*< if (bmat .eq. 'G') then >*/ |
| 703 | if (*(unsigned char *)bmat == 'G') { |
| 704 | /*< nbx = nbx + 1 >*/ |
| 705 | /* ++timing_1.nbx; */ |
| 706 | /*< step4 = .true. >*/ |
| 707 | step4 = TRUE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:29:9`!; |
| 708 | /*< ipntr(1) = irj >*/ |
| 709 | ipntr[1] = irj; |
| 710 | /*< ipntr(2) = ipj >*/ |
| 711 | ipntr[2] = ipj; |
| 712 | /*< ido = 2 >*/ |
| 713 | *ido = 2; |
| 714 | |
| 715 | /* %-------------------------------------% */ |
| 716 | /* | Exit in order to compute B*OP*v_{j} | */ |
| 717 | /* %-------------------------------------% */ |
| 718 | |
| 719 | /*< go to 9000 >*/ |
| 720 | goto L9000; |
| 721 | /*< else if (bmat .eq. 'I') then >*/ |
| 722 | } else if (*(unsigned char *)bmat == 'I') { |
| 723 | /*< call dcopy(n, resid, 1 , workd(ipj), 1) >*/ |
| 724 | dcopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:40:9`!(n, &resid[1], &c__1cxx . . $ c__1., &workd[ipj], &c__1cxx . . $ c__1.); |
| 725 | /*< end if >*/ |
| 726 | } |
| 727 | /*< 60 continue >*/ |
| 728 | L60: |
| 729 | |
| 730 | /* %-----------------------------------% */ |
| 731 | /* | Back from reverse communication; | */ |
| 732 | /* | WORKD(IPJ:IPJ+N-1) := B*OP*v_{j}. | */ |
| 733 | /* %-----------------------------------% */ |
| 734 | |
| 735 | /*< if (bmat .eq. 'G') then >*/ |
| 736 | if (*(unsigned char *)bmat == 'G') { |
| 737 | /*< call second (t3) >*/ |
| 738 | /* second_(&t3); */ |
| 739 | /*< tmvbx = tmvbx + (t3 - t2) >*/ |
| 740 | /* timing_1.tmvbx += t3 - t2; */ |
| 741 | /*< end if >*/ |
| 742 | } |
| 743 | |
| 744 | /*< step4 = .false. >*/ |
| 745 | step4 = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 746 | |
| 747 | /* %-------------------------------------% */ |
| 748 | /* | The following is needed for STEP 5. | */ |
| 749 | /* | Compute the B-norm of OP*v_{j}. | */ |
| 750 | /* %-------------------------------------% */ |
| 751 | |
| 752 | /*< 65 continue >*/ |
| 753 | L65: |
| 754 | /*< if (mode .eq. 2) then >*/ |
| 755 | if (*mode == 2) { |
| 756 | |
| 757 | /* %----------------------------------% */ |
| 758 | /* | Note that the B-norm of OP*v_{j} | */ |
| 759 | /* | is the inv(B)-norm of A*v_{j}. | */ |
| 760 | /* %----------------------------------% */ |
| 761 | |
| 762 | /*< wnorm = ddot (n, resid, 1, workd(ivj), 1) >*/ |
| 763 | wnorm = ddot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:43:9`!(n, &resid[1], &c__1cxx . . $ c__1., &workd[ivj], &c__1cxx . . $ c__1.); |
| 764 | /*< wnorm = sqrt(abs(wnorm)) >*/ |
| 765 | wnorm = sqrtcxx . . $ sqrt(447c67c6676f75c3).((abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(wnorm))); |
| 766 | /*< else if (bmat .eq. 'G') then >*/ |
| 767 | } else if (*(unsigned char *)bmat == 'G') { |
| 768 | /*< wnorm = ddot (n, resid, 1, workd(ipj), 1) >*/ |
| 769 | wnorm = ddot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:43:9`!(n, &resid[1], &c__1cxx . . $ c__1., &workd[ipj], &c__1cxx . . $ c__1.); |
| 770 | /*< wnorm = sqrt(abs(wnorm)) >*/ |
| 771 | wnorm = sqrtcxx . . $ sqrt(447c67c6676f75c3).((abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(wnorm))); |
| 772 | /*< else if (bmat .eq. 'I') then >*/ |
| 773 | } else if (*(unsigned char *)bmat == 'I') { |
| 774 | /*< wnorm = dnrm2(n, resid, 1) >*/ |
| 775 | wnorm = dnrm2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:108:9`!(n, &resid[1], &c__1cxx . . $ c__1.); |
| 776 | /*< end if >*/ |
| 777 | } |
| 778 | |
| 779 | /* %-----------------------------------------% */ |
| 780 | /* | Compute the j-th residual corresponding | */ |
| 781 | /* | to the j step factorization. | */ |
| 782 | /* | Use Classical Gram Schmidt and compute: | */ |
| 783 | /* | w_{j} <- V_{j}^T * B * OP * v_{j} | */ |
| 784 | /* | r_{j} <- OP*v_{j} - V_{j} * w_{j} | */ |
| 785 | /* %-----------------------------------------% */ |
| 786 | |
| 787 | |
| 788 | /* %------------------------------------------% */ |
| 789 | /* | Compute the j Fourier coefficients w_{j} | */ |
| 790 | /* | WORKD(IPJ:IPJ+N-1) contains B*OP*v_{j}. | */ |
| 791 | /* %------------------------------------------% */ |
| 792 | |
| 793 | /*< if (mode .ne. 2 ) then >*/ |
| 794 | if (*mode != 2) { |
| 795 | /*< >*/ |
| 796 | dgemv_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:46:9`!("T", n, &j, &c_b18cxx . . $ c_b18., &v[v_offset], ldv, &workd[ipj], &c__1cxx . . $ c__1., & |
| 797 | c_b43cxx . . $ c_b43., &workd[irj], &c__1cxx . . $ c__1., (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1); |
| 798 | /*< else if (mode .eq. 2) then >*/ |
| 799 | } else if (*mode == 2) { |
| 800 | /*< >*/ |
| 801 | dgemv_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:46:9`!("T", n, &j, &c_b18cxx . . $ c_b18., &v[v_offset], ldv, &workd[ivj], &c__1cxx . . $ c__1., & |
| 802 | c_b43cxx . . $ c_b43., &workd[irj], &c__1cxx . . $ c__1., (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1); |
| 803 | /*< end if >*/ |
| 804 | } |
| 805 | |
| 806 | /* %--------------------------------------% */ |
| 807 | /* | Orthgonalize r_{j} against V_{j}. | */ |
| 808 | /* | RESID contains OP*v_{j}. See STEP 3. | */ |
| 809 | /* %--------------------------------------% */ |
| 810 | |
| 811 | /*< >*/ |
| 812 | dgemv_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:46:9`!("N", n, &j, &c_b51cxx . . $ c_b51., &v[v_offset], ldv, &workd[irj], &c__1cxx . . $ c__1., &c_b18cxx . . $ c_b18., |
| 813 | &resid[1], &c__1cxx . . $ c__1., (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1); |
| 814 | |
| 815 | /* %--------------------------------------% */ |
| 816 | /* | Extend H to have j rows and columns. | */ |
| 817 | /* %--------------------------------------% */ |
| 818 | |
| 819 | /*< h(j,2) = workd(irj + j - 1) >*/ |
| 820 | h__[j + (h_dim1 << 1)] = workd[irj + j - 1]; |
| 821 | /*< if (j .eq. 1 .or. rstart) then >*/ |
| 822 | if (j == 1 || rstart) { |
| 823 | /*< h(j,1) = zero >*/ |
| 824 | h__[j + h_dim1] = 0.; |
| 825 | /*< else >*/ |
| 826 | } else { |
| 827 | /*< h(j,1) = rnorm >*/ |
| 828 | h__[j + h_dim1] = *rnorm; |
| 829 | /*< end if >*/ |
| 830 | } |
| 831 | /*< call second (t4) >*/ |
| 832 | /* second_(&t4); */ |
| 833 | |
| 834 | /*< orth1 = .true. >*/ |
| 835 | orth1 = TRUE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:29:9`!; |
| 836 | /*< iter = 0 >*/ |
| 837 | iter = 0; |
| 838 | |
| 839 | /*< call second (t2) >*/ |
| 840 | /* second_(&t2); */ |
| 841 | /*< if (bmat .eq. 'G') then >*/ |
| 842 | if (*(unsigned char *)bmat == 'G') { |
| 843 | /*< nbx = nbx + 1 >*/ |
| 844 | /* ++timing_1.nbx; */ |
| 845 | /*< call dcopy (n, resid, 1, workd(irj), 1) >*/ |
| 846 | dcopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:40:9`!(n, &resid[1], &c__1cxx . . $ c__1., &workd[irj], &c__1cxx . . $ c__1.); |
| 847 | /*< ipntr(1) = irj >*/ |
| 848 | ipntr[1] = irj; |
| 849 | /*< ipntr(2) = ipj >*/ |
| 850 | ipntr[2] = ipj; |
| 851 | /*< ido = 2 >*/ |
| 852 | *ido = 2; |
| 853 | |
| 854 | /* %----------------------------------% */ |
| 855 | /* | Exit in order to compute B*r_{j} | */ |
| 856 | /* %----------------------------------% */ |
| 857 | |
| 858 | /*< go to 9000 >*/ |
| 859 | goto L9000; |
| 860 | /*< else if (bmat .eq. 'I') then >*/ |
| 861 | } else if (*(unsigned char *)bmat == 'I') { |
| 862 | /*< call dcopy (n, resid, 1, workd(ipj), 1) >*/ |
| 863 | dcopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:40:9`!(n, &resid[1], &c__1cxx . . $ c__1., &workd[ipj], &c__1cxx . . $ c__1.); |
| 864 | /*< end if >*/ |
| 865 | } |
| 866 | /*< 70 continue >*/ |
| 867 | L70: |
| 868 | |
| 869 | /* %---------------------------------------------------% */ |
| 870 | /* | Back from reverse communication if ORTH1 = .true. | */ |
| 871 | /* | WORKD(IPJ:IPJ+N-1) := B*r_{j}. | */ |
| 872 | /* %---------------------------------------------------% */ |
| 873 | |
| 874 | /*< if (bmat .eq. 'G') then >*/ |
| 875 | if (*(unsigned char *)bmat == 'G') { |
| 876 | /*< call second (t3) >*/ |
| 877 | /* second_(&t3); */ |
| 878 | /*< tmvbx = tmvbx + (t3 - t2) >*/ |
| 879 | /* timing_1.tmvbx += t3 - t2; */ |
| 880 | /*< end if >*/ |
| 881 | } |
| 882 | |
| 883 | /*< orth1 = .false. >*/ |
| 884 | orth1 = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 885 | |
| 886 | /* %------------------------------% */ |
| 887 | /* | Compute the B-norm of r_{j}. | */ |
| 888 | /* %------------------------------% */ |
| 889 | |
| 890 | /*< if (bmat .eq. 'G') then >*/ |
| 891 | if (*(unsigned char *)bmat == 'G') { |
| 892 | /*< rnorm = ddot (n, resid, 1, workd(ipj), 1) >*/ |
| 893 | *rnorm = ddot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:43:9`!(n, &resid[1], &c__1cxx . . $ c__1., &workd[ipj], &c__1cxx . . $ c__1.); |
| 894 | /*< rnorm = sqrt(abs(rnorm)) >*/ |
| 895 | *rnorm = sqrtcxx . . $ sqrt(447c67c6676f75c3).((abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(*rnorm))); |
| 896 | /*< else if (bmat .eq. 'I') then >*/ |
| 897 | } else if (*(unsigned char *)bmat == 'I') { |
| 898 | /*< rnorm = dnrm2(n, resid, 1) >*/ |
| 899 | *rnorm = dnrm2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:108:9`!(n, &resid[1], &c__1cxx . . $ c__1.); |
| 900 | /*< end if >*/ |
| 901 | } |
| 902 | |
| 903 | /* %-----------------------------------------------------------% */ |
| 904 | /* | STEP 5: Re-orthogonalization / Iterative refinement phase | */ |
| 905 | /* | Maximum NITER_ITREF tries. | */ |
| 906 | /* | | */ |
| 907 | /* | s = V_{j}^T * B * r_{j} | */ |
| 908 | /* | r_{j} = r_{j} - V_{j}*s | */ |
| 909 | /* | alphaj = alphaj + s_{j} | */ |
| 910 | /* | | */ |
| 911 | /* | The stopping criteria used for iterative refinement is | */ |
| 912 | /* | discussed in Parlett's book SEP, page 107 and in Gragg & | */ |
| 913 | /* | Reichel ACM TOMS paper; Algorithm 686, Dec. 1990. | */ |
| 914 | /* | Determine if we need to correct the residual. The goal is | */ |
| 915 | /* | to enforce ||v(:,1:j)^T * r_{j}|| .le. eps * || r_{j} || | */ |
| 916 | /* %-----------------------------------------------------------% */ |
| 917 | |
| 918 | /*< if (rnorm .gt. 0.717*wnorm) go to 100 >*/ |
| 919 | if (*rnorm > wnorm * (float).717) { |
| 920 | goto L100; |
| 921 | } |
| 922 | /*< nrorth = nrorth + 1 >*/ |
| 923 | /* ++timing_1.nrorth; */ |
| 924 | |
| 925 | /* %---------------------------------------------------% */ |
| 926 | /* | Enter the Iterative refinement phase. If further | */ |
| 927 | /* | refinement is necessary, loop back here. The loop | */ |
| 928 | /* | variable is ITER. Perform a step of Classical | */ |
| 929 | /* | Gram-Schmidt using all the Arnoldi vectors V_{j} | */ |
| 930 | /* %---------------------------------------------------% */ |
| 931 | |
| 932 | /*< 80 continue >*/ |
| 933 | L80: |
| 934 | |
| 935 | /*< if (msglvl .gt. 2) then >*/ |
| 936 | /* if (msglvl > 2) { */ |
| 937 | /*< xtemp(1) = wnorm >*/ |
| 938 | /* xtemp[0] = wnorm; */ |
| 939 | /*< xtemp(2) = rnorm >*/ |
| 940 | /* xtemp[1] = *rnorm; */ |
| 941 | /* call dvout (logfil, 2, xtemp, ndigit, */ |
| 942 | /* & '_saitr: re-orthonalization ; wnorm and rnorm are') */ |
| 943 | /*< end if >*/ |
| 944 | /* } */ |
| 945 | |
| 946 | /* %----------------------------------------------------% */ |
| 947 | /* | Compute V_{j}^T * B * r_{j}. | */ |
| 948 | /* | WORKD(IRJ:IRJ+J-1) = v(:,1:J)'*WORKD(IPJ:IPJ+N-1). | */ |
| 949 | /* %----------------------------------------------------% */ |
| 950 | |
| 951 | /*< >*/ |
| 952 | dgemv_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:46:9`!("T", n, &j, &c_b18cxx . . $ c_b18., &v[v_offset], ldv, &workd[ipj], &c__1cxx . . $ c__1., &c_b43cxx . . $ c_b43., |
| 953 | &workd[irj], &c__1cxx . . $ c__1., (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1); |
| 954 | |
| 955 | /* %----------------------------------------------% */ |
| 956 | /* | Compute the correction to the residual: | */ |
| 957 | /* | r_{j} = r_{j} - V_{j} * WORKD(IRJ:IRJ+J-1). | */ |
| 958 | /* | The correction to H is v(:,1:J)*H(1:J,1:J) + | */ |
| 959 | /* | v(:,1:J)*WORKD(IRJ:IRJ+J-1)*e'_j, but only | */ |
| 960 | /* | H(j,j) is updated. | */ |
| 961 | /* %----------------------------------------------% */ |
| 962 | |
| 963 | /*< >*/ |
| 964 | dgemv_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:46:9`!("N", n, &j, &c_b51cxx . . $ c_b51., &v[v_offset], ldv, &workd[irj], &c__1cxx . . $ c__1., &c_b18cxx . . $ c_b18., |
| 965 | &resid[1], &c__1cxx . . $ c__1., (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1); |
| 966 | |
| 967 | /*< if (j .eq. 1 .or. rstart) h(j,1) = zero >*/ |
| 968 | if (j == 1 || rstart) { |
| 969 | h__[j + h_dim1] = 0.; |
| 970 | } |
| 971 | /*< h(j,2) = h(j,2) + workd(irj + j - 1) >*/ |
| 972 | h__[j + (h_dim1 << 1)] += workd[irj + j - 1]; |
| 973 | |
| 974 | /*< orth2 = .true. >*/ |
| 975 | orth2 = TRUE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:29:9`!; |
| 976 | /*< call second (t2) >*/ |
| 977 | /* second_(&t2); */ |
| 978 | /*< if (bmat .eq. 'G') then >*/ |
| 979 | if (*(unsigned char *)bmat == 'G') { |
| 980 | /*< nbx = nbx + 1 >*/ |
| 981 | /* ++timing_1.nbx; */ |
| 982 | /*< call dcopy (n, resid, 1, workd(irj), 1) >*/ |
| 983 | dcopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:40:9`!(n, &resid[1], &c__1cxx . . $ c__1., &workd[irj], &c__1cxx . . $ c__1.); |
| 984 | /*< ipntr(1) = irj >*/ |
| 985 | ipntr[1] = irj; |
| 986 | /*< ipntr(2) = ipj >*/ |
| 987 | ipntr[2] = ipj; |
| 988 | /*< ido = 2 >*/ |
| 989 | *ido = 2; |
| 990 | |
| 991 | /* %-----------------------------------% */ |
| 992 | /* | Exit in order to compute B*r_{j}. | */ |
| 993 | /* | r_{j} is the corrected residual. | */ |
| 994 | /* %-----------------------------------% */ |
| 995 | |
| 996 | /*< go to 9000 >*/ |
| 997 | goto L9000; |
| 998 | /*< else if (bmat .eq. 'I') then >*/ |
| 999 | } else if (*(unsigned char *)bmat == 'I') { |
| 1000 | /*< call dcopy (n, resid, 1, workd(ipj), 1) >*/ |
| 1001 | dcopy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:40:9`!(n, &resid[1], &c__1cxx . . $ c__1., &workd[ipj], &c__1cxx . . $ c__1.); |
| 1002 | /*< end if >*/ |
| 1003 | } |
| 1004 | /*< 90 continue >*/ |
| 1005 | L90: |
| 1006 | |
| 1007 | /* %---------------------------------------------------% */ |
| 1008 | /* | Back from reverse communication if ORTH2 = .true. | */ |
| 1009 | /* %---------------------------------------------------% */ |
| 1010 | |
| 1011 | /*< if (bmat .eq. 'G') then >*/ |
| 1012 | if (*(unsigned char *)bmat == 'G') { |
| 1013 | /*< call second (t3) >*/ |
| 1014 | /* second_(&t3); */ |
| 1015 | /*< tmvbx = tmvbx + (t3 - t2) >*/ |
| 1016 | /* timing_1.tmvbx += t3 - t2; */ |
| 1017 | /*< end if >*/ |
| 1018 | } |
| 1019 | |
| 1020 | /* %-----------------------------------------------------% */ |
| 1021 | /* | Compute the B-norm of the corrected residual r_{j}. | */ |
| 1022 | /* %-----------------------------------------------------% */ |
| 1023 | |
| 1024 | /*< if (bmat .eq. 'G') then >*/ |
| 1025 | if (*(unsigned char *)bmat == 'G') { |
| 1026 | /*< rnorm1 = ddot (n, resid, 1, workd(ipj), 1) >*/ |
| 1027 | rnorm1 = ddot_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:43:9`!(n, &resid[1], &c__1cxx . . $ c__1., &workd[ipj], &c__1cxx . . $ c__1.); |
| 1028 | /*< rnorm1 = sqrt(abs(rnorm1)) >*/ |
| 1029 | rnorm1 = sqrtcxx . . $ sqrt(447c67c6676f75c3).((abscxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:157:9`!(rnorm1))); |
| 1030 | /*< else if (bmat .eq. 'I') then >*/ |
| 1031 | } else if (*(unsigned char *)bmat == 'I') { |
| 1032 | /*< rnorm1 = dnrm2(n, resid, 1) >*/ |
| 1033 | rnorm1 = dnrm2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:108:9`!(n, &resid[1], &c__1cxx . . $ c__1.); |
| 1034 | /*< end if >*/ |
| 1035 | } |
| 1036 | |
| 1037 | /* if (msglvl .gt. 0 .and. iter .gt. 0) then */ |
| 1038 | /* call ivout (logfil, 1, j, ndigit, */ |
| 1039 | /* & '_saitr: Iterative refinement for Arnoldi residual') */ |
| 1040 | /* if (msglvl .gt. 2) then */ |
| 1041 | /* xtemp(1) = rnorm */ |
| 1042 | /* xtemp(2) = rnorm1 */ |
| 1043 | /* call dvout (logfil, 2, xtemp, ndigit, */ |
| 1044 | /* & '_saitr: iterative refinement ; rnorm and rnorm1 are') */ |
| 1045 | /* end if */ |
| 1046 | /* end if */ |
| 1047 | |
| 1048 | /* %-----------------------------------------% */ |
| 1049 | /* | Determine if we need to perform another | */ |
| 1050 | /* | step of re-orthogonalization. | */ |
| 1051 | /* %-----------------------------------------% */ |
| 1052 | |
| 1053 | /*< if (rnorm1 .gt. 0.717*rnorm) then >*/ |
| 1054 | if (rnorm1 > *rnorm * (float).717) { |
| 1055 | |
| 1056 | /* %--------------------------------% */ |
| 1057 | /* | No need for further refinement | */ |
| 1058 | /* %--------------------------------% */ |
| 1059 | |
| 1060 | /*< rnorm = rnorm1 >*/ |
| 1061 | *rnorm = rnorm1; |
| 1062 | |
| 1063 | /*< else >*/ |
| 1064 | } else { |
| 1065 | |
| 1066 | /* %-------------------------------------------% */ |
| 1067 | /* | Another step of iterative refinement step | */ |
| 1068 | /* | is required. NITREF is used by stat.h | */ |
| 1069 | /* %-------------------------------------------% */ |
| 1070 | |
| 1071 | /*< nitref = nitref + 1 >*/ |
| 1072 | /* ++timing_1.nitref; */ |
| 1073 | /*< rnorm = rnorm1 >*/ |
| 1074 | *rnorm = rnorm1; |
| 1075 | /*< iter = iter + 1 >*/ |
| 1076 | ++iter; |
| 1077 | /*< if (iter .le. 1) go to 80 >*/ |
| 1078 | if (iter <= 1) { |
| 1079 | goto L80; |
| 1080 | } |
| 1081 | |
| 1082 | /* %-------------------------------------------------% */ |
| 1083 | /* | Otherwise RESID is numerically in the span of V | */ |
| 1084 | /* %-------------------------------------------------% */ |
| 1085 | |
| 1086 | /*< do 95 jj = 1, n >*/ |
| 1087 | i__1 = *n; |
| 1088 | for (jj = 1; jj <= i__1; ++jj) { |
| 1089 | /*< resid(jj) = zero >*/ |
| 1090 | resid[jj] = 0.; |
| 1091 | /*< 95 continue >*/ |
| 1092 | /* L95: */ |
| 1093 | } |
| 1094 | /*< rnorm = zero >*/ |
| 1095 | *rnorm = 0.; |
| 1096 | /*< end if >*/ |
| 1097 | } |
| 1098 | |
| 1099 | /* %----------------------------------------------% */ |
| 1100 | /* | Branch here directly if iterative refinement | */ |
| 1101 | /* | wasn't necessary or after at most NITER_REF | */ |
| 1102 | /* | steps of iterative refinement. | */ |
| 1103 | /* %----------------------------------------------% */ |
| 1104 | |
| 1105 | /*< 100 continue >*/ |
| 1106 | L100: |
| 1107 | |
| 1108 | /*< rstart = .false. >*/ |
| 1109 | rstart = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 1110 | /*< orth2 = .false. >*/ |
| 1111 | orth2 = FALSE_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:30:9`!; |
| 1112 | |
| 1113 | /*< call second (t5) >*/ |
| 1114 | /* second_(&t5); */ |
| 1115 | /*< titref = titref + (t5 - t4) >*/ |
| 1116 | /* timing_1.titref += t5 - t4; */ |
| 1117 | |
| 1118 | /* %----------------------------------------------------------% */ |
| 1119 | /* | Make sure the last off-diagonal element is non negative | */ |
| 1120 | /* | If not perform a similarity transformation on H(1:j,1:j) | */ |
| 1121 | /* | and scale v(:,j) by -1. | */ |
| 1122 | /* %----------------------------------------------------------% */ |
| 1123 | |
| 1124 | /*< if (h(j,1) .lt. zero) then >*/ |
| 1125 | if (h__[j + h_dim1] < 0.) { |
| 1126 | /*< h(j,1) = -h(j,1) >*/ |
| 1127 | h__[j + h_dim1] = -h__[j + h_dim1]; |
| 1128 | /*< if ( j .lt. k+np) then >*/ |
| 1129 | if (j < *k + *np) { |
| 1130 | /*< call dscal(n, -one, v(1,j+1), 1) >*/ |
| 1131 | dscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:132:9`!(n, &c_b51cxx . . $ c_b51., &v[(j + 1) * v_dim1 + 1], &c__1cxx . . $ c__1.); |
| 1132 | /*< else >*/ |
| 1133 | } else { |
| 1134 | /*< call dscal(n, -one, resid, 1) >*/ |
| 1135 | dscal_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:132:9`!(n, &c_b51cxx . . $ c_b51., &resid[1], &c__1cxx . . $ c__1.); |
| 1136 | /*< end if >*/ |
| 1137 | } |
| 1138 | /*< end if >*/ |
| 1139 | } |
| 1140 | |
| 1141 | /* %------------------------------------% */ |
| 1142 | /* | STEP 6: Update j = j+1; Continue | */ |
| 1143 | /* %------------------------------------% */ |
| 1144 | |
| 1145 | /*< j = j + 1 >*/ |
| 1146 | ++j; |
| 1147 | /*< if (j .gt. k+np) then >*/ |
| 1148 | if (j > *k + *np) { |
| 1149 | /*< call second (t1) >*/ |
| 1150 | /* second_(&t1); */ |
| 1151 | /*< tsaitr = tsaitr + (t1 - t0) >*/ |
| 1152 | /* timing_1.tsaitr += t1 - t0; */ |
| 1153 | /*< ido = 99 >*/ |
| 1154 | *ido = 99; |
| 1155 | |
| 1156 | /* if (msglvl .gt. 1) then */ |
| 1157 | /* call dvout (logfil, k+np, h(1,2), ndigit, */ |
| 1158 | /* & '_saitr: main diagonal of matrix H of step K+NP.') */ |
| 1159 | /* if (k+np .gt. 1) then */ |
| 1160 | /* call dvout (logfil, k+np-1, h(2,1), ndigit, */ |
| 1161 | /* & '_saitr: sub diagonal of matrix H of step K+NP.') */ |
| 1162 | /* end if */ |
| 1163 | /* end if */ |
| 1164 | |
| 1165 | /*< go to 9000 >*/ |
| 1166 | goto L9000; |
| 1167 | /*< end if >*/ |
| 1168 | } |
| 1169 | |
| 1170 | /* %--------------------------------------------------------% */ |
| 1171 | /* | Loop back to extend the factorization by another step. | */ |
| 1172 | /* %--------------------------------------------------------% */ |
| 1173 | |
| 1174 | /*< go to 1000 >*/ |
| 1175 | goto L1000; |
| 1176 | |
| 1177 | /* %---------------------------------------------------------------% */ |
| 1178 | /* | | */ |
| 1179 | /* | E N D O F M A I N I T E R A T I O N L O O P | */ |
| 1180 | /* | | */ |
| 1181 | /* %---------------------------------------------------------------% */ |
| 1182 | |
| 1183 | /*< 9000 continue >*/ |
| 1184 | L9000: |
| 1185 | /*< return >*/ |
| 1186 | return 0; |
| 1187 | |
| 1188 | /* %---------------% */ |
| 1189 | /* | End of dsaitr | */ |
| 1190 | /* %---------------% */ |
| 1191 | |
| 1192 | /*< end >*/ |
| 1193 | } /* dsaitr_ */ |
| 1194 | |
| 1195 | #ifdef __cplusplus |
| 1196 | } |
| 1197 | #endif |