/usr/include/openturns/swig/GaussKronrod_doc.i is in libopenturns-dev 1.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | %feature("docstring") OT::GaussKronrod
"Adaptive integration algorithm of Gauss-Kronrod.
Parameters
----------
maximumSubIntervals : int
The maximal number of subdivisions of the interval :math:`[a,b]`
maximumError : float
The maximal error between Gauss and Kronrod approximations.
GKRule : :class:`~openturns.GaussKronrodRule`
The rule that fixes the number of points used in the Gauss and Kronrod approximations.
Notes
-----
The Gauss-Kronrod algorithm enables to approximate the definite integral:
.. math::
\\\\int_{a}^b f(t)\\\\, dt
with :math:`f: \\\\Rset \\\\mapsto \\\\Rset^p`, using both approximations : Gauss and Kronrod ones defined by:
.. math::
\\\\int_{-1}^1 f(t)\\\\, dt \\\\simeq \\\\omega_0f(0) + \\\\sum_{k=1}^n \\\\omega_k (f(\\\\xi_k)+f(-\\\\xi_k))
and:
.. math::
\\\\int_{-1}^1 f(t)\\\\, dt\\\\simeq \\\\alpha_0f(0) + \\\\sum_{k=1}^{m} \\\\alpha_k (f(\\\\zeta_k)+f(-\\\\zeta_k))
where :math:`\\\\xi_k>0`, :math:`\\\\zeta_k>0`, :math:`\\\\zeta_{2j}=\\\\xi_j`, :math:`\\\\omega_k>0` and :math:`\\\\alpha_k>0`.
The Gauss-Kronrod algorithm evaluates the integral using the Gauss and the Konrod approximations. If the difference between both approximations is greater that *maximumError*, then the interval :math:`[a,b]` is subdivided into 2 subintervals with the same length. The Gauss-Kronrod algorihtm is then applied on both subintervals with the sames rules. The algorithm is iterative until the difference between both approximations is less that *maximumError*. In that case, the integral on the subinterval is approximated by the Kronrod sum. The subdivision process is limited by *maximumSubIntervals* that imposes the maximum number of subintervals.
The final integral is the sum of the integrals evaluated on the subintervals.
Examples
--------
Create a Gauss-Kronrod algorithm:
>>> import openturns as ot
>>> algo = ot.GaussKronrod(100000, 1e-13, ot.GaussKronrodRule(ot.GaussKronrodRule.G11K23))"
// ---------------------------------------------------------------------
%feature("docstring") OT::GaussKronrod::integrate
"Evaluation of the integral of :math:`f` on an interval.
Available usages:
integrate(*f, interval*)
integrate(*f, interval, error*)
integrate(*f, a, b, error, ai, bi, fi, ei*)
Parameters
----------
f : :class:`~openturns.NumericalMathFunction`, :math:`f: \\\\Rset \\\\mapsto \\\\Rset^p`
The integrand function.
interval : :class:`~openturns.Interval`, :math:`interval \\\\in \\\\Rset`
The integration domain.
error : :class:`~openturns.NumericalPoint`
The error estimation of the approximation.
a,b : float
Bounds of the integration interval.
ai, bi, ei : :class:`~openturns.NumericalPoint`;
*ai* is the set of lower bounds of the subintervals;
*bi* the corresponding upper bounds;
*ei* the associated error estimation.
fi : :class:`~openturns.NumericalSample`
*fi* is the set of :math:`\\\\int_{ai}^{bi} f(t)\\\\, dt`
Returns
-------
value : :class:`~openturns.NumericalPoint`
Approximation of the integral.
Examples
--------
>>> import openturns as ot
>>> f = ot.NumericalMathFunction('x', 'abs(sin(x))')
>>> a = -2.5
>>> b = 4.5
>>> algoGK = ot.GaussKronrod(100000, 1e-13, ot.GaussKronrodRule(ot.GaussKronrodRule.G11K23))
Use the high-level usage:
>>> value = algoGK.integrate(f, ot.Interval(a, b))[0]
>>> print(value)
4.590...
Use the low-level usage:
>>> error = ot.NumericalPoint()
>>> ai = ot.NumericalPoint()
>>> bi = ot.NumericalPoint()
>>> ei = ot.NumericalPoint()
>>> fi = ot.NumericalSample()
>>> value2 = algoGK.integrate(f, a, b, error, ai, bi, fi, ei)[0]
>>> print(value2)
4.590..."
// ---------------------------------------------------------------------
%feature("docstring") OT::GaussKronrod::getMaximumError
"Accessor to the maximal error between Gauss and Kronrod approximations.
Returns
-------
maximumErrorvalue : float, positive
The maximal error between Gauss and Kronrod approximations."
// ---------------------------------------------------------------------
%feature("docstring") OT::GaussKronrod::getMaximumSubIntervals
"Accessor to the maximal number of subdivisions of :math:`[a,b]`.
Returns
-------
maximumSubIntervals : float, positive
The maximal number of subdivisions of the interval :math:`[a,b]`."
// ---------------------------------------------------------------------
%feature("docstring") OT::GaussKronrod::getRule
"Accessor to the Gauss-Kronrod rule used in the integration algorithm.
Returns
-------
rule : :class:`~openturns.GaussKronrodRule`
The Gauss-Kronrod rule used in the integration algorithm."
// ---------------------------------------------------------------------
%feature("docstring") OT::GaussKronrod::setMaximumError
"Set the maximal error between Gauss and Kronrod approximations.
Parameters
----------
maximumErrorvalue : float, positive
The maximal error between Gauss and Kronrod approximations."
// ---------------------------------------------------------------------
%feature("docstring") OT::GaussKronrod::setMaximumSubIntervals
"Set the maximal number of subdivisions of :math:`[a,b]`.
Parameters
----------
maximumSubIntervals : float, positive
The maximal number of subdivisions of the interval :math:`[a,b]`."
// ---------------------------------------------------------------------
%feature("docstring") OT::GaussKronrod::setRule
"Set the Gauss-Kronrod rule used in the integration algorithm.
Parameters
----------
rule : :class:`~openturns.GaussKronrodRule`
The Gauss-Kronrod rule used in the integration algorithm."
|