| 50 | template <class TScalar, DifferentiabilityMode Mode, |
| 51 | int TDimension = Eigen::Dynamic> |
| 52 | struct FunctionInterface { |
| 53 | static constexpr int Dimension = TDimension; |
| 54 | using ScalarType = TScalar; |
| 55 | using VectorType = Eigen::Matrix<TScalar, Dimension, 1>; |
| 56 | using MatrixType = Eigen::Matrix<TScalar, Dimension, Dimension>; |
| 57 | static constexpr DifferentiabilityMode Differentiability = Mode; |
| 58 | |
| 59 | // Unified signature: even if some derivatives are not computed. |
| 60 | virtual ScalarType operator()(const VectorType& x, VectorType* grad = nullptr, |
| 61 | MatrixType* hess = nullptr) const = 0; |
| 62 | virtual std::unique_ptr<FunctionInterface<TScalar, Mode, Dimension>> clone() |
| 63 | const = 0; |
| 64 | virtual ~FunctionInterface() = default; |
| 65 | }; |
| 66 | |
| 67 | //----------------------------------------------------------------- |
| 68 | // CRTP mixin that supplies the full interface from a simplified operator()(). |
nothing calls this directly
no outgoing calls
no test coverage detected