13 #ifndef EIGEN_NUMERICAL_DIFF_H
14 #define EIGEN_NUMERICAL_DIFF_H
37 template<
typename Functor_, NumericalDiffMode mode=Forward>
42 typedef typename Functor::Scalar
Scalar;
53 template<
typename T0,
typename T1>
55 template<
typename T0,
typename T1,
typename T2>
73 const typename InputType::Index
n = _x.size();
78 val1.resize(Functor::values());
79 val2.resize(Functor::values());
85 Functor::operator()(
x, val1); nfev++;
95 for (
int j = 0;
j <
n; ++
j) {
103 Functor::operator()(
x, val2);
106 jac.col(
j) = (val2-val1)/h;
110 Functor::operator()(
x, val2); nfev++;
112 Functor::operator()(
x, val1); nfev++;
114 jac.col(
j) = (val2-val1)/(2*h);
Functor::InputType InputType
NumericalDiff(Scalar _epsfcn=0.)
Functor::ValueType ValueType
NumericalDiff(const Functor &f, Scalar _epsfcn=0.)
NumericalDiff(const T0 &a0, const T1 &a1, const T2 &a2)
int df(const InputType &_x, JacobianType &jac) const
NumericalDiff(const T0 &a0)
NumericalDiff(const T0 &a0, const T1 &a1)
NumericalDiff & operator=(const NumericalDiff &)
Functor::JacobianType JacobianType
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
Eigen::AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Eigen::internal::remove_all_t< DerType >, typename Eigen::internal::traits< Eigen::internal::remove_all_t< DerType >>::Scalar, product) > sqrt(const Eigen::AutoDiffScalar< DerType > &x)
CleanedUpDerType< DerType >::type() max(const AutoDiffScalar< DerType > &x, const T &y)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_abs_op< typename Derived::Scalar >, const Derived > abs(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sqrt_op< typename Derived::Scalar >, const Derived > sqrt(const Eigen::ArrayBase< Derived > &x)
adouble abs(const adouble &x)