A class for numeric differentiation with respect to a scalar parameter.
#include <dumux/common/numericdifferentiation.hh>
|
template<class Scalar > |
static Scalar | epsilon (const Scalar value, const Scalar baseEps=1e-10) |
| Computes the epsilon used for numeric differentiation. More...
|
|
template<class Function , class Scalar , class FunctionEvalType > |
static void | partialDerivative (const Function &function, Scalar x0, FunctionEvalType &derivative, const FunctionEvalType &fx0, const int numericDifferenceMethod=1) |
| Computes the derivative of a function with respect to a function parameter. More...
|
|
template<class Function , class Scalar , class FunctionEvalType > |
static void | partialDerivative (const Function &function, Scalar x0, FunctionEvalType &derivative, const FunctionEvalType &fx0, const Scalar eps, const int numericDifferenceMethod=1) |
| Computes the derivative of a function with respect to a function parameter. More...
|
|
◆ epsilon()
template<class Scalar >
static Scalar Dumux::NumericDifferentiation::epsilon |
( |
const Scalar |
value, |
|
|
const Scalar |
baseEps = 1e-10 |
|
) |
| |
|
inlinestatic |
- Parameters
-
value | The value of the variable with respect to which we are differentiating |
baseEps | The step width which we are using for differentiation |
◆ partialDerivative() [1/2]
template<class Function , class Scalar , class FunctionEvalType >
static void Dumux::NumericDifferentiation::partialDerivative |
( |
const Function & |
function, |
|
|
Scalar |
x0, |
|
|
FunctionEvalType & |
derivative, |
|
|
const FunctionEvalType & |
fx0, |
|
|
const int |
numericDifferenceMethod = 1 |
|
) |
| |
|
inlinestatic |
- Note
- Overload using default epsilon computation
◆ partialDerivative() [2/2]
template<class Function , class Scalar , class FunctionEvalType >
static void Dumux::NumericDifferentiation::partialDerivative |
( |
const Function & |
function, |
|
|
Scalar |
x0, |
|
|
FunctionEvalType & |
derivative, |
|
|
const FunctionEvalType & |
fx0, |
|
|
const Scalar |
eps, |
|
|
const int |
numericDifferenceMethod = 1 |
|
) |
| |
|
inlinestatic |
- Parameters
-
function | The function to derive |
x0 | The parameter at which the derivative is ought to be evaluated |
derivative | The partial derivative (output) |
fx0 | The result of the function evaluated at x0 |
eps | The numeric epsilon used in the differentiation |
numericDifferenceMethod | The numeric difference method (1: forward differences (default), 0: central differences, -1: backward differences, 5: five-point stencil method) |
The documentation for this class was generated from the following file: