GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
quadcc.cc File Reference
#include <cmath>
#include <algorithm>
#include "lo-ieee.h"
#include "oct-locbuf.h"
#include "defun.h"
#include "error.h"
#include "ovl.h"
#include "parse.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for quadcc.cc:

Go to the source code of this file.

Classes

struct  cquad_ival
 

Macros

#define DEBUG_QUADCC   0
 

Functions

static void downdate (double *c, int n, int d, int *nans, int nnans)
 
OCTAVE_EXPORT octave_value_list Fquadcc (const octave_value_list &args, int) ar
 
nd example oindent which uses the element by element dot form for all operators and the second element is the desired relative tolerance To choose a relative test set the absolute tolerance to zero To choose an absolute test set the relative tolerance to zero The default absolute tolerance is (1e-5 for single)
 
nd example oindent which uses the element by element dot form for all operators and the second element is the desired relative tolerance To choose a relative test set the absolute tolerance to zero To choose an absolute test set the relative tolerance to zero The default absolute tolerance and the default relative tolerance is (1e-4 for single). The optional argument ar
 
static void Vinvfx (const double *fx, double *c, const int d)
 

Variables

contains a list of points where the integrand has known or discontinuities in any of its inside the integration interval For the example above
 
 ar {nr_points}] =} quadcc (ots{}) Numerically evaluate the integral of ar{f} from ar{a} to ar{b} using doubly-adaptive ospell{Clenshaw-Curtis} quadrature. ar{f} is a function handle, inline function, or string containing the name of the function to evaluate. The function ar{f} must be vectorized and must return a vector of output values if given a vector of input values. For example, xample f = @(x) x .* sin (1./x) .* sqrt (abs (1 - x))
 
static const double bee [68]
 
contains a list of points where the integrand has known or discontinuities in any of its derivatives
 
static const double DROP_RELTOL = std::numeric_limits<double>::epsilon () * 10
 
nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as may be less efficient for a smooth or otherwise well behaved integrand than other methods such as Issue
 
nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as may be less efficient for a smooth or otherwise well behaved integrand than other methods such as ite {Increasing the Reliability of Adaptive Quadrature Using Explicit Interpolants}
 
static const double Lalpha [33]
 
static const double Lgamma [33]
 
static const int MIN_CQUAD_HEAPSIZE = 200
 
nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as may be less efficient for a smooth or otherwise well behaved integrand than other methods such as Article No
 
contains a list of points where the integrand has known or discontinuities in any of its inside the integration interval For the example which has a discontinuity at the call to ode {quadcc} would be as follows xample int = quadcc (f, a, b, [], [ 1 ])
 
nd example oindent which uses the element by element dot form for all operators and the second element is the desired relative tolerance To choose a relative test only
 
nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as may be less efficient for a smooth or otherwise well behaved integrand than other methods such as ospell {ACM} Transactions on Mathematical Software
 
contains a list of points where the integrand has known singularities
 
nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as such
 
static const double Tleft [33 *33]
 
static const double Tright [33 *33]
 
static const double V1inv [5 *5]
 
static const double V2inv [9 *9]
 
static const double V3inv [17 *17]
 
static const double V4inv [33 *33]
 
nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as may be less efficient for a smooth or otherwise well behaved integrand than other methods such as Vol
 
contains a list of points where the integrand has known or discontinuities in any of its inside the integration interval For the example which has a discontinuity at x =1
 
static const double xi [33]
 

Macro Definition Documentation

◆ DEBUG_QUADCC

#define DEBUG_QUADCC   0

Definition at line 42 of file quadcc.cc.

Function Documentation

◆ downdate()

static void downdate ( double c,
int  n,
int  d,
int *  nans,
int  nnans 
)
static

Definition at line 1458 of file quadcc.cc.

References bee, c, d, i, Lalpha, Lgamma, and xi.

◆ Fquadcc()

OCTAVE_EXPORT octave_value_list Fquadcc ( const octave_value_list args,
int   
)

Definition at line 1567 of file quadcc.cc.

◆ is() [1/2]

nd example oindent which uses the element by element dot form for all operators and the second element is the desired relative tolerance To choose a relative test set the absolute tolerance to zero To choose an absolute test set the relative tolerance to zero The default absolute tolerance is ( 1e-5 for  single)

◆ is() [2/2]

nd example oindent which uses the element by element dot form for all operators and the second element is the desired relative tolerance To choose a relative test set the absolute tolerance to zero To choose an absolute test set the relative tolerance to zero The default absolute tolerance and the default relative tolerance is ( 1e-4 for  single)

Definition at line 1567 of file quadcc.cc.

◆ Vinvfx()

static void Vinvfx ( const double fx,
double c,
const int  d 
)
static

Definition at line 1413 of file quadcc.cc.

References c, d, i, V1inv, V2inv, V3inv, and V4inv.

Variable Documentation

◆ above

contains a list of points where the integrand has known or discontinuities in any of its inside the integration interval For the example above

Definition at line 1567 of file quadcc.cc.

Referenced by TerminalView::extendSelection().

◆ ar

nd example The result of the integration is returned in the value of ar {nr_points}] =} quadcc (ots{}) Numerically evaluate the integral of ar{f} from ar{a} to ar{b} using doubly-adaptive ospell{Clenshaw-Curtis} quadrature. ar{f} is a function handle, inline function, or string containing the name of the function to evaluate. The function ar{f} must be vectorized and must return a vector of output values if given a vector of input values. For example, xample f = @(x) x .* sin (1./x) .* sqrt (abs (1 - x))

Definition at line 1567 of file quadcc.cc.

◆ bee

const double bee[68]
static
Initial value:
=
{
0.00000000000000e+00, 2.28868854108532e-01, 0.00000000000000e+00,
-8.15740215243451e-01, 0.00000000000000e+00, 5.31212715259731e-01,
0.00000000000000e+00, 1.38538036812454e-02, 0.00000000000000e+00,
3.74405228908818e-02, 0.00000000000000e+00, 2.12224115039342e-01,
0.00000000000000e+00, -8.16362644507898e-01, 0.00000000000000e+00,
5.35648426691481e-01, 0.00000000000000e+00, 1.52417902753662e-03,
0.00000000000000e+00, 2.63058840550873e-03, 0.00000000000000e+00,
4.15292106318904e-03, 0.00000000000000e+00, 6.97106011119775e-03,
0.00000000000000e+00, 1.35535708431058e-02, 0.00000000000000e+00,
3.52132898424856e-02, 0.00000000000000e+00, 2.06946714741884e-01,
0.00000000000000e+00, -8.15674251283876e-01, 0.00000000000000e+00,
5.38841175520580e-01, 0.00000000000000e+00, 1.84909689577590e-04,
0.00000000000000e+00, 2.90936325007499e-04, 0.00000000000000e+00,
3.84877750950089e-04, 0.00000000000000e+00, 4.86436656735046e-04,
0.00000000000000e+00, 6.08688640346879e-04, 0.00000000000000e+00,
7.66732830740331e-04, 0.00000000000000e+00, 9.82753336104205e-04,
0.00000000000000e+00, 1.29359957505615e-03, 0.00000000000000e+00,
1.76616363801885e-03, 0.00000000000000e+00, 2.53323433039089e-03,
0.00000000000000e+00, 3.88872172121956e-03, 0.00000000000000e+00,
6.58635106468291e-03, 0.00000000000000e+00, 1.30326736343254e-02,
0.00000000000000e+00, 3.44353850696714e-02, 0.00000000000000e+00,
2.05025409531915e-01, 0.00000000000000e+00, -8.14985893995401e-01,
0.00000000000000e+00, 5.40679930965238e-01
}

Definition at line 79 of file quadcc.cc.

Referenced by downdate().

◆ derivatives

contains a list of points where the integrand has known or discontinuities in any of its derivatives

Definition at line 1567 of file quadcc.cc.

◆ DROP_RELTOL

const double DROP_RELTOL = std::numeric_limits<double>::epsilon () * 10
static

Definition at line 58 of file quadcc.cc.

◆ Issue

nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as may be less efficient for a smooth or otherwise well behaved integrand than other methods such as Issue

Definition at line 1567 of file quadcc.cc.

◆ ite

nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as may be less efficient for a smooth or otherwise well behaved integrand than other methods such as ite {Increasing the Reliability of Adaptive Quadrature Using Explicit Interpolants}

Definition at line 1567 of file quadcc.cc.

◆ Lalpha

const double Lalpha[33]
static
Initial value:
=
{
5.77350269189626e-01, 5.16397779494322e-01, 5.07092552837110e-01,
5.03952630678970e-01, 5.02518907629606e-01, 5.01745206004255e-01,
5.01280411827603e-01, 5.00979432868120e-01, 5.00773395667191e-01,
5.00626174321759e-01, 5.00517330712619e-01, 5.00434593736979e-01,
5.00370233297676e-01, 5.00319182924304e-01, 5.00278009473803e-01,
5.00244319584578e-01, 5.00216403386025e-01, 5.00193012939056e-01,
5.00173220168024e-01, 5.00156323280355e-01, 5.00141783641018e-01,
5.00129182278347e-01, 5.00118189340972e-01, 5.00108542278496e-01,
5.00100030010004e-01, 5.00092481273333e-01, 5.00085755939229e-01,
5.00079738458365e-01, 5.00074332862969e-01, 5.00069458915387e-01,
5.00065049112355e-01, 5.00061046334395e-01, 5.00057401986298e-01
}

Definition at line 106 of file quadcc.cc.

Referenced by downdate().

◆ Lgamma

const double Lgamma[33]
static
Initial value:
=
{
0.0, 0.0, 5.16397779494322e-01, 5.07092552837110e-01, 5.03952630678970e-01,
5.02518907629606e-01, 5.01745206004255e-01, 5.01280411827603e-01,
5.00979432868120e-01, 5.00773395667191e-01, 5.00626174321759e-01,
5.00517330712619e-01, 5.00434593736979e-01, 5.00370233297676e-01,
5.00319182924304e-01, 5.00278009473803e-01, 5.00244319584578e-01,
5.00216403386025e-01, 5.00193012939056e-01, 5.00173220168024e-01,
5.00156323280355e-01, 5.00141783641018e-01, 5.00129182278347e-01,
5.00118189340972e-01, 5.00108542278496e-01, 5.00100030010003e-01,
5.00092481273333e-01, 5.00085755939229e-01, 5.00079738458365e-01,
5.00074332862969e-01, 5.00069458915387e-01, 5.00065049112355e-01,
5.00061046334395e-01
}

Definition at line 121 of file quadcc.cc.

Referenced by downdate().

◆ MIN_CQUAD_HEAPSIZE

const int MIN_CQUAD_HEAPSIZE = 200
static

Definition at line 45 of file quadcc.cc.

◆ No

nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as may be less efficient for a smooth or otherwise well behaved integrand than other methods such as Article No

◆ ode

nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as may be less efficient for a smooth or otherwise well behaved integrand than other methods such as ode {quadcc} would be as follows xample int = quadcc (f, a, b, [], [ 1 ])

Definition at line 1567 of file quadcc.cc.

◆ only

nd example oindent which uses the element by element dot form for all operators and the second element is the desired relative tolerance To choose a relative test set the absolute tolerance to zero To choose an absolute test only

Definition at line 1567 of file quadcc.cc.

◆ ospell

nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as may be less efficient for a smooth or otherwise well behaved integrand than other methods such as ospell {ACM} Transactions on Mathematical Software

Definition at line 1567 of file quadcc.cc.

◆ singularities

contains a list of points where the integrand has known singularities

Definition at line 1567 of file quadcc.cc.

◆ such

nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as such

Definition at line 1567 of file quadcc.cc.

◆ Tleft

const double Tleft[33 *33]
static

Definition at line 899 of file quadcc.cc.

◆ Tright

const double Tright[33 *33]
static

Definition at line 1154 of file quadcc.cc.

◆ V1inv

const double V1inv[5 *5]
static
Initial value:
=
{
.47140452079103168293e-1, .37712361663282534635, .56568542494923801952,
.37712361663282534635, .47140452079103168293e-1,
-.81649658092772603273e-1, -.46188021535170061160, 0,
.46188021535170061160, .81649658092772603273e-1, .15058465048420853962,
.12046772038736683169, -.54210474174315074262, .12046772038736683169,
.15058465048420853962, -.21380899352993950775, .30237157840738178177, -0.,
-.30237157840738178177, .21380899352993950775, .10774960475223581324,
-.21549920950447162648, .21549920950447162648, -.21549920950447162648,
.10774960475223581324
}

Definition at line 136 of file quadcc.cc.

Referenced by Vinvfx().

◆ V2inv

const double V2inv[9 *9]
static

Definition at line 149 of file quadcc.cc.

Referenced by Vinvfx().

◆ V3inv

const double V3inv[17 *17]
static

Definition at line 184 of file quadcc.cc.

Referenced by Vinvfx().

◆ V4inv

const double V4inv[33 *33]
static

Definition at line 322 of file quadcc.cc.

Referenced by Vinvfx().

◆ Vol

nd example The result of the integration is returned in the value of it is recommended to verify this value for difficult integrands and then a warning is issued and as may be less efficient for a smooth or otherwise well behaved integrand than other methods such as Vol

Definition at line 1567 of file quadcc.cc.

◆ x

contains a list of points where the integrand has known or discontinuities in any of its inside the integration interval For the example which has a discontinuity at x =1

Definition at line 1567 of file quadcc.cc.

◆ xi

const double xi[33]
static
Initial value:
=
{
-1., -0.99518472667219688624, -0.98078528040323044912,
-0.95694033573220886493, -0.92387953251128675612,
-0.88192126434835502970, -0.83146961230254523708,
-0.77301045336273696082, -0.70710678118654752440,
-0.63439328416364549822, -0.55557023301960222475,
-0.47139673682599764857, -0.38268343236508977173,
-0.29028467725446236764, -0.19509032201612826785,
-0.098017140329560601995, 0., 0.098017140329560601995,
0.19509032201612826785, 0.29028467725446236764, 0.38268343236508977173,
0.47139673682599764857, 0.55557023301960222475, 0.63439328416364549822,
0.70710678118654752440, 0.77301045336273696082, 0.83146961230254523708,
0.88192126434835502970, 0.92387953251128675612, 0.95694033573220886493,
0.98078528040323044912, 0.99518472667219688624, 1.
}

Definition at line 62 of file quadcc.cc.

Referenced by downdate(), and F__dsearchn__().