/usr/include/openturns/swig/CenteredFiniteDifferenceGradient_doc.i is in libopenturns-dev 1.9-5.
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 | %feature("docstring") OT::CenteredFiniteDifferenceGradient
"First order centered finite-difference scheme.
Available constructors:
CenteredFiniteDifferenceGradient(*epsilon, evalImpl*)
CenteredFiniteDifferenceGradient(*step, evalImpl*)
Parameters
----------
evalImpl : :class:`~openturns.EvaluationImplementation`
Implementation of the evaluation of a function.
epsilon : float, sequence of float
Finite difference steps for each dimension.
step : :class:`~openturns.FiniteDifferenceStep`
Defines how finite difference steps values are computed.
Notes
-----
*CenteredFiniteDifferenceGradient* provides a first order centered finite-
difference scheme:
.. math::
\\\\frac{\\\\partial f_j}{\\\\partial x_i} \\\\approx \\\\frac{f_j(x + \\\\epsilon_i) - f_j(x - \\\\epsilon_i)}
{2 \\\\epsilon_i}
Examples
--------
>>> import openturns as ot
>>> formulas = ['x1 * sin(x2)', 'cos(x1 + x2)', '(x2 + 1) * exp(x1 - 2 * x2)']
>>> myFunc = ot.SymbolicFunction(['x1', 'x2'], formulas)
>>> epsilon = [0.01]*2
>>> myGradient = ot.CenteredFiniteDifferenceGradient(epsilon, myFunc.getEvaluation())
>>> inPoint = [1.]*2
>>> print(myGradient.gradient(inPoint))
[[ 0.841471 -0.909282 0.735771 ]
[ 0.540293 -0.909282 -1.10366 ]]"
|