.. index:: pair: class; gpr::derivatives::DerivativeProvider .. _doxid-classgpr_1_1derivatives_1_1_derivative_provider: class gpr::derivatives::DerivativeProvider ========================================== .. toctree:: :hidden: Overview ~~~~~~~~ A type-erased Hessian and Hessian-vector-product provider. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class DerivativeProvider { public: // typedefs typedef std::function`&, :ref:`Matrix`&)> :target:`HessianFunction`; typedef std::function`&, const :ref:`Vector`&, :ref:`Vector`&)> :target:`HessianVectorFunction`; // construction :target:`DerivativeProvider`(); :target:`DerivativeProvider`(:ref:`HessianFunction` hessian, :ref:`HessianVectorFunction` hessian_vector); // methods :target:`operator bool`() const; bool :target:`hessian`(const :ref:`Vector`& position, :ref:`Matrix`& result, std::string* reason = nullptr) const; bool :target:`hessianVector`(const :ref:`Vector`& position, const :ref:`Vector`& direction, :ref:`Vector`& result, std::string* reason = nullptr) const; }; .. _details-classgpr_1_1derivatives_1_1_derivative_provider: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ A type-erased Hessian and Hessian-vector-product provider. False means that the derivative is unavailable or that an input/evaluation was invalid; callback exceptions are caught at this boundary and reported through the optional reason string. Implementations return the Hessian of the energy; force-based providers therefore negate the force Jacobian.