/usr/include/openturns/swig/NonCenteredFiniteDifferenceGradient_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 | %feature("docstring") OT::NonCenteredFiniteDifferenceGradient
"First order non-centered finite-difference scheme.
Available constructors:
NonCenteredFiniteDifferenceGradient(*epsilon, evalImpl*)
NonCenteredFiniteDifferenceGradient(*step, evalImpl*)
Parameters
----------
evalImpl : :class:`~openturns.NumericalMathEvaluationImplementation`
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
-----
*NonCenteredFiniteDifferenceGradient* provides a first order non-centered
finite-difference scheme:
.. math::
\\\\frac{\\\\partial f_j}{\\\\partial x_i} \\\\approx \\\\frac{f_j(x + \\\\epsilon_i) - f_j(x)}
{\\\\epsilon_i}
Examples
--------
>>> import openturns as ot
>>> formulas = ['x1 * sin(x2)', 'cos(x1 + x2)', '(x2 + 1) * exp(x1 - 2 * x2)']
>>> myFunc = ot.NumericalMathFunction(['x1', 'x2'], ['y1', 'y2', 'y3'], formulas)
>>> epsilon = [0.01]*2
>>> myGradient = ot.NonCenteredFiniteDifferenceGradient(epsilon, myFunc.getEvaluation())
>>> inPoint = [1.]*2
>>> print(myGradient.gradient(inPoint))
[[ 0.841471 -0.907202 0.73945 ]
[ 0.536086 -0.907202 -1.09631 ]]"
|