The R Project SVN R

Rev

Rev 84323 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 84323 Rev 87925
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 2001-2023  The R Core Team
3
 *  Copyright (C) 2001-2025  The R Core Team
4
 *
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
8
 *  (at your option) any later version.
Line 265... Line 265...
265
    double small = 0.0, erro12;
265
    double small = 0.0, erro12;
266
    int ierro;
266
    int ierro;
267
    double a1, a2, b1, b2, defab1, defab2, oflow;
267
    double a1, a2, b1, b2, defab1, defab2, oflow;
268
    int ktmin, nrmax;
268
    int ktmin, nrmax;
269
    double uflow;
269
    double uflow;
270
    Rboolean noext;
270
    bool noext;
271
    int iroff1, iroff2, iroff3;
271
    int iroff1, iroff2, iroff3;
272
    double res3la[3], error1, error2;
272
    double res3la[3], error1, error2;
273
    int id;
273
    int id;
274
    double rlist2[52];
274
    double rlist2[52];
275
    int numrl2;
275
    int numrl2;
276
    double defabs, epmach, erlarg = 0.0, abseps, correc = 0.0, errbnd, resabs;
276
    double defabs, epmach, erlarg = 0.0, abseps, correc = 0.0, errbnd, resabs;
277
    int jupbnd;
277
    int jupbnd;
278
    double erlast, errmax;
278
    double erlast, errmax;
279
    int maxerr;
279
    int maxerr;
280
    double reseps;
280
    double reseps;
281
    Rboolean extrap;
281
    bool extrap;
282
    double ertest = 0.0, errsum;
282
    double ertest = 0.0, errsum;
283
 
283
 
284
/**begin prologue  dqagie
284
/**begin prologue  dqagie
285
***date written   800101   (yymmdd)
285
***date written   800101   (yymmdd)
286
***revision date  830518   (yymmdd)
286
***revision date  830518   (yymmdd)
Line 548... Line 548...
548
    *abserr = oflow;
548
    *abserr = oflow;
549
    nrmax = 1;
549
    nrmax = 1;
550
    nres = 0;
550
    nres = 0;
551
    ktmin = 0;
551
    ktmin = 0;
552
    numrl2 = 2;
552
    numrl2 = 2;
553
    extrap = FALSE;
553
    extrap = false;
554
    noext = FALSE;
554
    noext = false;
555
    ierro = 0;
555
    ierro = 0;
556
    iroff1 = 0;
556
    iroff1 = 0;
557
    iroff2 = 0;
557
    iroff2 = 0;
558
    iroff3 = 0;
558
    iroff3 = 0;
559
    ksgn = -1;
559
    ksgn = -1;
Line 667... Line 667...
667
	     smallest interval. */
667
	     smallest interval. */
668
 
668
 
669
	    if (fabs(blist[maxerr] - alist[maxerr]) > small) {
669
	    if (fabs(blist[maxerr] - alist[maxerr]) > small) {
670
		continue;
670
		continue;
671
	    }
671
	    }
672
	    extrap = TRUE;
672
	    extrap = true;
673
	    nrmax = 2;
673
	    nrmax = 2;
674
	}
674
	}
675
 
675
 
676
	if (ierro != 3 && erlarg > ertest) {
676
	if (ierro != 3 && erlarg > ertest) {
677
 
677
 
Line 716... Line 716...
716
 
716
 
717
/*            prepare bisection of the smallest interval. */
717
/*            prepare bisection of the smallest interval. */
718
 
718
 
719
L70:
719
L70:
720
	if (numrl2 == 1) {
720
	if (numrl2 == 1) {
721
	    noext = TRUE;
721
	    noext = true;
722
	}
722
	}
723
	if (*ier == 5) {
723
	if (*ier == 5) {
724
	    break;
724
	    break;
725
	}
725
	}
726
	maxerr = iord[1];
726
	maxerr = iord[1];
727
	errmax = elist[maxerr];
727
	errmax = elist[maxerr];
728
	nrmax = 1;
728
	nrmax = 1;
729
	extrap = FALSE;
729
	extrap = false;
730
	small *= .5;
730
	small *= .5;
731
	erlarg = errsum;
731
	erlarg = errsum;
732
 L90:
732
 L90:
733
	;
733
	;
734
    }
734
    }
Line 976... Line 976...
976
	     double *abserr, int *neval, int *ier, double *alist,
976
	     double *abserr, int *neval, int *ier, double *alist,
977
	     double *blist, double *rlist, double *elist, int *
977
	     double *blist, double *rlist, double *elist, int *
978
	     iord, int *last)
978
	     iord, int *last)
979
{
979
{
980
    /* Local variables */
980
    /* Local variables */
981
    Rboolean noext, extrap;
981
    bool noext, extrap;
982
    int k,ksgn, nres;
982
    int k,ksgn, nres;
983
    int ierro;
983
    int ierro;
984
    int ktmin, nrmax;
984
    int ktmin, nrmax;
985
    int iroff1, iroff2, iroff3;
985
    int iroff1, iroff2, iroff3;
986
    int id;
986
    int id;
Line 1257... Line 1257...
1257
    *abserr = oflow;
1257
    *abserr = oflow;
1258
    nrmax = 1;
1258
    nrmax = 1;
1259
    nres = 0;
1259
    nres = 0;
1260
    numrl2 = 2;
1260
    numrl2 = 2;
1261
    ktmin = 0;
1261
    ktmin = 0;
1262
    extrap = FALSE;
1262
    extrap = false;
1263
    noext = FALSE;
1263
    noext = false;
1264
    iroff1 = 0;
1264
    iroff1 = 0;
1265
    iroff2 = 0;
1265
    iroff2 = 0;
1266
    iroff3 = 0;
1266
    iroff3 = 0;
1267
    ksgn = -1;
1267
    ksgn = -1;
1268
    if (dres >= (1. - epmach * 50.) * defabs) {
1268
    if (dres >= (1. - epmach * 50.) * defabs) {
Line 1371... Line 1371...
1371
	    smallest interval. */
1371
	    smallest interval. */
1372
 
1372
 
1373
	    if (fabs(blist[maxerr] - alist[maxerr]) > small) {
1373
	    if (fabs(blist[maxerr] - alist[maxerr]) > small) {
1374
		continue;
1374
		continue;
1375
	    }
1375
	    }
1376
	    extrap = TRUE;
1376
	    extrap = true;
1377
	    nrmax = 2;
1377
	    nrmax = 2;
1378
	}
1378
	}
1379
 
1379
 
1380
	if (ierro != 3 && erlarg > ertest) {
1380
	if (ierro != 3 && erlarg > ertest) {
1381
 
1381
 
Line 1419... Line 1419...
1419
	}
1419
	}
1420
 
1420
 
1421
/*           prepare bisection of the smallest interval.  L70: */
1421
/*           prepare bisection of the smallest interval.  L70: */
1422
 
1422
 
1423
	if (numrl2 == 1) {
1423
	if (numrl2 == 1) {
1424
	    noext = TRUE;
1424
	    noext = true;
1425
	}
1425
	}
1426
	if (*ier == 5) {
1426
	if (*ier == 5) {
1427
	    break;
1427
	    break;
1428
	}
1428
	}
1429
	maxerr = iord[1];
1429
	maxerr = iord[1];
1430
	errmax = elist[maxerr];
1430
	errmax = elist[maxerr];
1431
	nrmax = 1;
1431
	nrmax = 1;
1432
	extrap = FALSE;
1432
	extrap = false;
1433
	small *= .5;
1433
	small *= .5;
1434
	erlarg = errsum;
1434
	erlarg = errsum;
1435
 L90:
1435
 L90:
1436
	;
1436
	;
1437
    }
1437
    }