Mercurial > octave-nkf
comparison src/DLD-FUNCTIONS/quadcc.cc @ 12553:7c915d013b9c
quadcc: Add reference to original paper in docstring.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Thu, 31 Mar 2011 07:13:33 -0700 |
parents | 4ced6b90fffb |
children | 16cca721117b |
comparison
equal
deleted
inserted
replaced
12552:1cfa3d9adf0a | 12553:7c915d013b9c |
---|---|
1479 | 1479 |
1480 DEFUN_DLD (quadcc, args, nargout, | 1480 DEFUN_DLD (quadcc, args, nargout, |
1481 "-*- texinfo -*-\n\ | 1481 "-*- texinfo -*-\n\ |
1482 @deftypefn {Function File} {[@var{int}, @var{err}, @var{nr_points}] =} quadcc (@var{f}, @var{a}, @var{b}, @var{tol})\n\ | 1482 @deftypefn {Function File} {[@var{int}, @var{err}, @var{nr_points}] =} quadcc (@var{f}, @var{a}, @var{b}, @var{tol})\n\ |
1483 @deftypefnx {Function File} {[@var{int}, @var{err}, @var{nr_points}] =} quadcc (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing})\n\ | 1483 @deftypefnx {Function File} {[@var{int}, @var{err}, @var{nr_points}] =} quadcc (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing})\n\ |
1484 Numerically evaluates an integral using the doubly-adaptive\n\ | 1484 Numerically evaluate an integral using the doubly-adaptive\n\ |
1485 quadrature described by P. Gonnet in @cite{Increasing the\n\ | 1485 Clenshaw-Curtis quadrature described by P. Gonnet in @cite{Increasing the\n\ |
1486 Reliability of Adaptive Quadrature Using Explicit Interpolants},\n\ | 1486 Reliability of Adaptive Quadrature Using Explicit Interpolants}.\n\ |
1487 ACM Transactions on Mathematical Software, in Press, 2010.\n\ | |
1488 The algorithm uses Clenshaw-Curtis quadrature rules of increasing\n\ | 1487 The algorithm uses Clenshaw-Curtis quadrature rules of increasing\n\ |
1489 degree in each interval and bisects the interval if either the\n\ | 1488 degree in each interval and bisects the interval if either the\n\ |
1490 function does not appear to be smooth or a rule of maximum\n\ | 1489 function does not appear to be smooth or a rule of maximum\n\ |
1491 degree has been reached. The error estimate is computed from the\n\ | 1490 degree has been reached. The error estimate is computed from the\n\ |
1492 L2-norm of the difference between two successive interpolations\n\ | 1491 L2-norm of the difference between two successive interpolations\n\ |
1493 of the integrand over the nodes of the respective quadrature rules.\n\ | 1492 of the integrand over the nodes of the respective quadrature rules.\n\ |
1494 \n\ | 1493 \n\ |
1495 For example,\n\ | 1494 For example,\n\ |
1496 \n\ | 1495 \n\ |
1531 If either @var{a} or @var{b} are @code{+/-Inf}, @code{quadcc}\n\ | 1530 If either @var{a} or @var{b} are @code{+/-Inf}, @code{quadcc}\n\ |
1532 integrates @var{f} by substituting the variable of integration\n\ | 1531 integrates @var{f} by substituting the variable of integration\n\ |
1533 with @code{x=tan(pi/2*u)}.\n\ | 1532 with @code{x=tan(pi/2*u)}.\n\ |
1534 \n\ | 1533 \n\ |
1535 @code{quadcc} is capable of dealing with non-numeric\n\ | 1534 @code{quadcc} is capable of dealing with non-numeric\n\ |
1536 values of the integrand such as @code{NaN}, @code{Inf}\n\ | 1535 values of the integrand such as @code{NaN} or @code{Inf}\n\ |
1537 or @code{-Inf}, as in the above example at x=0.\n\ | 1536 , as in the above example at x=0.\n\ |
1538 If the integral diverges and @code{quadcc} detects this, \n\ | 1537 If the integral diverges and @code{quadcc} detects this, \n\ |
1539 a warning is issued and @code{Inf} or @code{-Inf} is returned.\n\ | 1538 a warning is issued and @code{Inf} or @code{-Inf} is returned.\n\ |
1540 \n\ | 1539 \n\ |
1541 Note that @code{quadcc} is a general purpose quadrature algorithm\n\ | 1540 Note that @code{quadcc} is a general purpose quadrature algorithm\n\ |
1542 and as such may be less efficient for smooth or otherwise\n\ | 1541 and as such may be less efficient for smooth or otherwise\n\ |
1543 well-behaved integrand than other methods such as\n\ | 1542 well-behaved integrand than other methods such as\n\ |
1544 @code{quadgk} or @code{trapz}.\n\ | 1543 @code{quadgk} or @code{trapz}.\n\ |
1545 \n\ | 1544 \n\ |
1545 Reference: P. Gonnet, @cite{Increasing the Reliability of Adaptive\n\ | |
1546 Quadrature Using Explicit Interpolants}, ACM Transactions on\n\ | |
1547 Mathematical Software, Vol. 37, Issue 3, Article No. 3, 2010.\n\ | |
1546 @seealso{quad, quadv, quadl, quadgk, trapz, dblquad, triplequad}\n\ | 1548 @seealso{quad, quadv, quadl, quadgk, trapz, dblquad, triplequad}\n\ |
1547 @end deftypefn") | 1549 @end deftypefn") |
1548 { | 1550 { |
1549 | 1551 |
1550 /* Some constants that we will need. */ | 1552 /* Some constants that we will need. */ |