Loading...
Searching...
No Matches
DerivativeProvider.h File Reference
#include <Eigen/Core>
#include <algorithm>
#include <cmath>
#include <exception>
#include <functional>
#include <limits>
#include <stdexcept>
#include <string>
#include <utility>

Go to the source code of this file.

Classes

class  gpr::derivatives::DerivativeProvider
 A type-erased Hessian and Hessian-vector-product provider. More...
struct  gpr::derivatives::FiniteDifferenceOptions

Namespaces

namespace  gpr
 Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
namespace  gpr::derivatives

Typedefs

using gpr::derivatives::Vector = Eigen::VectorXd
using gpr::derivatives::Matrix = Eigen::MatrixXd
using gpr::derivatives::HessianAction = std::function<bool(const Vector&, Vector&)>
using gpr::derivatives::HessianPreparation = std::function<HessianAction(const Vector&)>
using gpr::derivatives::ForceFunction = std::function<bool(const Vector&, Vector&)>

Functions

DerivativeProvider gpr::derivatives::makeAnalyticDerivativeProvider (HessianPreparation prepare)
 Adapt an analytic Hessian preparation, such as a fitted GP posterior.
double gpr::derivatives::coordinateCharacteristicScale (Eigen::Index column, const FiniteDifferenceOptions &options={})
 Characteristic coordinate length floor scale_i for column.
bool gpr::derivatives::coordinateCharacteristicScale (Eigen::Index column, double &result, const FiniteDifferenceOptions &options={}, std::string *reason=nullptr) noexcept
 Non-throwing characteristic-scale query.
double gpr::derivatives::finiteDifferenceCoordinateStep (const Vector &position, Eigen::Index column, const FiniteDifferenceOptions &options={})
 Per-coordinate central-difference step h_i = h_0 * max(abs(x_i), scale_i).
bool gpr::derivatives::finiteDifferenceCoordinateStep (const Vector &position, Eigen::Index column, double &result, const FiniteDifferenceOptions &options={}, std::string *reason=nullptr) noexcept
 Non-throwing per-coordinate step query.
double gpr::derivatives::finiteDifferenceDirectionStep (const Vector &position, const Vector &direction, const FiniteDifferenceOptions &options={})
 Directional central-difference step h = (h_0 / M) max(1, cbrt(||x||_2 M / 4)), where u is the normalized direction, M = max_i(abs(u_i) / max(abs(x_i), scale_i)) and h_0 is relativeStep.
bool gpr::derivatives::finiteDifferenceDirectionStep (const Vector &position, const Vector &direction, double &result, const FiniteDifferenceOptions &options={}, std::string *reason=nullptr) noexcept
 Non-throwing directional step query.
DerivativeProvider gpr::derivatives::makeFiniteDifferenceForceProvider (ForceFunction force, FiniteDifferenceOptions options={})
 Central differences of a physical force F=-grad(E).
DerivativeProvider gpr::derivatives::makeEnzymeDerivativeProvider (const ForceFunction &)
 Reserved source-compatible factory for the optional Enzyme bridge.

Variables

constexpr bool gpr::derivatives::kEnzymeToolchainDetected = false
constexpr bool gpr::derivatives::kEnzymeDerivativeProviderAvailable = false
 The Enzyme bridge is unavailable until its ABI is pinned.