| 1 | /* arpack/dsaupd.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 | /* ----------------------------------------------------------------------- */ |
| 39 | /* \BeginDoc */ |
| 40 | |
| 41 | /* \Name: dsaupd */ |
| 42 | |
| 43 | /* \Description: */ |
| 44 | |
| 45 | /* Reverse communication interface for the Implicitly Restarted Arnoldi */ |
| 46 | /* Iteration. For symmetric problems this reduces to a variant of the Lanczos */ |
| 47 | /* method. This method has been designed to compute approximations to a */ |
| 48 | /* few eigenpairs of a linear operator OP that is real and symmetric */ |
| 49 | /* with respect to a real positive semi-definite symmetric matrix B, */ |
| 50 | /* i.e. */ |
| 51 | |
| 52 | /* B*OP = (OP')*B. */ |
| 53 | |
| 54 | /* Another way to express this condition is */ |
| 55 | |
| 56 | /* < x,OPy > = < OPx,y > where < z,w > = z'Bw . */ |
| 57 | |
| 58 | /* In the standard eigenproblem B is the identity matrix. */ |
| 59 | /* ( A' denotes transpose of A) */ |
| 60 | |
| 61 | /* The computed approximate eigenvalues are called Ritz values and */ |
| 62 | /* the corresponding approximate eigenvectors are called Ritz vectors. */ |
| 63 | |
| 64 | /* dsaupd is usually called iteratively to solve one of the */ |
| 65 | /* following problems: */ |
| 66 | |
| 67 | /* Mode 1: A*x = lambda*x, A symmetric */ |
| 68 | /* ===> OP = A and B = I. */ |
| 69 | |
| 70 | /* Mode 2: A*x = lambda*M*x, A symmetric, M symmetric positive definite */ |
| 71 | /* ===> OP = inv[M]*A and B = M. */ |
| 72 | /* ===> (If M can be factored see remark 3 below) */ |
| 73 | |
| 74 | /* Mode 3: K*x = lambda*M*x, K symmetric, M symmetric positive semi-definite */ |
| 75 | /* ===> OP = (inv[K - sigma*M])*M and B = M. */ |
| 76 | /* ===> Shift-and-Invert mode */ |
| 77 | |
| 78 | /* Mode 4: K*x = lambda*KG*x, K symmetric positive semi-definite, */ |
| 79 | /* KG symmetric indefinite */ |
| 80 | /* ===> OP = (inv[K - sigma*KG])*K and B = K. */ |
| 81 | /* ===> Buckling mode */ |
| 82 | |
| 83 | /* Mode 5: A*x = lambda*M*x, A symmetric, M symmetric positive semi-definite */ |
| 84 | /* ===> OP = inv[A - sigma*M]*[A + sigma*M] and B = M. */ |
| 85 | /* ===> Cayley transformed mode */ |
| 86 | |
| 87 | /* NOTE: The action of w <- inv[A - sigma*M]*v or w <- inv[M]*v */ |
| 88 | /* should be accomplished either by a direct method */ |
| 89 | /* using a sparse matrix factorization and solving */ |
| 90 | |
| 91 | /* [A - sigma*M]*w = v or M*w = v, */ |
| 92 | |
| 93 | /* or through an iterative method for solving these */ |
| 94 | /* systems. If an iterative method is used, the */ |
| 95 | /* convergence test must be more stringent than */ |
| 96 | /* the accuracy requirements for the eigenvalue */ |
| 97 | /* approximations. */ |
| 98 | |
| 99 | /* \Usage: */ |
| 100 | /* call dsaupd */ |
| 101 | /* ( IDO, BMAT, N, WHICH, NEV, TOL, RESID, NCV, V, LDV, IPARAM, */ |
| 102 | /* IPNTR, WORKD, WORKL, LWORKL, INFO ) */ |
| 103 | |
| 104 | /* \Arguments */ |
| 105 | /* IDO Integer. (INPUT/OUTPUT) */ |
| 106 | /* Reverse communication flag. IDO must be zero on the first */ |
| 107 | /* call to dsaupd. IDO will be set internally to */ |
| 108 | /* indicate the type of operation to be performed. Control is */ |
| 109 | /* then given back to the calling routine which has the */ |
| 110 | /* responsibility to carry out the requested operation and call */ |
| 111 | /* dsaupd with the result. The operand is given in */ |
| 112 | /* WORKD(IPNTR(1)), the result must be put in WORKD(IPNTR(2)). */ |
| 113 | /* (If Mode = 2 see remark 5 below) */ |
| 114 | /* ------------------------------------------------------------- */ |
| 115 | /* IDO = 0: first call to the reverse communication interface */ |
| 116 | /* IDO = -1: compute Y = OP * X where */ |
| 117 | /* IPNTR(1) is the pointer into WORKD for X, */ |
| 118 | /* IPNTR(2) is the pointer into WORKD for Y. */ |
| 119 | /* This is for the initialization phase to force the */ |
| 120 | /* starting vector into the range of OP. */ |
| 121 | /* IDO = 1: compute Y = OP * X where */ |
| 122 | /* IPNTR(1) is the pointer into WORKD for X, */ |
| 123 | /* IPNTR(2) is the pointer into WORKD for Y. */ |
| 124 | /* In mode 3,4 and 5, the vector B * X is already */ |
| 125 | /* available in WORKD(ipntr(3)). It does not */ |
| 126 | /* need to be recomputed in forming OP * X. */ |
| 127 | /* IDO = 2: compute Y = B * X where */ |
| 128 | /* IPNTR(1) is the pointer into WORKD for X, */ |
| 129 | /* IPNTR(2) is the pointer into WORKD for Y. */ |
| 130 | /* IDO = 3: compute the IPARAM(8) shifts where */ |
| 131 | /* IPNTR(11) is the pointer into WORKL for */ |
| 132 | /* placing the shifts. See remark 6 below. */ |
| 133 | /* IDO = 99: done */ |
| 134 | /* ------------------------------------------------------------- */ |
| 135 | |
| 136 | /* BMAT Character*1. (INPUT) */ |
| 137 | /* BMAT specifies the type of the matrix B that defines the */ |
| 138 | /* semi-inner product for the operator OP. */ |
| 139 | /* B = 'I' -> standard eigenvalue problem A*x = lambda*x */ |
| 140 | /* B = 'G' -> generalized eigenvalue problem A*x = lambda*B*x */ |
| 141 | |
| 142 | /* N Integer. (INPUT) */ |
| 143 | /* Dimension of the eigenproblem. */ |
| 144 | |
| 145 | /* WHICH Character*2. (INPUT) */ |
| 146 | /* Specify which of the Ritz values of OP to compute. */ |
| 147 | |
| 148 | /* 'LA' - compute the NEV largest (algebraic) eigenvalues. */ |
| 149 | /* 'SA' - compute the NEV smallest (algebraic) eigenvalues. */ |
| 150 | /* 'LM' - compute the NEV largest (in magnitude) eigenvalues. */ |
| 151 | /* 'SM' - compute the NEV smallest (in magnitude) eigenvalues. */ |
| 152 | /* 'BE' - compute NEV eigenvalues, half from each end of the */ |
| 153 | /* spectrum. When NEV is odd, compute one more from the */ |
| 154 | /* high end than from the low end. */ |
| 155 | /* (see remark 1 below) */ |
| 156 | |
| 157 | /* NEV Integer. (INPUT) */ |
| 158 | /* Number of eigenvalues of OP to be computed. 0 < NEV < N. */ |
| 159 | |
| 160 | /* TOL Double precision scalar. (INPUT) */ |
| 161 | /* Stopping criterion: the relative accuracy of the Ritz value */ |
| 162 | /* is considered acceptable if BOUNDS(I) .LE. TOL*ABS(RITZ(I)). */ |
| 163 | /* If TOL .LE. 0. is passed a default is set: */ |
| 164 | /* DEFAULT = DLAMCH('EPS') (machine precision as computed */ |
| 165 | /* by the LAPACK auxiliary subroutine DLAMCH). */ |
| 166 | |
| 167 | /* RESID Double precision array of length N. (INPUT/OUTPUT) */ |
| 168 | /* On INPUT: */ |
| 169 | /* If INFO .EQ. 0, a random initial residual vector is used. */ |
| 170 | /* If INFO .NE. 0, RESID contains the initial residual vector, */ |
| 171 | /* possibly from a previous run. */ |
| 172 | /* On OUTPUT: */ |
| 173 | /* RESID contains the final residual vector. */ |
| 174 | |
| 175 | /* NCV Integer. (INPUT) */ |
| 176 | /* Number of columns of the matrix V (less than or equal to N). */ |
| 177 | /* This will indicate how many Lanczos vectors are generated */ |
| 178 | /* at each iteration. After the startup phase in which NEV */ |
| 179 | /* Lanczos vectors are generated, the algorithm generates */ |
| 180 | /* NCV-NEV Lanczos vectors at each subsequent update iteration. */ |
| 181 | /* Most of the cost in generating each Lanczos vector is in the */ |
| 182 | /* matrix-vector product OP*x. (See remark 4 below). */ |
| 183 | |
| 184 | /* V Double precision N by NCV array. (OUTPUT) */ |
| 185 | /* The NCV columns of V contain the Lanczos basis vectors. */ |
| 186 | |
| 187 | /* LDV Integer. (INPUT) */ |
| 188 | /* Leading dimension of V exactly as declared in the calling */ |
| 189 | /* program. */ |
| 190 | |
| 191 | /* IPARAM Integer array of length 11. (INPUT/OUTPUT) */ |
| 192 | /* IPARAM(1) = ISHIFT: method for selecting the implicit shifts. */ |
| 193 | /* The shifts selected at each iteration are used to restart */ |
| 194 | /* the Arnoldi iteration in an implicit fashion. */ |
| 195 | /* ------------------------------------------------------------- */ |
| 196 | /* ISHIFT = 0: the shifts are provided by the user via */ |
| 197 | /* reverse communication. The NCV eigenvalues of */ |
| 198 | /* the current tridiagonal matrix T are returned in */ |
| 199 | /* the part of WORKL array corresponding to RITZ. */ |
| 200 | /* See remark 6 below. */ |
| 201 | /* ISHIFT = 1: exact shifts with respect to the reduced */ |
| 202 | /* tridiagonal matrix T. This is equivalent to */ |
| 203 | /* restarting the iteration with a starting vector */ |
| 204 | /* that is a linear combination of Ritz vectors */ |
| 205 | /* associated with the "wanted" Ritz values. */ |
| 206 | /* ------------------------------------------------------------- */ |
| 207 | |
| 208 | /* IPARAM(2) = LEVEC */ |
| 209 | /* No longer referenced. See remark 2 below. */ |
| 210 | |
| 211 | /* IPARAM(3) = MXITER */ |
| 212 | /* On INPUT: maximum number of Arnoldi update iterations allowed. */ |
| 213 | /* On OUTPUT: actual number of Arnoldi update iterations taken. */ |
| 214 | |
| 215 | /* IPARAM(4) = NB: blocksize to be used in the recurrence. */ |
| 216 | /* The code currently works only for NB = 1. */ |
| 217 | |
| 218 | /* IPARAM(5) = NCONV: number of "converged" Ritz values. */ |
| 219 | /* This represents the number of Ritz values that satisfy */ |
| 220 | /* the convergence criterion. */ |
| 221 | |
| 222 | /* IPARAM(6) = IUPD */ |
| 223 | /* No longer referenced. Implicit restarting is ALWAYS used. */ |
| 224 | |
| 225 | /* IPARAM(7) = MODE */ |
| 226 | /* On INPUT determines what type of eigenproblem is being solved. */ |
| 227 | /* Must be 1,2,3,4,5; See under \Description of dsaupd for the */ |
| 228 | /* five modes available. */ |
| 229 | |
| 230 | /* IPARAM(8) = NP */ |
| 231 | /* When ido = 3 and the user provides shifts through reverse */ |
| 232 | /* communication (IPARAM(1)=0), dsaupd returns NP, the number */ |
| 233 | /* of shifts the user is to provide. 0 < NP <=NCV-NEV. See Remark */ |
| 234 | /* 6 below. */ |
| 235 | |
| 236 | /* IPARAM(9) = NUMOP, IPARAM(10) = NUMOPB, IPARAM(11) = NUMREO, */ |
| 237 | /* OUTPUT: NUMOP = total number of OP*x operations, */ |
| 238 | /* NUMOPB = total number of B*x operations if BMAT='G', */ |
| 239 | /* NUMREO = total number of steps of re-orthogonalization. */ |
| 240 | |
| 241 | /* IPNTR Integer array of length 11. (OUTPUT) */ |
| 242 | /* Pointer to mark the starting locations in the WORKD and WORKL */ |
| 243 | /* arrays for matrices/vectors used by the Lanczos iteration. */ |
| 244 | /* ------------------------------------------------------------- */ |
| 245 | /* IPNTR(1): pointer to the current operand vector X in WORKD. */ |
| 246 | /* IPNTR(2): pointer to the current result vector Y in WORKD. */ |
| 247 | /* IPNTR(3): pointer to the vector B * X in WORKD when used in */ |
| 248 | /* the shift-and-invert mode. */ |
| 249 | /* IPNTR(4): pointer to the next available location in WORKL */ |
| 250 | /* that is untouched by the program. */ |
| 251 | /* IPNTR(5): pointer to the NCV by 2 tridiagonal matrix T in WORKL. */ |
| 252 | /* IPNTR(6): pointer to the NCV RITZ values array in WORKL. */ |
| 253 | /* IPNTR(7): pointer to the Ritz estimates in array WORKL associated */ |
| 254 | /* with the Ritz values located in RITZ in WORKL. */ |
| 255 | /* IPNTR(11): pointer to the NP shifts in WORKL. See Remark 6 below. */ |
| 256 | |
| 257 | /* Note: IPNTR(8:10) is only referenced by dseupd. See Remark 2. */ |
| 258 | /* IPNTR(8): pointer to the NCV RITZ values of the original system. */ |
| 259 | /* IPNTR(9): pointer to the NCV corresponding error bounds. */ |
| 260 | /* IPNTR(10): pointer to the NCV by NCV matrix of eigenvectors */ |
| 261 | /* of the tridiagonal matrix T. Only referenced by */ |
| 262 | /* dseupd if RVEC = .TRUE. See Remarks. */ |
| 263 | /* ------------------------------------------------------------- */ |
| 264 | |
| 265 | /* WORKD Double precision work array of length 3*N. (REVERSE COMMUNICATION) */ |
| 266 | /* Distributed array to be used in the basic Arnoldi iteration */ |
| 267 | /* for reverse communication. The user should not use WORKD */ |
| 268 | /* as temporary workspace during the iteration. Upon termination */ |
| 269 | /* WORKD(1:N) contains B*RESID(1:N). If the Ritz vectors are desired */ |
| 270 | /* subroutine dseupd uses this output. */ |
| 271 | /* See Data Distribution Note below. */ |
| 272 | |
| 273 | /* WORKL Double precision work array of length LWORKL. (OUTPUT/WORKSPACE) */ |
| 274 | /* Private (replicated) array on each PE or array allocated on */ |
| 275 | /* the front end. See Data Distribution Note below. */ |
| 276 | |
| 277 | /* LWORKL Integer. (INPUT) */ |
| 278 | /* LWORKL must be at least NCV**2 + 8*NCV . */ |
| 279 | |
| 280 | /* INFO Integer. (INPUT/OUTPUT) */ |
| 281 | /* If INFO .EQ. 0, a randomly initial residual vector is used. */ |
| 282 | /* If INFO .NE. 0, RESID contains the initial residual vector, */ |
| 283 | /* possibly from a previous run. */ |
| 284 | /* Error flag on output. */ |
| 285 | /* = 0: Normal exit. */ |
| 286 | /* = 1: Maximum number of iterations taken. */ |
| 287 | /* All possible eigenvalues of OP has been found. IPARAM(5) */ |
| 288 | /* returns the number of wanted converged Ritz values. */ |
| 289 | /* = 2: No longer an informational error. Deprecated starting */ |
| 290 | /* with release 2 of ARPACK. */ |
| 291 | /* = 3: No shifts could be applied during a cycle of the */ |
| 292 | /* Implicitly restarted Arnoldi iteration. One possibility */ |
| 293 | /* is to increase the size of NCV relative to NEV. */ |
| 294 | /* See remark 4 below. */ |
| 295 | /* = -1: N must be positive. */ |
| 296 | /* = -2: NEV must be positive. */ |
| 297 | /* = -3: NCV must be greater than NEV and less than or equal to N. */ |
| 298 | /* = -4: The maximum number of Arnoldi update iterations allowed */ |
| 299 | /* must be greater than zero. */ |
| 300 | /* = -5: WHICH must be one of 'LM', 'SM', 'LA', 'SA' or 'BE'. */ |
| 301 | /* = -6: BMAT must be one of 'I' or 'G'. */ |
| 302 | /* = -7: Length of private work array WORKL is not sufficient. */ |
| 303 | /* = -8: Error return from trid. eigenvalue calculation; */ |
| 304 | /* Informatinal error from LAPACK routine dsteqr. */ |
| 305 | /* = -9: Starting vector is zero. */ |
| 306 | /* = -10: IPARAM(7) must be 1,2,3,4,5. */ |
| 307 | /* = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable. */ |
| 308 | /* = -12: IPARAM(1) must be equal to 0 or 1. */ |
| 309 | /* = -13: NEV and WHICH = 'BE' are incompatable. */ |
| 310 | /* = -9999: Could not build an Arnoldi factorization. */ |
| 311 | /* IPARAM(5) returns the size of the current Arnoldi */ |
| 312 | /* factorization. The user is advised to check that */ |
| 313 | /* enough workspace and array storage has been allocated. */ |
| 314 | |
| 315 | |
| 316 | /* \Remarks */ |
| 317 | /* 1. The converged Ritz values are always returned in ascending */ |
| 318 | /* algebraic order. The computed Ritz values are approximate */ |
| 319 | /* eigenvalues of OP. The selection of WHICH should be made */ |
| 320 | /* with this in mind when Mode = 3,4,5. After convergence, */ |
| 321 | /* approximate eigenvalues of the original problem may be obtained */ |
| 322 | /* with the ARPACK subroutine dseupd. */ |
| 323 | |
| 324 | /* 2. If the Ritz vectors corresponding to the converged Ritz values */ |
| 325 | /* are needed, the user must call dseupd immediately following completion */ |
| 326 | /* of dsaupd. This is new starting with version 2.1 of ARPACK. */ |
| 327 | |
| 328 | /* 3. If M can be factored into a Cholesky factorization M = LL' */ |
| 329 | /* then Mode = 2 should not be selected. Instead one should use */ |
| 330 | /* Mode = 1 with OP = inv(L)*A*inv(L'). Appropriate triangular */ |
| 331 | /* linear systems should be solved with L and L' rather */ |
| 332 | /* than computing inverses. After convergence, an approximate */ |
| 333 | /* eigenvector z of the original problem is recovered by solving */ |
| 334 | /* L'z = x where x is a Ritz vector of OP. */ |
| 335 | |
| 336 | /* 4. At present there is no a-priori analysis to guide the selection */ |
| 337 | /* of NCV relative to NEV. The only formal requirement is that NCV > NEV. */ |
| 338 | /* However, it is recommended that NCV .ge. 2*NEV. If many problems of */ |
| 339 | /* the same type are to be solved, one should experiment with increasing */ |
| 340 | /* NCV while keeping NEV fixed for a given test problem. This will */ |
| 341 | /* usually decrease the required number of OP*x operations but it */ |
| 342 | /* also increases the work and storage required to maintain the orthogonal */ |
| 343 | /* basis vectors. The optimal "cross-over" with respect to CPU time */ |
| 344 | /* is problem dependent and must be determined empirically. */ |
| 345 | |
| 346 | /* 5. If IPARAM(7) = 2 then in the Reverse commuication interface the user */ |
| 347 | /* must do the following. When IDO = 1, Y = OP * X is to be computed. */ |
| 348 | /* When IPARAM(7) = 2 OP = inv(B)*A. After computing A*X the user */ |
| 349 | /* must overwrite X with A*X. Y is then the solution to the linear set */ |
| 350 | /* of equations B*Y = A*X. */ |
| 351 | |
| 352 | /* 6. When IPARAM(1) = 0, and IDO = 3, the user needs to provide the */ |
| 353 | /* NP = IPARAM(8) shifts in locations: */ |
| 354 | /* 1 WORKL(IPNTR(11)) */ |
| 355 | /* 2 WORKL(IPNTR(11)+1) */ |
| 356 | /* . */ |
| 357 | /* . */ |
| 358 | /* . */ |
| 359 | /* NP WORKL(IPNTR(11)+NP-1). */ |
| 360 | |
| 361 | /* The eigenvalues of the current tridiagonal matrix are located in */ |
| 362 | /* WORKL(IPNTR(6)) through WORKL(IPNTR(6)+NCV-1). They are in the */ |
| 363 | /* order defined by WHICH. The associated Ritz estimates are located in */ |
| 364 | /* WORKL(IPNTR(8)), WORKL(IPNTR(8)+1), ... , WORKL(IPNTR(8)+NCV-1). */ |
| 365 | |
| 366 | /* ----------------------------------------------------------------------- */ |
| 367 | |
| 368 | /* \Data Distribution Note: */ |
| 369 | |
| 370 | /* Fortran-D syntax: */ |
| 371 | /* ================ */ |
| 372 | /* REAL RESID(N), V(LDV,NCV), WORKD(3*N), WORKL(LWORKL) */ |
| 373 | /* DECOMPOSE D1(N), D2(N,NCV) */ |
| 374 | /* ALIGN RESID(I) with D1(I) */ |
| 375 | /* ALIGN V(I,J) with D2(I,J) */ |
| 376 | /* ALIGN WORKD(I) with D1(I) range (1:N) */ |
| 377 | /* ALIGN WORKD(I) with D1(I-N) range (N+1:2*N) */ |
| 378 | /* ALIGN WORKD(I) with D1(I-2*N) range (2*N+1:3*N) */ |
| 379 | /* DISTRIBUTE D1(BLOCK), D2(BLOCK,:) */ |
| 380 | /* REPLICATED WORKL(LWORKL) */ |
| 381 | |
| 382 | /* Cray MPP syntax: */ |
| 383 | /* =============== */ |
| 384 | /* REAL RESID(N), V(LDV,NCV), WORKD(N,3), WORKL(LWORKL) */ |
| 385 | /* SHARED RESID(BLOCK), V(BLOCK,:), WORKD(BLOCK,:) */ |
| 386 | /* REPLICATED WORKL(LWORKL) */ |
| 387 | |
| 388 | |
| 389 | /* \BeginLib */ |
| 390 | |
| 391 | /* \References: */ |
| 392 | /* 1. D.C. Sorensen, "Implicit Application of Polynomial Filters in */ |
| 393 | /* a k-Step Arnoldi Method", SIAM J. Matr. Anal. Apps., 13 (1992), */ |
| 394 | /* pp 357-385. */ |
| 395 | /* 2. R.B. Lehoucq, "Analysis and Implementation of an Implicitly */ |
| 396 | /* Restarted Arnoldi Iteration", Rice University Technical Report */ |
| 397 | /* TR95-13, Department of Computational and Applied Mathematics. */ |
| 398 | /* 3. B.N. Parlett, "The Symmetric Eigenvalue Problem". Prentice-Hall, */ |
| 399 | /* 1980. */ |
| 400 | /* 4. B.N. Parlett, B. Nour-Omid, "Towards a Black Box Lanczos Program", */ |
| 401 | /* Computer Physics Communications, 53 (1989), pp 169-179. */ |
| 402 | /* 5. B. Nour-Omid, B.N. Parlett, T. Ericson, P.S. Jensen, "How to */ |
| 403 | /* Implement the Spectral Transformation", Math. Comp., 48 (1987), */ |
| 404 | /* pp 663-673. */ |
| 405 | /* 6. R.G. Grimes, J.G. Lewis and H.D. Simon, "A Shifted Block Lanczos */ |
| 406 | /* Algorithm for Solving Sparse Symmetric Generalized Eigenproblems", */ |
| 407 | /* SIAM J. Matr. Anal. Apps., January (1993). */ |
| 408 | /* 7. L. Reichel, W.B. Gragg, "Algorithm 686: FORTRAN Subroutines */ |
| 409 | /* for Updating the QR decomposition", ACM TOMS, December 1990, */ |
| 410 | /* Volume 16 Number 4, pp 369-377. */ |
| 411 | /* 8. R.B. Lehoucq, D.C. Sorensen, "Implementation of Some Spectral */ |
| 412 | /* Transformations in a k-Step Arnoldi Method". In Preparation. */ |
| 413 | |
| 414 | /* \Routines called: */ |
| 415 | /* dsaup2 ARPACK routine that implements the Implicitly Restarted */ |
| 416 | /* Arnoldi Iteration. */ |
| 417 | /* dstats ARPACK routine that initialize timing and other statistics */ |
| 418 | /* variables. */ |
| 419 | /* second ARPACK utility routine for timing. */ |
| 420 | /* dlamch LAPACK routine that determines machine constants. */ |
| 421 | |
| 422 | /* \Authors */ |
| 423 | /* Danny Sorensen Phuong Vu */ |
| 424 | /* Richard Lehoucq CRPC / Rice University */ |
| 425 | /* Dept. of Computational & Houston, Texas */ |
| 426 | /* Applied Mathematics */ |
| 427 | /* Rice University */ |
| 428 | /* Houston, Texas */ |
| 429 | |
| 430 | /* \Revision history: */ |
| 431 | /* 12/15/93: Version ' 2.4' */ |
| 432 | |
| 433 | /* \SCCS Information: @(#) */ |
| 434 | /* FILE: saupd.F SID: 2.7 DATE OF SID: 8/27/96 RELEASE: 2 */ |
| 435 | |
| 436 | /* \Remarks */ |
| 437 | /* 1. None */ |
| 438 | |
| 439 | /* \EndLib */ |
| 440 | |
| 441 | /* ----------------------------------------------------------------------- */ |
| 442 | |
| 443 | /*< >*/ |
| 444 | /* Subroutine */ int dsaupd_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:131: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, char * |
| 445 | which, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *nev, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *tol, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *resid, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ncv, |
| 446 | 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, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *iparam, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *ipntr, |
| 447 | doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *workd, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *workl, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *lworkl, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *info, |
| 448 | ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`! bmat_len, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`! which_len) |
| 449 | { |
| 450 | /* System generated locals */ |
| 451 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! v_dim1, v_offset, i__1, i__2; |
| 452 | |
| 453 | /* Builtin functions */ |
| 454 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! s_cmpcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:25:9`!(char *, char *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!); |
| 455 | |
| 456 | /* Local variables */ |
| 457 | integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! j; |
| 458 | /* static real t0, t1; */ |
| 459 | static integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! nb, ih, iq, np, iw, ldh, ldq, nev0, mode, ierr, iupd, next, |
| 460 | ritz; |
| 461 | extern /* Subroutine */ int dsaup2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:130: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`! *, char *, |
| 462 | 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`! *, 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`! *, |
| 463 | 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`! *, 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`! *, |
| 464 | 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`! *, 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`! *, |
| 465 | 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`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, |
| 466 | ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!); |
| 467 | 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`!); |
| 468 | extern /* Subroutine */ int 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`! *); |
| 469 | static integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! bounds, ishift, /* msglvl, */ mxiter; |
| 470 | extern /* Subroutine */ int dstats_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:142:9`!(); |
| 471 | |
| 472 | |
| 473 | /* %----------------------------------------------------% */ |
| 474 | /* | Include files for debugging and timing information | */ |
| 475 | /* %----------------------------------------------------% */ |
| 476 | |
| 477 | /*< include 'debug.h' >*/ |
| 478 | /*< include 'stat.h' >*/ |
| 479 | |
| 480 | /* \SCCS Information: @(#) */ |
| 481 | /* FILE: debug.h SID: 2.3 DATE OF SID: 11/16/95 RELEASE: 2 */ |
| 482 | |
| 483 | /* %---------------------------------% */ |
| 484 | /* | See debug.doc for documentation | */ |
| 485 | /* %---------------------------------% */ |
| 486 | /*< >*/ |
| 487 | /*< character bmat*1, which*2 >*/ |
| 488 | |
| 489 | /* %------------------% */ |
| 490 | /* | Scalar Arguments | */ |
| 491 | /* %------------------% */ |
| 492 | |
| 493 | /* %--------------------------------% */ |
| 494 | /* | See stat.doc for documentation | */ |
| 495 | /* %--------------------------------% */ |
| 496 | |
| 497 | /* \SCCS Information: @(#) */ |
| 498 | /* FILE: stat.h SID: 2.2 DATE OF SID: 11/16/95 RELEASE: 2 */ |
| 499 | |
| 500 | /*< save t0, t1, t2, t3, t4, t5 >*/ |
| 501 | |
| 502 | /*< integer nopx, nbx, nrorth, nitref, nrstrt >*/ |
| 503 | /*< >*/ |
| 504 | /*< >*/ |
| 505 | /*< integer ido, info, ldv, lworkl, n, ncv, nev >*/ |
| 506 | /*< >*/ |
| 507 | |
| 508 | /* %-----------------% */ |
| 509 | /* | Array Arguments | */ |
| 510 | /* %-----------------% */ |
| 511 | |
| 512 | /*< integer iparam(11), ipntr(11) >*/ |
| 513 | /*< >*/ |
| 514 | |
| 515 | /* %------------% */ |
| 516 | /* | Parameters | */ |
| 517 | /* %------------% */ |
| 518 | |
| 519 | /*< >*/ |
| 520 | /*< parameter (one = 1.0D+0, zero = 0.0D+0) >*/ |
| 521 | |
| 522 | /* %---------------% */ |
| 523 | /* | Local Scalars | */ |
| 524 | /* %---------------% */ |
| 525 | |
| 526 | /*< >*/ |
| 527 | /*< >*/ |
| 528 | |
| 529 | /* %----------------------% */ |
| 530 | /* | External Subroutines | */ |
| 531 | /* %----------------------% */ |
| 532 | |
| 533 | /*< external dsaup2, second, dstats >*/ |
| 534 | |
| 535 | /* %--------------------% */ |
| 536 | /* | External Functions | */ |
| 537 | /* %--------------------% */ |
| 538 | |
| 539 | /*< >*/ |
| 540 | /*< external dlamch >*/ |
| 541 | |
| 542 | /* %-----------------------% */ |
| 543 | /* | Executable Statements | */ |
| 544 | /* %-----------------------% */ |
| 545 | |
| 546 | /*< if (ido .eq. 0) then >*/ |
| 547 | /* Parameter adjustments */ |
| 548 | --workd; |
| 549 | --resid; |
| 550 | v_dim1 = *ldv; |
| 551 | v_offset = 1 + v_dim1; |
| 552 | v -= v_offset; |
| 553 | --iparam; |
| 554 | --ipntr; |
| 555 | --workl; |
| 556 | |
| 557 | /* Function Body */ |
| 558 | if (*ido == 0) { |
| 559 | |
| 560 | /* %-------------------------------% */ |
| 561 | /* | Initialize timing statistics | */ |
| 562 | /* | & message level for debugging | */ |
| 563 | /* %-------------------------------% */ |
| 564 | |
| 565 | /*< call dstats >*/ |
| 566 | /* dstats_(); */ |
| 567 | /*< call second (t0) >*/ |
| 568 | /* second_(&t0); */ |
| 569 | /*< msglvl = msaupd >*/ |
| 570 | /* msglvl = debug_1.msaupd; */ |
| 571 | |
| 572 | /*< ierr = 0 >*/ |
| 573 | ierr = 0; |
| 574 | /*< ishift = iparam(1) >*/ |
| 575 | ishift = iparam[1]; |
| 576 | /*< mxiter = iparam(3) >*/ |
| 577 | mxiter = iparam[3]; |
| 578 | /*< nb = iparam(4) >*/ |
| 579 | nb = iparam[4]; |
| 580 | |
| 581 | /* %--------------------------------------------% */ |
| 582 | /* | Revision 2 performs only implicit restart. | */ |
| 583 | /* %--------------------------------------------% */ |
| 584 | |
| 585 | /*< iupd = 1 >*/ |
| 586 | iupd = 1; |
| 587 | /*< mode = iparam(7) >*/ |
| 588 | mode = iparam[7]; |
| 589 | |
| 590 | /* %----------------% */ |
| 591 | /* | Error checking | */ |
| 592 | /* %----------------% */ |
| 593 | |
| 594 | /*< if (n .le. 0) then >*/ |
| 595 | if (*n <= 0) { |
| 596 | /*< ierr = -1 >*/ |
| 597 | ierr = -1; |
| 598 | /*< else if (nev .le. 0) then >*/ |
| 599 | } else if (*nev <= 0) { |
| 600 | /*< ierr = -2 >*/ |
| 601 | ierr = -2; |
| 602 | /*< else if (ncv .le. nev .or. ncv .gt. n) then >*/ |
| 603 | } else if (*ncv <= *nev || *ncv > *n) { |
| 604 | /*< ierr = -3 >*/ |
| 605 | ierr = -3; |
| 606 | /*< end if >*/ |
| 607 | } |
| 608 | |
| 609 | /* %----------------------------------------------% */ |
| 610 | /* | NP is the number of additional steps to | */ |
| 611 | /* | extend the length NEV Lanczos factorization. | */ |
| 612 | /* %----------------------------------------------% */ |
| 613 | |
| 614 | /*< np = ncv - nev >*/ |
| 615 | np = *ncv - *nev; |
| 616 | |
| 617 | /*< if (mxiter .le. 0) ierr = -4 >*/ |
| 618 | if (mxiter <= 0) { |
| 619 | ierr = -4; |
| 620 | } |
| 621 | /*< >*/ |
| 622 | if (s_cmpcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:25:9`!(which, "LM", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2) != 0 && s_cmpcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:25:9`!(which, |
| 623 | "SM", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2) != 0 && s_cmpcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:25:9`!(which, "LA", ( |
| 624 | ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2) != 0 && s_cmpcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:25:9`!(which, "SA", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2, ( |
| 625 | ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2) != 0 && s_cmpcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:25:9`!(which, "BE", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2) != |
| 626 | 0) { |
| 627 | ierr = -5; |
| 628 | } |
| 629 | /*< if (bmat .ne. 'I' .and. bmat .ne. 'G') ierr = -6 >*/ |
| 630 | if (*(unsigned char *)bmat != 'I' && *(unsigned char *)bmat != 'G') { |
| 631 | ierr = -6; |
| 632 | } |
| 633 | |
| 634 | /*< if (lworkl .lt. ncv**2 + 8*ncv) ierr = -7 >*/ |
| 635 | /* Computing 2nd power */ |
| 636 | i__1 = *ncv; |
| 637 | if (*lworkl < i__1 * i__1 + (*ncv << 3)) { |
| 638 | ierr = -7; |
| 639 | } |
| 640 | /*< if (mode .lt. 1 .or. mode .gt. 5) then >*/ |
| 641 | if (mode < 1 || mode > 5) { |
| 642 | /*< ierr = -10 >*/ |
| 643 | ierr = -10; |
| 644 | /*< else if (mode .eq. 1 .and. bmat .eq. 'G') then >*/ |
| 645 | } else if (mode == 1 && *(unsigned char *)bmat == 'G') { |
| 646 | /*< ierr = -11 >*/ |
| 647 | ierr = -11; |
| 648 | /*< else if (ishift .lt. 0 .or. ishift .gt. 1) then >*/ |
| 649 | } else if (ishift < 0 || ishift > 1) { |
| 650 | /*< ierr = -12 >*/ |
| 651 | ierr = -12; |
| 652 | /*< else if (nev .eq. 1 .and. which .eq. 'BE') then >*/ |
| 653 | } else if (*nev == 1 && s_cmpcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:25:9`!(which, "BE", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2) == 0) |
| 654 | { |
| 655 | /*< ierr = -13 >*/ |
| 656 | ierr = -13; |
| 657 | /*< end if >*/ |
| 658 | } |
| 659 | |
| 660 | /* %------------% */ |
| 661 | /* | Error Exit | */ |
| 662 | /* %------------% */ |
| 663 | |
| 664 | /*< if (ierr .ne. 0) then >*/ |
| 665 | if (ierr != 0) { |
| 666 | /*< info = ierr >*/ |
| 667 | *info = ierr; |
| 668 | /*< ido = 99 >*/ |
| 669 | *ido = 99; |
| 670 | /*< go to 9000 >*/ |
| 671 | goto L9000; |
| 672 | /*< end if >*/ |
| 673 | } |
| 674 | |
| 675 | /* %------------------------% */ |
| 676 | /* | Set default parameters | */ |
| 677 | /* %------------------------% */ |
| 678 | |
| 679 | /*< if (nb .le. 0) nb = 1 >*/ |
| 680 | if (nb <= 0) { |
| 681 | nb = 1; |
| 682 | } |
| 683 | /*< if (tol .le. zero) tol = dlamch('EpsMach') >*/ |
| 684 | if (*tol <= 0.) { |
| 685 | *tol = dlamch_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:81:9`!("EpsMach", (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)7); |
| 686 | } |
| 687 | |
| 688 | /* %----------------------------------------------% */ |
| 689 | /* | NP is the number of additional steps to | */ |
| 690 | /* | extend the length NEV Lanczos factorization. | */ |
| 691 | /* | NEV0 is the local variable designating the | */ |
| 692 | /* | size of the invariant subspace desired. | */ |
| 693 | /* %----------------------------------------------% */ |
| 694 | |
| 695 | /*< np = ncv - nev >*/ |
| 696 | np = *ncv - *nev; |
| 697 | /*< nev0 = nev >*/ |
| 698 | nev0 = *nev; |
| 699 | |
| 700 | /* %-----------------------------% */ |
| 701 | /* | Zero out internal workspace | */ |
| 702 | /* %-----------------------------% */ |
| 703 | |
| 704 | /*< do 10 j = 1, ncv**2 + 8*ncv >*/ |
| 705 | /* Computing 2nd power */ |
| 706 | i__2 = *ncv; |
| 707 | i__1 = i__2 * i__2 + (*ncv << 3); |
| 708 | for (j = 1; j <= i__1; ++j) { |
| 709 | /*< workl(j) = zero >*/ |
| 710 | workl[j] = 0.; |
| 711 | /*< 10 continue >*/ |
| 712 | /* L10: */ |
| 713 | } |
| 714 | |
| 715 | /* %-------------------------------------------------------% */ |
| 716 | /* | Pointer into WORKL for address of H, RITZ, BOUNDS, Q | */ |
| 717 | /* | etc... and the remaining workspace. | */ |
| 718 | /* | Also update pointer to be used on output. | */ |
| 719 | /* | Memory is laid out as follows: | */ |
| 720 | /* | workl(1:2*ncv) := generated tridiagonal matrix | */ |
| 721 | /* | workl(2*ncv+1:2*ncv+ncv) := ritz values | */ |
| 722 | /* | workl(3*ncv+1:3*ncv+ncv) := computed error bounds | */ |
| 723 | /* | workl(4*ncv+1:4*ncv+ncv*ncv) := rotation matrix Q | */ |
| 724 | /* | workl(4*ncv+ncv*ncv+1:7*ncv+ncv*ncv) := workspace | */ |
| 725 | /* %-------------------------------------------------------% */ |
| 726 | |
| 727 | /*< ldh = ncv >*/ |
| 728 | ldh = *ncv; |
| 729 | /*< ldq = ncv >*/ |
| 730 | ldq = *ncv; |
| 731 | /*< ih = 1 >*/ |
| 732 | ih = 1; |
| 733 | /*< ritz = ih + 2*ldh >*/ |
| 734 | ritz = ih + (ldh << 1); |
| 735 | /*< bounds = ritz + ncv >*/ |
| 736 | bounds = ritz + *ncv; |
| 737 | /*< iq = bounds + ncv >*/ |
| 738 | iq = bounds + *ncv; |
| 739 | /*< iw = iq + ncv**2 >*/ |
| 740 | /* Computing 2nd power */ |
| 741 | i__1 = *ncv; |
| 742 | iw = iq + i__1 * i__1; |
| 743 | /*< next = iw + 3*ncv >*/ |
| 744 | next = iw + *ncv * 3; |
| 745 | |
| 746 | /*< ipntr(4) = next >*/ |
| 747 | ipntr[4] = next; |
| 748 | /*< ipntr(5) = ih >*/ |
| 749 | ipntr[5] = ih; |
| 750 | /*< ipntr(6) = ritz >*/ |
| 751 | ipntr[6] = ritz; |
| 752 | /*< ipntr(7) = bounds >*/ |
| 753 | ipntr[7] = bounds; |
| 754 | /*< ipntr(11) = iw >*/ |
| 755 | ipntr[11] = iw; |
| 756 | /*< end if >*/ |
| 757 | } |
| 758 | |
| 759 | /* %-------------------------------------------------------% */ |
| 760 | /* | Carry out the Implicitly restarted Lanczos Iteration. | */ |
| 761 | /* %-------------------------------------------------------% */ |
| 762 | |
| 763 | /*< >*/ |
| 764 | dsaup2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:130:9`!(ido, bmat, n, which, &nev0, &np, tol, &resid[1], &mode, &iupd, & |
| 765 | ishift, &mxiter, &v[v_offset], ldv, &workl[ih], &ldh, &workl[ritz] |
| 766 | , &workl[bounds], &workl[iq], &ldq, &workl[iw], &ipntr[1], &workd[ |
| 767 | 1], info, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)2); |
| 768 | |
| 769 | /* %--------------------------------------------------% */ |
| 770 | /* | ido .ne. 99 implies use of reverse communication | */ |
| 771 | /* | to compute operations involving OP or shifts. | */ |
| 772 | /* %--------------------------------------------------% */ |
| 773 | |
| 774 | /*< if (ido .eq. 3) iparam(8) = np >*/ |
| 775 | if (*ido == 3) { |
| 776 | iparam[8] = np; |
| 777 | } |
| 778 | /*< if (ido .ne. 99) go to 9000 >*/ |
| 779 | if (*ido != 99) { |
| 780 | goto L9000; |
| 781 | } |
| 782 | |
| 783 | /*< iparam(3) = mxiter >*/ |
| 784 | iparam[3] = mxiter; |
| 785 | /*< iparam(5) = np >*/ |
| 786 | iparam[5] = np; |
| 787 | /*< iparam(9) = nopx >*/ |
| 788 | /* iparam[9] = timing_1.nopx; */ |
| 789 | /*< iparam(10) = nbx >*/ |
| 790 | /* iparam[10] = timing_1.nbx; */ |
| 791 | /*< iparam(11) = nrorth >*/ |
| 792 | /* iparam[11] = timing_1.nrorth; */ |
| 793 | |
| 794 | /* %------------------------------------% */ |
| 795 | /* | Exit if there was an informational | */ |
| 796 | /* | error within dsaup2. | */ |
| 797 | /* %------------------------------------% */ |
| 798 | |
| 799 | /*< if (info .lt. 0) go to 9000 >*/ |
| 800 | if (*info < 0) { |
| 801 | goto L9000; |
| 802 | } |
| 803 | /*< if (info .eq. 2) info = 3 >*/ |
| 804 | if (*info == 2) { |
| 805 | *info = 3; |
| 806 | } |
| 807 | |
| 808 | /* if (msglvl .gt. 0) then */ |
| 809 | /* call ivout (logfil, 1, mxiter, ndigit, */ |
| 810 | /* & '_saupd: number of update iterations taken') */ |
| 811 | /* call ivout (logfil, 1, np, ndigit, */ |
| 812 | /* & '_saupd: number of "converged" Ritz values') */ |
| 813 | /* call dvout (logfil, np, workl(Ritz), ndigit, */ |
| 814 | /* & '_saupd: final Ritz values') */ |
| 815 | /* call dvout (logfil, np, workl(Bounds), ndigit, */ |
| 816 | /* & '_saupd: corresponding error bounds') */ |
| 817 | /* end if */ |
| 818 | |
| 819 | /*< call second (t1) >*/ |
| 820 | /* second_(&t1); */ |
| 821 | /*< tsaupd = t1 - t0 >*/ |
| 822 | /* timing_1.tsaupd = t1 - t0; */ |
| 823 | |
| 824 | /* if (msglvl .gt. 0) then */ |
| 825 | |
| 826 | /* %--------------------------------------------------------% */ |
| 827 | /* | Version Number & Version Date are defined in version.h | */ |
| 828 | /* %--------------------------------------------------------% */ |
| 829 | |
| 830 | /* write (6,1000) */ |
| 831 | /* write (6,1100) mxiter, nopx, nbx, nrorth, nitref, nrstrt, */ |
| 832 | /* & tmvopx, tmvbx, tsaupd, tsaup2, tsaitr, titref, */ |
| 833 | /* & tgetv0, tseigt, tsgets, tsapps, tsconv */ |
| 834 | /* 1000 format (//, */ |
| 835 | /* & 5x, '==========================================',/ */ |
| 836 | /* & 5x, '= Symmetric implicit Arnoldi update code =',/ */ |
| 837 | /* & 5x, '= Version Number:', ' 2.4', 19x, ' =',/ */ |
| 838 | /* & 5x, '= Version Date: ', ' 07/31/96', 14x, ' =',/ */ |
| 839 | /* & 5x, '==========================================',/ */ |
| 840 | /* & 5x, '= Summary of timing statistics =',/ */ |
| 841 | /* & 5x, '==========================================',//) */ |
| 842 | /* 1100 format ( */ |
| 843 | /* & 5x, 'Total number update iterations = ', i5,/ */ |
| 844 | /* & 5x, 'Total number of OP*x operations = ', i5,/ */ |
| 845 | /* & 5x, 'Total number of B*x operations = ', i5,/ */ |
| 846 | /* & 5x, 'Total number of reorthogonalization steps = ', i5,/ */ |
| 847 | /* & 5x, 'Total number of iterative refinement steps = ', i5,/ */ |
| 848 | /* & 5x, 'Total number of restart steps = ', i5,/ */ |
| 849 | /* & 5x, 'Total time in user OP*x operation = ', f12.6,/ */ |
| 850 | /* & 5x, 'Total time in user B*x operation = ', f12.6,/ */ |
| 851 | /* & 5x, 'Total time in Arnoldi update routine = ', f12.6,/ */ |
| 852 | /* & 5x, 'Total time in saup2 routine = ', f12.6,/ */ |
| 853 | /* & 5x, 'Total time in basic Arnoldi iteration loop = ', f12.6,/ */ |
| 854 | /* & 5x, 'Total time in reorthogonalization phase = ', f12.6,/ */ |
| 855 | /* & 5x, 'Total time in (re)start vector generation = ', f12.6,/ */ |
| 856 | /* & 5x, 'Total time in trid eigenvalue subproblem = ', f12.6,/ */ |
| 857 | /* & 5x, 'Total time in getting the shifts = ', f12.6,/ */ |
| 858 | /* & 5x, 'Total time in applying the shifts = ', f12.6,/ */ |
| 859 | /* & 5x, 'Total time in convergence testing = ', f12.6) */ |
| 860 | /* end if */ |
| 861 | |
| 862 | /*< 9000 continue >*/ |
| 863 | L9000: |
| 864 | |
| 865 | /*< return >*/ |
| 866 | return 0; |
| 867 | |
| 868 | /* %---------------% */ |
| 869 | /* | End of dsaupd | */ |
| 870 | /* %---------------% */ |
| 871 | |
| 872 | /*< end >*/ |
| 873 | } /* dsaupd_ */ |
| 874 | |
| 875 | #ifdef __cplusplus |
| 876 | } |
| 877 | #endif |