You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This folder contains mathematical classes and functions.
Derivative tools
Functions for calculating derivatives with different methods:
spline_1d_partial_derivative.hpp : calculate derivatives using a 1d spline representation.
spline_2d_partial_derivative.hpp : calculate derivatives using a 2d spline representation.
central_fdm_partial_derivatives.hpp : calculate derivatives using Finite Difference Method.
Spline derivatives
The spline_builder_2d_cache.hpp file contains a class to be used with a 2d spline representation to compute partial derivatives. The cache class allows for calling the 2d splines builder only once per iteration, even if partial derivatives are evaluated in two directions.
Finite difference derivatives
The method is as follow:
Take a function $f$. We want to approximate the value of $f'(x_1)$ knowing the value of $f(x_1)$, $f(x_2)$ and $f(x_3)$ for
$x_3>x_2>x_1$.
Denote $\alpha :=|x_2-x_1|$ and $\beta :=|x_3-x_2|$.
We call $Df(x_1)$ the approximate value of $f'(x_1)$. We want $|f'(x_1)-Df(x_1)|=o\left(\max(\alpha,\beta\right)^2)$.
To this end, write
One can check than in the uniform case ($\alpha=\beta$) we recover the well known coefficient $-1/2$ and $1/2$ for the centred case
and $-3/2$, $2$ and $-1/2$ for the decentred case.
Utility tools
The l_norm_tools.hpp file contains functions computing the infinity norm. For now, it computes the infinity norm of
a double: $\Vert x \Vert_{\infty} = x$;
a coordinate: $\Vert x \Vert_{\infty} = \max_{i} (|x_i|)$.