00001 /* dcuhre.f -- translated by f2c (version 20030320). 00002 You must link the resulting object file with the libraries: 00003 -lf2c -lm (in that order) 00004 */ 00005 00006 #ifdef __cplusplus 00007 extern "C" { 00008 #endif 00009 #include "f2c.h" 00010 00011 /* Table of constant values */ 00012 00013 static integer c__15 = 15; 00014 static integer c__1 = 1; 00015 00016 /* Subroutine */ int dcuhre_(integer *ndim, integer *numfun, doublereal *a, 00017 doublereal *b, integer *minpts, integer *maxpts, U_fp funsub, 00018 doublereal *epsabs, doublereal *epsrel, integer *key, integer *nw, 00019 integer *restar, doublereal *result, doublereal *abserr, integer * 00020 neval, integer *ifail, doublereal *work) 00021 { 00022 static integer i1, i2, i3, i4, i5, i6, i7, i8, k1, k2, k3, k4, k5, k6, k7, 00023 k8, num, keyf, lenw, nsub; 00024 static doublereal work2[648]; 00025 extern /* Subroutine */ int dadhre_(integer *, integer *, integer *, 00026 doublereal *, doublereal *, integer *, integer *, U_fp, 00027 doublereal *, doublereal *, integer *, integer *, integer *, 00028 integer *, integer *, doublereal *, doublereal *, integer *, 00029 integer *, integer *, doublereal *, doublereal *, doublereal *, 00030 doublereal *, doublereal *, doublereal *, doublereal *, 00031 doublereal *, doublereal *, doublereal *, doublereal *, 00032 doublereal *, doublereal *, doublereal *, doublereal *, 00033 doublereal *), dchhre_(integer *, integer *, integer *, integer *, 00034 doublereal *, doublereal *, integer *, integer *, doublereal *, 00035 doublereal *, integer *, integer *, integer *, integer *, integer 00036 *, integer *, integer *, integer *, integer *); 00037 static integer minsub, maxsub, wtleng, wrksub; 00038 00039 /* ***BEGIN PROLOGUE DCUHRE */ 00040 /* ***DATE WRITTEN 900116 (YYMMDD) */ 00041 /* ***REVISION DATE 900116 (YYMMDD) */ 00042 /* ***CATEGORY NO. H2B1A1 */ 00043 /* ***AUTHOR */ 00044 /* Jarle Berntsen, The Computing Centre, */ 00045 /* University of Bergen, Thormohlens gt. 55, */ 00046 /* N-5008 Bergen, Norway */ 00047 /* Phone.. 47-5-544055 */ 00048 /* Email.. jarle@eik.ii.uib.no */ 00049 /* Terje O. Espelid, Department of Informatics, */ 00050 /* University of Bergen, Thormohlens gt. 55, */ 00051 /* N-5008 Bergen, Norway */ 00052 /* Phone.. 47-5-544180 */ 00053 /* Email.. terje@eik.ii.uib.no */ 00054 /* Alan Genz, Computer Science Department, Washington State */ 00055 /* University, Pullman, WA 99163-1210, USA */ 00056 /* Phone.. 509-335-2131 */ 00057 /* Email.. acg@cs2.cs.wsu.edu */ 00058 /* ***KEYWORDS automatic multidimensional integrator, */ 00059 /* n-dimensional hyper-rectangles, */ 00060 /* general purpose, global adaptive */ 00061 /* ***PURPOSE The routine calculates an approximation to a given */ 00062 /* vector of definite integrals */ 00063 00064 /* B(1) B(2) B(NDIM) */ 00065 /* I I ... I (F ,F ,...,F ) DX(NDIM)...DX(2)DX(1), */ 00066 /* A(1) A(2) A(NDIM) 1 2 NUMFUN */ 00067 00068 /* where F = F (X ,X ,...,X ), I = 1,2,...,NUMFUN. */ 00069 /* I I 1 2 NDIM */ 00070 00071 /* hopefully satisfying for each component of I the following */ 00072 /* claim for accuracy: */ 00073 /* ABS(I(K)-RESULT(K)).LE.MAX(EPSABS,EPSREL*ABS(I(K))) */ 00074 /* ***DESCRIPTION Computation of integrals over hyper-rectangular */ 00075 /* regions. */ 00076 /* DCUHRE is a driver for the integration routine */ 00077 /* DADHRE, which repeatedly subdivides the region */ 00078 /* of integration and estimates the integrals and the */ 00079 /* errors over the subregions with greatest */ 00080 /* estimated errors until the error request */ 00081 /* is met or MAXPTS function evaluations have been used. */ 00082 00083 /* For NDIM = 2 the default integration rule is of */ 00084 /* degree 13 and uses 65 evaluation points. */ 00085 /* For NDIM = 3 the default integration rule is of */ 00086 /* degree 11 and uses 127 evaluation points. */ 00087 /* For NDIM greater then 3 the default integration rule */ 00088 /* is of degree 9 and uses NUM evaluation points where */ 00089 /* NUM = 1 + 4*2*NDIM + 2*NDIM*(NDIM-1) + 4*NDIM*(NDIM-1) + */ 00090 /* 4*NDIM*(NDIM-1)*(NDIM-2)/3 + 2**NDIM */ 00091 /* The degree 9 rule may also be applied for NDIM = 2 */ 00092 /* and NDIM = 3. */ 00093 /* A rule of degree 7 is available in all dimensions. */ 00094 /* The number of evaluation */ 00095 /* points used by the degree 7 rule is */ 00096 /* NUM = 1 + 3*2*NDIM + 2*NDIM*(NDIM-1) + 2**NDIM */ 00097 00098 /* When DCUHRE computes estimates to a vector of */ 00099 /* integrals, all components of the vector are given */ 00100 /* the same treatment. That is, I(F ) and I(F ) for */ 00101 /* J K */ 00102 /* J not equal to K, are estimated with the same */ 00103 /* subdivision of the region of integration. */ 00104 /* For integrals with enough similarity, we may save */ 00105 /* time by applying DCUHRE to all integrands in one call. */ 00106 /* For integrals that vary continuously as functions of */ 00107 /* some parameter, the estimates produced by DCUHRE will */ 00108 /* also vary continuously when the same subdivision is */ 00109 /* applied to all components. This will generally not be */ 00110 /* the case when the different components are given */ 00111 /* separate treatment. */ 00112 00113 /* On the other hand this feature should be used with */ 00114 /* caution when the different components of the integrals */ 00115 /* require clearly different subdivisions. */ 00116 00117 /* ON ENTRY */ 00118 00119 /* NDIM Integer. */ 00120 /* Number of variables. 1 < NDIM <= 15. */ 00121 /* NUMFUN Integer. */ 00122 /* Number of components of the integral. */ 00123 /* A Real array of dimension NDIM. */ 00124 /* Lower limits of integration. */ 00125 /* B Real array of dimension NDIM. */ 00126 /* Upper limits of integration. */ 00127 /* MINPTS Integer. */ 00128 /* Minimum number of function evaluations. */ 00129 /* MAXPTS Integer. */ 00130 /* Maximum number of function evaluations. */ 00131 /* The number of function evaluations over each subregion */ 00132 /* is NUM. */ 00133 /* If (KEY = 0 or KEY = 1) and (NDIM = 2) Then */ 00134 /* NUM = 65 */ 00135 /* Elseif (KEY = 0 or KEY = 2) and (NDIM = 3) Then */ 00136 /* NUM = 127 */ 00137 /* Elseif (KEY = 0 and NDIM > 3) or (KEY = 3) Then */ 00138 /* NUM = 1 + 4*2*NDIM + 2*NDIM*(NDIM-1) + 4*NDIM*(NDIM-1) + */ 00139 /* 4*NDIM*(NDIM-1)*(NDIM-2)/3 + 2**NDIM */ 00140 /* Elseif (KEY = 4) Then */ 00141 /* NUM = 1 + 3*2*NDIM + 2*NDIM*(NDIM-1) + 2**NDIM */ 00142 /* MAXPTS >= 3*NUM and MAXPTS >= MINPTS */ 00143 /* For 3 < NDIM < 13 the minimum values for MAXPTS are: */ 00144 /* NDIM = 4 5 6 7 8 9 10 11 12 */ 00145 /* KEY = 3: 459 819 1359 2151 3315 5067 7815 12351 20235 */ 00146 /* KEY = 4: 195 309 483 765 1251 2133 3795 7005 13299 */ 00147 /* FUNSUB Externally declared subroutine for computing */ 00148 /* all components of the integrand at the given */ 00149 /* evaluation point. */ 00150 /* It must have parameters (NDIM,X,NUMFUN,FUNVLS) */ 00151 /* Input parameters: */ 00152 /* NDIM Integer that defines the dimension of the */ 00153 /* integral. */ 00154 /* X Real array of dimension NDIM */ 00155 /* that defines the evaluation point. */ 00156 /* NUMFUN Integer that defines the number of */ 00157 /* components of I. */ 00158 /* Output parameter: */ 00159 /* FUNVLS Real array of dimension NUMFUN */ 00160 /* that defines NUMFUN components of the integrand. */ 00161 00162 /* EPSABS Real. */ 00163 /* Requested absolute error. */ 00164 /* EPSREL Real. */ 00165 /* Requested relative error. */ 00166 /* KEY Integer. */ 00167 /* Key to selected local integration rule. */ 00168 /* KEY = 0 is the default value. */ 00169 /* For NDIM = 2 the degree 13 rule is selected. */ 00170 /* For NDIM = 3 the degree 11 rule is selected. */ 00171 /* For NDIM > 3 the degree 9 rule is selected. */ 00172 /* KEY = 1 gives the user the 2 dimensional degree 13 */ 00173 /* integration rule that uses 65 evaluation points. */ 00174 /* KEY = 2 gives the user the 3 dimensional degree 11 */ 00175 /* integration rule that uses 127 evaluation points. */ 00176 /* KEY = 3 gives the user the degree 9 integration rule. */ 00177 /* KEY = 4 gives the user the degree 7 integration rule. */ 00178 /* This is the recommended rule for problems that */ 00179 /* require great adaptivity. */ 00180 /* NW Integer. */ 00181 /* Defines the length of the working array WORK. */ 00182 /* Let MAXSUB denote the maximum allowed number of subregions */ 00183 /* for the given values of MAXPTS, KEY and NDIM. */ 00184 /* MAXSUB = (MAXPTS-NUM)/(2*NUM) + 1 */ 00185 /* NW should be greater or equal to */ 00186 /* MAXSUB*(2*NDIM+2*NUMFUN+2) + 17*NUMFUN + 1 */ 00187 /* For efficient execution on parallel computers */ 00188 /* NW should be chosen greater or equal to */ 00189 /* MAXSUB*(2*NDIM+2*NUMFUN+2) + 17*NUMFUN*MDIV + 1 */ 00190 /* where MDIV is the number of subregions that are divided in */ 00191 /* each subdivision step. */ 00192 /* MDIV is default set internally in DCUHRE equal to 1. */ 00193 /* For efficient execution on parallel computers */ 00194 /* with NPROC processors MDIV should be set equal to */ 00195 /* the smallest integer such that MOD(2*MDIV,NPROC) = 0. */ 00196 00197 /* RESTAR Integer. */ 00198 /* If RESTAR = 0, this is the first attempt to compute */ 00199 /* the integral. */ 00200 /* If RESTAR = 1, then we restart a previous attempt. */ 00201 /* In this case the only parameters for DCUHRE that may */ 00202 /* be changed (with respect to the previous call of DCUHRE) */ 00203 /* are MINPTS, MAXPTS, EPSABS, EPSREL and RESTAR. */ 00204 00205 /* ON RETURN */ 00206 00207 /* RESULT Real array of dimension NUMFUN. */ 00208 /* Approximations to all components of the integral. */ 00209 /* ABSERR Real array of dimension NUMFUN. */ 00210 /* Estimates of absolute errors. */ 00211 /* NEVAL Integer. */ 00212 /* Number of function evaluations used by DCUHRE. */ 00213 /* IFAIL Integer. */ 00214 /* IFAIL = 0 for normal exit, when ABSERR(K) <= EPSABS or */ 00215 /* ABSERR(K) <= ABS(RESULT(K))*EPSREL with MAXPTS or less */ 00216 /* function evaluations for all values of K, */ 00217 /* 1 <= K <= NUMFUN . */ 00218 /* IFAIL = 1 if MAXPTS was too small for DCUHRE */ 00219 /* to obtain the required accuracy. In this case DCUHRE */ 00220 /* returns values of RESULT with estimated absolute */ 00221 /* errors ABSERR. */ 00222 /* IFAIL = 2 if KEY is less than 0 or KEY greater than 4. */ 00223 /* IFAIL = 3 if NDIM is less than 2 or NDIM greater than 15. */ 00224 /* IFAIL = 4 if KEY = 1 and NDIM not equal to 2. */ 00225 /* IFAIL = 5 if KEY = 2 and NDIM not equal to 3. */ 00226 /* IFAIL = 6 if NUMFUN is less than 1. */ 00227 /* IFAIL = 7 if volume of region of integration is zero. */ 00228 /* IFAIL = 8 if MAXPTS is less than 3*NUM. */ 00229 /* IFAIL = 9 if MAXPTS is less than MINPTS. */ 00230 /* IFAIL = 10 if EPSABS < 0 and EPSREL < 0. */ 00231 /* IFAIL = 11 if NW is too small. */ 00232 /* IFAIL = 12 if unlegal RESTAR. */ 00233 /* WORK Real array of dimension NW. */ 00234 /* Used as working storage. */ 00235 /* WORK(NW) = NSUB, the number of subregions in the data */ 00236 /* structure. */ 00237 /* Let WRKSUB=(NW-1-17*NUMFUN*MDIV)/(2*NDIM+2*NUMFUN+2) */ 00238 /* WORK(1),...,WORK(NUMFUN*WRKSUB) contain */ 00239 /* the estimated components of the integrals over the */ 00240 /* subregions. */ 00241 /* WORK(NUMFUN*WRKSUB+1),...,WORK(2*NUMFUN*WRKSUB) contain */ 00242 /* the estimated errors over the subregions. */ 00243 /* WORK(2*NUMFUN*WRKSUB+1),...,WORK(2*NUMFUN*WRKSUB+NDIM* */ 00244 /* WRKSUB) contain the centers of the subregions. */ 00245 /* WORK(2*NUMFUN*WRKSUB+NDIM*WRKSUB+1),...,WORK((2*NUMFUN+ */ 00246 /* NDIM)*WRKSUB+NDIM*WRKSUB) contain subregion half widths. */ 00247 /* WORK(2*NUMFUN*WRKSUB+2*NDIM*WRKSUB+1),...,WORK(2*NUMFUN* */ 00248 /* WRKSUB+2*NDIM*WRKSUB+WRKSUB) contain the greatest errors */ 00249 /* in each subregion. */ 00250 /* WORK((2*NUMFUN+2*NDIM+1)*WRKSUB+1),...,WORK((2*NUMFUN+ */ 00251 /* 2*NDIM+1)*WRKSUB+WRKSUB) contain the direction of */ 00252 /* subdivision in each subregion. */ 00253 /* WORK(2*(NDIM+NUMFUN+1)*WRKSUB),...,WORK(2*(NDIM+NUMFUN+1)* */ 00254 /* WRKSUB+ 17*MDIV*NUMFUN) is used as temporary */ 00255 /* storage in DADHRE. */ 00256 00257 00258 /* DCUHRE Example Test Program */ 00259 00260 00261 /* DTEST1 is a simple test driver for DCUHRE. */ 00262 00263 /* Output produced on a SUN 3/50. */ 00264 00265 /* DCUHRE TEST RESULTS */ 00266 00267 /* FTEST CALLS = 3549, IFAIL = 0 */ 00268 /* N ESTIMATED ERROR INTEGRAL */ 00269 /* 1 0.00000010 0.13850818 */ 00270 /* 2 0.00000013 0.06369469 */ 00271 /* 3 0.00000874 0.05861748 */ 00272 /* 4 0.00000021 0.05407034 */ 00273 /* 5 0.00000019 0.05005614 */ 00274 /* 6 0.00000009 0.04654608 */ 00275 00276 /* PROGRAM DTEST1 */ 00277 /* EXTERNAL FTEST */ 00278 /* INTEGER KEY, N, NF, NDIM, MINCLS, MAXCLS, IFAIL, NEVAL, NW */ 00279 /* PARAMETER (NDIM = 5, NW = 5000, NF = NDIM+1) */ 00280 /* DOUBLE PRECISION A(NDIM), B(NDIM), WRKSTR(NW) */ 00281 /* DOUBLE PRECISION ABSEST(NF), FINEST(NF), ABSREQ, RELREQ */ 00282 /* DO 10 N = 1,NDIM */ 00283 /* A(N) = 0 */ 00284 /* B(N) = 1 */ 00285 /* 10 CONTINUE */ 00286 /* MINCLS = 0 */ 00287 /* MAXCLS = 10000 */ 00288 /* KEY = 0 */ 00289 /* ABSREQ = 0 */ 00290 /* RELREQ = 1E-3 */ 00291 /* CALL DCUHRE(NDIM, NF, A, B, MINCLS, MAXCLS, FTEST, ABSREQ, RELREQ, */ 00292 /* * KEY, NW, 0, FINEST, ABSEST, NEVAL, IFAIL, WRKSTR) */ 00293 /* PRINT 9999, NEVAL, IFAIL */ 00294 /* 9999 FORMAT (8X, 'DCUHRE TEST RESULTS', //' FTEST CALLS = ', I4, */ 00295 /* * ', IFAIL = ', I2, /' N ESTIMATED ERROR INTEGRAL') */ 00296 /* DO 20 N = 1,NF */ 00297 /* PRINT 9998, N, ABSEST(N), FINEST(N) */ 00298 /* 9998 FORMAT (3X, I2, 2F15.8) */ 00299 /* 20 CONTINUE */ 00300 /* END */ 00301 /* SUBROUTINE FTEST(NDIM, Z, NFUN, F) */ 00302 /* INTEGER N, NDIM, NFUN */ 00303 /* DOUBLE PRECISION Z(NDIM), F(NFUN), SUM */ 00304 /* SUM = 0 */ 00305 /* DO 10 N = 1,NDIM */ 00306 /* SUM = SUM + N*Z(N)**2 */ 00307 /* 10 CONTINUE */ 00308 /* F(1) = EXP(-SUM/2) */ 00309 /* DO 20 N = 1,NDIM */ 00310 /* F(N+1) = Z(N)*F(1) */ 00311 /* 20 CONTINUE */ 00312 /* END */ 00313 00314 /* ***LONG DESCRIPTION */ 00315 00316 /* The information for each subregion is contained in the */ 00317 /* data structure WORK. */ 00318 /* When passed on to DADHRE, WORK is split into eight */ 00319 /* arrays VALUES, ERRORS, CENTRS, HWIDTS, GREATE, DIR, */ 00320 /* OLDRES and WORK. */ 00321 /* VALUES contains the estimated values of the integrals. */ 00322 /* ERRORS contains the estimated errors. */ 00323 /* CENTRS contains the centers of the subregions. */ 00324 /* HWIDTS contains the half widths of the subregions. */ 00325 /* GREATE contains the greatest estimated error for each subregion. */ 00326 /* DIR contains the directions for further subdivision. */ 00327 /* OLDRES and WORK are used as work arrays in DADHRE. */ 00328 00329 /* The data structures for the subregions are in DADHRE organized */ 00330 /* as a heap, and the size of GREATE(I) defines the position of */ 00331 /* region I in the heap. The heap is maintained by the program */ 00332 /* DTRHRE. */ 00333 00334 /* The subroutine DADHRE is written for efficient execution on shared */ 00335 /* memory parallel computer. On a computer with NPROC processors we wil */ 00336 /* in each subdivision step divide MDIV regions, where MDIV is */ 00337 /* chosen such that MOD(2*MDIV,NPROC) = 0, in totally 2*MDIV new region */ 00338 /* Each processor will then compute estimates of the integrals and erro */ 00339 /* over 2*MDIV/NPROC subregions in each subdivision step. */ 00340 /* The subroutine for estimating the integral and the error over */ 00341 /* each subregion, DRLHRE, uses WORK2 as a work array. */ 00342 /* We must make sure that each processor writes its results to */ 00343 /* separate parts of the memory, and therefore the sizes of WORK and */ 00344 /* WORK2 are functions of MDIV. */ 00345 /* In order to achieve parallel processing of subregions, compiler */ 00346 /* directives should be placed in front of the DO 200 */ 00347 /* loop in DADHRE on machines like Alliant and CRAY. */ 00348 00349 /* ***REFERENCES */ 00350 /* J.Berntsen, T.O.Espelid and A.Genz, An Adaptive Algorithm */ 00351 /* for the Approximate Calculation of Multiple Integrals, */ 00352 /* To be published. */ 00353 00354 /* J.Berntsen, T.O.Espelid and A.Genz, DCUHRE: An Adaptive */ 00355 /* Multidimensional Integration Routine for a Vector of */ 00356 /* Integrals, To be published. */ 00357 00358 /* ***ROUTINES CALLED DCHHRE,DADHRE */ 00359 /* ***END PROLOGUE DCUHRE */ 00360 00361 /* Global variables. */ 00362 00363 00364 /* Local variables. */ 00365 00366 /* MDIV Integer. */ 00367 /* MDIV is the number of subregions that are divided in */ 00368 /* each subdivision step in DADHRE. */ 00369 /* MDIV is chosen default to 1. */ 00370 /* For efficient execution on parallel computers */ 00371 /* with NPROC processors MDIV should be set equal to */ 00372 /* the smallest integer such that MOD(2*MDIV,NPROC) = 0. */ 00373 /* MAXDIM Integer. */ 00374 /* The maximum allowed value of NDIM. */ 00375 /* MAXWT Integer. The maximum number of weights used by the */ 00376 /* integration rule. */ 00377 /* WTLENG Integer. */ 00378 /* The number of generators used by the selected rule. */ 00379 /* WORK2 Real work space. The length */ 00380 /* depends on the parameters MDIV,MAXDIM and MAXWT. */ 00381 /* MAXSUB Integer. */ 00382 /* The maximum allowed number of subdivisions */ 00383 /* for the given values of KEY, NDIM and MAXPTS. */ 00384 /* MINSUB Integer. */ 00385 /* The minimum allowed number of subregions for the given */ 00386 /* values of MINPTS, KEY and NDIM. */ 00387 /* WRKSUB Integer. */ 00388 /* The maximum allowed number of subregions as a function */ 00389 /* of NW, NUMFUN, NDIM and MDIV. This determines the length */ 00390 /* of the main work arrays. */ 00391 /* NUM Integer. The number of integrand evaluations needed */ 00392 /* over each subregion. */ 00393 00394 /* cccccccccccccccccccccccccc */ 00395 00396 /* dave's testing lines */ 00397 00398 /* write(*,*) 'In DCUHRE: ndim=',NDIM,' numfun=',numfun */ 00399 /* write(*,*) 'In DCUHRE: minpts=',MINPTS,' maxpts=',MAXPTS */ 00400 /* write(*,*) 'In DCUHRE: A=',(A(i),i=1,3) */ 00401 /* write(*,*) 'In DCUHRE: B=',(B(i),i=1,3) */ 00402 /* write(*,*) 'In DCUHRE: EPSABS=',EPSABS,' EPSREL=',EPSREL */ 00403 /* write(*,*) 'In DCUHRE: key=',key,' nw=',nw */ 00404 /* call FUNSUB(ndim,b,numfun,result) */ 00405 /* write(*,*) 'In DCUHRE: FUNSUB= ',(result(i),i=1,numfun) */ 00406 /* cccccccccccccccccccccccccc */ 00407 00408 /* ***FIRST EXECUTABLE STATEMENT DCUHRE */ 00409 00410 /* Compute NUM, WTLENG, MAXSUB and MINSUB, */ 00411 /* and check the input parameters. */ 00412 00413 /* Parameter adjustments */ 00414 --b; 00415 --a; 00416 --abserr; 00417 --result; 00418 --work; 00419 00420 /* Function Body */ 00421 dchhre_(&c__15, ndim, numfun, &c__1, &a[1], &b[1], minpts, maxpts, epsabs, 00422 epsrel, key, nw, restar, &num, &maxsub, &minsub, &keyf, ifail, & 00423 wtleng); 00424 wrksub = (*nw - 1 - *numfun * 17) / ((*ndim << 1) + (*numfun << 1) + 2); 00425 if (*ifail != 0) { 00426 goto L999; 00427 } 00428 00429 /* Split up the work space. */ 00430 00431 i1 = 1; 00432 i2 = i1 + wrksub * *numfun; 00433 i3 = i2 + wrksub * *numfun; 00434 i4 = i3 + wrksub * *ndim; 00435 i5 = i4 + wrksub * *ndim; 00436 i6 = i5 + wrksub; 00437 i7 = i6 + wrksub; 00438 i8 = i7 + *numfun; 00439 k1 = 1; 00440 k2 = k1 + (wtleng << 1) * *ndim; 00441 k3 = k2 + wtleng * 5; 00442 k4 = k3 + wtleng; 00443 k5 = k4 + *ndim; 00444 k6 = k5 + *ndim; 00445 k7 = k6 + (*ndim << 1); 00446 k8 = k7 + wtleng * 3; 00447 00448 /* On restart runs the number of subregions from the */ 00449 /* previous call is assigned to NSUB. */ 00450 00451 if (*restar == 1) { 00452 nsub = (integer) work[*nw]; 00453 } 00454 00455 /* Compute the size of the temporary work space needed in DADHRE. */ 00456 00457 lenw = *numfun << 4; 00458 dadhre_(ndim, numfun, &c__1, &a[1], &b[1], &minsub, &maxsub, (U_fp)funsub, 00459 epsabs, epsrel, &keyf, restar, &num, &lenw, &wtleng, &result[1], 00460 &abserr[1], neval, &nsub, ifail, &work[i1], &work[i2], &work[i3], 00461 &work[i4], &work[i5], &work[i6], &work[i7], &work[i8], &work2[k1 00462 - 1], &work2[k2 - 1], &work2[k3 - 1], &work2[k4 - 1], &work2[k5 - 00463 1], &work2[k6 - 1], &work2[k7 - 1], &work2[k8 - 1]); 00464 work[*nw] = (doublereal) nsub; 00465 L999: 00466 return 0; 00467 00468 /* ***END DCUHRE */ 00469 00470 } /* dcuhre_ */ 00471 00472 #ifdef __cplusplus 00473 } 00474 #endif