20struct DLManagedTensorVersioned;
42inline constexpr const char *
kSchemaId =
"eindir.objective-descriptor.v1";
43inline constexpr std::uint64_t
kOpEnergy = 1ull << 0;
44inline constexpr std::uint64_t
kOpForces = 1ull << 1;
62 std::uint64_t features);
76int eval_grad(State *state,
const DLManagedTensorVersioned *x,
double *value,
77 DLManagedTensorVersioned *gradient);
80int minimize(State *state,
double *x, std::size_t n, std::size_t maxiter,
81 double gtol,
double istep, std::size_t memory,
int method,
int minimize(State *state, double *x, std::size_t n, std::size_t maxiter, double gtol, double istep, std::size_t memory, int method, double *value_out)
xts_minimize_eindir on a caller-owned buffer. The caller keeps State.
constexpr int kDtypeFloat
void release(State *state)
State * bind(ObjectiveFunction *objective, Eigen::VectorXd *cached)
Borrow an ObjectiveFunction as an eindir objective.
bool abi_accepts_gradient(std::uint32_t major, std::uint32_t expected_major, std::uint64_t features)
Major must match and the gradient feature bit must be set.
constexpr const char * kSchemaId
int eval_grad(State *state, const DLManagedTensorVersioned *x, double *value, DLManagedTensorVersioned *gradient)
One fused energy and gradient through the borrowed eindir handle.
View eon_requirement()
What an eOn minimization may consume: eV, angstrom, analytic forces.
constexpr std::uint64_t kOpEnergy
constexpr std::uint64_t kOpForces
constexpr std::uint32_t kLifetimeBorrowed
View rgpot_ev_angstrom()
rgpot producer advertising the same units and tensor contract.
const std::string & provenance()
Stamp text from the last successful eindir bind. Empty when unused.
bool compatible(const View &actual, const View &required)
Nonzero when actual satisfies required. Schema id is never a wildcard.
constexpr std::uint64_t kFeatureGradient
constexpr std::uint32_t kLayoutContiguous
Semantic objective contract shared with eindir_objective_descriptor_t.
std::uint32_t callback_lifetime
std::uint32_t tensor_layout