class gpr::derivatives::DerivativeProvider¶
Overview¶
A type-erased Hessian and Hessian-vector-product provider. More…
#include <gpr/derivatives/DerivativeProvider.h>
class DerivativeProvider {
public:
// typedefs
typedef std::function<bool(const Vector&, Matrix&)> HessianFunction;
typedef std::function<bool(const Vector&, const Vector&, Vector&)> HessianVectorFunction;
// construction
DerivativeProvider();
DerivativeProvider(HessianFunction hessian, HessianVectorFunction hessian_vector);
// methods
operator bool() const;
bool hessian(const Vector& position, Matrix& result, std::string* reason = nullptr) const;
bool hessianVector(const Vector& position, const Vector& direction, Vector& result, std::string* reason = nullptr) const;
};
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.