template<typename DerivativeStrategy>
struct NumLib::NumericalDerivative< DerivativeStrategy >
Computes numerical derivatives of almost arbitrary function (objects) with respect to scalar or vectorial (Eigen vectors) variables.
- Template Parameters
-
DerivativeStrategy | compute central or forward differences |
Definition at line 208 of file NumericalDifferentiation.h.
|
template<typename Function , typename TupleOfArgs , typename DByDScalar , std::size_t... AllArgIdcs> |
auto | differentiate (Function const &f, TupleOfArgs const &args, DByDScalar const &d_by_dScalar, std::index_sequence< AllArgIdcs... > all_arg_idcs) const |
|
template<typename Function , typename TupleOfArgs , typename DByDScalar , std::size_t... AllArgIdcs, std::size_t PerturbedArgIdx> |
auto | differentiateWrtScalarOrVectorialArgument (std::true_type, Function const &f, TupleOfArgs const &args, DByDScalar const &d_by_dScalar, std::integral_constant< std::size_t, PerturbedArgIdx > perturbed_arg_idx, std::index_sequence< AllArgIdcs... > all_arg_idcs) const |
|
template<typename Function , typename TupleOfArgs , typename DByDScalar , std::size_t... AllArgIdcs, std::size_t PerturbedArgIdx> |
auto | differentiateWrtScalarOrVectorialArgument (std::false_type, Function const &f, TupleOfArgs const &args, DByDScalar const &d_by_dScalar, std::integral_constant< std::size_t, PerturbedArgIdx > perturbed_arg_idx, std::index_sequence< AllArgIdcs... > all_arg_idcs) const |
|
template<typename Function , typename TupleOfArgs , typename DByDScalar , Eigen::Index... PerturbedArgComponents, std::size_t... AllArgIdcs, std::size_t PerturbedArgIdx> |
auto | differentiateWrtAllVectorComponents (Function const &f, TupleOfArgs const &args, DByDScalar const &d_by_dScalar, std::integer_sequence< Eigen::Index, PerturbedArgComponents... >, std::integral_constant< std::size_t, PerturbedArgIdx > perturbed_arg_idx, std::index_sequence< AllArgIdcs... > all_arg_idcs) const |
|
template<typename DerivativeStrategy >
template<typename Function , typename TupleOfArgs , typename DByDScalar , Eigen::Index... PerturbedArgComponents, std::size_t... AllArgIdcs, std::size_t PerturbedArgIdx>
auto NumLib::NumericalDerivative< DerivativeStrategy >::differentiateWrtAllVectorComponents |
( |
Function const & | f, |
|
|
TupleOfArgs const & | args, |
|
|
DByDScalar const & | d_by_dScalar, |
|
|
std::integer_sequence< Eigen::Index, PerturbedArgComponents... > | , |
|
|
std::integral_constant< std::size_t, PerturbedArgIdx > | perturbed_arg_idx, |
|
|
std::index_sequence< AllArgIdcs... > | all_arg_idcs ) const |
|
inlineprivate |
template<typename DerivativeStrategy >
template<typename Function , typename TupleOfArgs , typename DByDScalar , std::size_t... AllArgIdcs, std::size_t PerturbedArgIdx>
auto NumLib::NumericalDerivative< DerivativeStrategy >::differentiateWrtScalarOrVectorialArgument |
( |
std::false_type | , |
|
|
Function const & | f, |
|
|
TupleOfArgs const & | args, |
|
|
DByDScalar const & | d_by_dScalar, |
|
|
std::integral_constant< std::size_t, PerturbedArgIdx > | perturbed_arg_idx, |
|
|
std::index_sequence< AllArgIdcs... > | all_arg_idcs ) const |
|
inlineprivate |
Definition at line 262 of file NumericalDifferentiation.h.
267 {
268 using VectorialArg = std::remove_cvref_t<
269 std::tuple_element_t<PerturbedArgIdx, TupleOfArgs>>;
270 constexpr int N = VectorialArg::RowsAtCompileTime;
271
272 static_assert(
N != Eigen::Dynamic);
273 static_assert(VectorialArg::ColsAtCompileTime == 1,
274 "Row vectors are not supported, yet. If you implement "
275 "support for them, make sure to test your implementation "
276 "thoroughly.");
277
279 f, args, d_by_dScalar,
280 std::make_integer_sequence<Eigen::Index, N>{}, perturbed_arg_idx,
281 all_arg_idcs);
282 }
auto differentiateWrtAllVectorComponents(Function const &f, TupleOfArgs const &args, DByDScalar const &d_by_dScalar, std::integer_sequence< Eigen::Index, PerturbedArgComponents... >, std::integral_constant< std::size_t, PerturbedArgIdx > perturbed_arg_idx, std::index_sequence< AllArgIdcs... > all_arg_idcs) const
References NumLib::NumericalDerivative< DerivativeStrategy >::differentiateWrtAllVectorComponents(), and NumLib::N.
template<typename DerivativeStrategy >
template<typename Function , typename TupleOfArgs , typename DByDScalar , std::size_t... AllArgIdcs, std::size_t PerturbedArgIdx>
auto NumLib::NumericalDerivative< DerivativeStrategy >::differentiateWrtScalarOrVectorialArgument |
( |
std::true_type | , |
|
|
Function const & | f, |
|
|
TupleOfArgs const & | args, |
|
|
DByDScalar const & | d_by_dScalar, |
|
|
std::integral_constant< std::size_t, PerturbedArgIdx > | perturbed_arg_idx, |
|
|
std::index_sequence< AllArgIdcs... > | all_arg_idcs ) const |
|
inlineprivate |