#include <algorithm>#include <cmath>#include <cstdint>#include <cstdio>#include <cstring>#include <exception>#include <limits>#include <memory>#include <new>#include <set>#include <stdexcept>#include <string>#include <vector>#include "ActiveGP.h"#include "AotiPackageIsa.h"#include "NestedEngineOracle.h"#include "gpr/auxiliary/ProblemSetUp.h"#include "gpr/capi/gpridge_c.h"#include "gpr/neb/Session.h"#include "gpr_engine_curvature.h"#include "gpridge_version.h"#include "rgpot_engine_c_abi.h"Go to the source code of this file.
Classes | |
| struct | RgpotEnginePot |
Macros | |
| #define | RGPOT_ENGINE_BUILD |
Functions | |
| int | rgpot_engine_abi_version (void) |
| int | rgpot_engine_abi_compatible (const RgpotEngineAbiStamp *stamp) |
| int | rgpot_engine_available (void) |
| RgpotEnginePot * | rgpot_engine_create (const void *config, std::size_t config_len, char *errbuf, std::size_t errlen) |
| void | rgpot_engine_destroy (RgpotEnginePot *pot) |
| int | rgpot_engine_set_callbacks (RgpotEnginePot *pot, const RgpotEngineCallbacks *callbacks) |
| unsigned long long | rgpot_engine_model_state (const RgpotEnginePot *pot) |
| size_t | rgpot_engine_last_error (const RgpotEnginePot *pot, char *buf, size_t len) |
| int | rgpot_engine_caps (const RgpotEnginePot *pot, RgpotEngineCaps *out) |
| const char * | rgpot_engine_name (void) |
| const char * | rgpot_engine_version (void) |
| size_t | rgpot_engine_model_digest (const RgpotEnginePot *pot, char *buf, size_t len) |
| int | rgpot_engine_set_num_threads (RgpotEnginePot *pot, int intra_op, int inter_op) |
| int | rgpot_engine_set_charge_spin (RgpotEnginePot *pot, int charge, int spin) |
| int | rgpot_engine_select_orbitals (RgpotEnginePot *pot, long long key) |
| int | rgpot_engine_copy_orbitals (RgpotEnginePot *pot, long long from_key, long long to_key) |
| long | rgpot_engine_neighbor_options (const RgpotEnginePot *pot, RgpotEngineNeighborOptions *opts, long capacity) |
| int | rgpot_engine_hvp (RgpotEnginePot *pot, long nAtoms, const double *positions, const int *atomicNrs, const double *direction, double *hv_out, const double *box) |
| int | rgpot_engine_gpr_stats (const RgpotEnginePot *pot, RgpotEngineGprStats *stats_out) |
| int | rgpot_engine_force (RgpotEnginePot *pot, long nAtoms, const double *positions, const int *atomicNrs, double *forces, double *energy, double *variance, const double *box, rgpot_engine_coord_transform transform, void *transform_user) |
| int | rgpot_engine_force_batch (RgpotEnginePot *pot, long nSystems, long nAtoms, const double *positions, const int *atomicNrs, double *forces, double *energies, double *variances, const double *boxes, rgpot_engine_coord_transform transform, void *transform_user) |
| int | rgpot_engine_hessian_checked (RgpotEnginePot *pot, long nAtoms, const double *positions, size_t positions_len, const int *atomicNrs, double *hessian_out, size_t hessian_len, const double *box) |
| int | rgpot_engine_hessian_action_checked (RgpotEnginePot *pot, long nAtoms, const double *positions, size_t positions_len, const int *atomicNrs, const double *direction, size_t direction_len, double *hv_out, size_t hv_len, const double *box, unsigned long long *ops_out, double *scale_out) |
| int | rgpot_engine_prediction_supported_checked (RgpotEnginePot *pot, long nAtoms, const double *positions, size_t positions_len, const int *atomicNrs, const double *box, int *supported_out) |
| int | rgpot_engine_predict_variance_checked (RgpotEnginePot *pot, long nSystems, long nAtoms, const double *positions, size_t positions_len, const int *atomicNrs, double *var_energy_out, size_t var_energy_len, double *var_gradient_out, size_t var_gradient_len, const double *boxes) |
| int | rgpot_engine_hint (RgpotEnginePot *pot, const void *msg, std::size_t msg_len, char *errbuf, std::size_t errlen) |
| #define RGPOT_ENGINE_BUILD |
Definition at line 12 of file GprEngineAbi.cpp.
| int rgpot_engine_abi_compatible | ( | const RgpotEngineAbiStamp * | stamp | ) |
Definition at line 1550 of file GprEngineAbi.cpp.
| int rgpot_engine_abi_version | ( | void | ) |
Definition at line 1545 of file GprEngineAbi.cpp.
| int rgpot_engine_available | ( | void | ) |
Definition at line 1560 of file GprEngineAbi.cpp.
| int rgpot_engine_caps | ( | const RgpotEnginePot * | pot, |
| RgpotEngineCaps * | out ) |
Definition at line 1729 of file GprEngineAbi.cpp.
| int rgpot_engine_copy_orbitals | ( | RgpotEnginePot * | pot, |
| long long | from_key, | ||
| long long | to_key ) |
Definition at line 1798 of file GprEngineAbi.cpp.
| RgpotEnginePot * rgpot_engine_create | ( | const void * | config, |
| std::size_t | config_len, | ||
| char * | errbuf, | ||
| std::size_t | errlen ) |
Definition at line 1565 of file GprEngineAbi.cpp.
| void rgpot_engine_destroy | ( | RgpotEnginePot * | pot | ) |
Definition at line 1689 of file GprEngineAbi.cpp.
| int rgpot_engine_force | ( | RgpotEnginePot * | pot, |
| long | nAtoms, | ||
| const double * | positions, | ||
| const int * | atomicNrs, | ||
| double * | forces, | ||
| double * | energy, | ||
| double * | variance, | ||
| const double * | box, | ||
| rgpot_engine_coord_transform | transform, | ||
| void * | transform_user ) |
Definition at line 1910 of file GprEngineAbi.cpp.
| int rgpot_engine_force_batch | ( | RgpotEnginePot * | pot, |
| long | nSystems, | ||
| long | nAtoms, | ||
| const double * | positions, | ||
| const int * | atomicNrs, | ||
| double * | forces, | ||
| double * | energies, | ||
| double * | variances, | ||
| const double * | boxes, | ||
| rgpot_engine_coord_transform | transform, | ||
| void * | transform_user ) |
Definition at line 2057 of file GprEngineAbi.cpp.
| int rgpot_engine_gpr_stats | ( | const RgpotEnginePot * | pot, |
| RgpotEngineGprStats * | stats_out ) |
Read the operation counters accumulated by the engine instance.
Definition at line 1884 of file GprEngineAbi.cpp.
| int rgpot_engine_hessian_action_checked | ( | RgpotEnginePot * | pot, |
| long | nAtoms, | ||
| const double * | positions, | ||
| size_t | positions_len, | ||
| const int * | atomicNrs, | ||
| const double * | direction, | ||
| size_t | direction_len, | ||
| double * | hv_out, | ||
| size_t | hv_len, | ||
| const double * | box, | ||
| unsigned long long * | ops_out, | ||
| double * | scale_out ) |
Extent-checked Hessian-vector product H(positions) * direction. positions_len, direction_len and hv_len must each be at least n_coords (for residual sessions) or 3*nAtoms. When ops_out and scale_out are non-NULL, the owning implementation writes the floating-point operation count and the magnitude scale used for roundoff certification (ops * DBL_EPSILON * scale). Returns 0 on success, RGPOT_ENGINE_ERR_OUTSIDE_SUPPORT (4) when the query lies outside the trained prediction kernel support.
Definition at line 2287 of file GprEngineAbi.cpp.
| int rgpot_engine_hessian_checked | ( | RgpotEnginePot * | pot, |
| long | nAtoms, | ||
| const double * | positions, | ||
| size_t | positions_len, | ||
| const int * | atomicNrs, | ||
| double * | hessian_out, | ||
| size_t | hessian_len, | ||
| const double * | box ) |
Extent-checked dense Hessian evaluation at one geometry. positions_len must be at least n_dof, and hessian_len at least n_dof * n_dof. n_dof is n_coords when that count is positive, otherwise 3*nAtoms. A longer positions buffer does not enlarge the Hessian. Returns 0 on success.
Definition at line 2251 of file GprEngineAbi.cpp.
| int rgpot_engine_hint | ( | RgpotEnginePot * | pot, |
| const void * | msg, | ||
| std::size_t | msg_len, | ||
| char * | errbuf, | ||
| std::size_t | errlen ) |
Definition at line 2417 of file GprEngineAbi.cpp.
| int rgpot_engine_hvp | ( | RgpotEnginePot * | pot, |
| long | nAtoms, | ||
| const double * | positions, | ||
| const int * | atomicNrs, | ||
| const double * | direction, | ||
| double * | hv_out, | ||
| const double * | box ) |
Definition at line 1818 of file GprEngineAbi.cpp.
| size_t rgpot_engine_last_error | ( | const RgpotEnginePot * | pot, |
| char * | buf, | ||
| size_t | len ) |
Definition at line 1717 of file GprEngineAbi.cpp.
| size_t rgpot_engine_model_digest | ( | const RgpotEnginePot * | pot, |
| char * | buf, | ||
| size_t | len ) |
Definition at line 1762 of file GprEngineAbi.cpp.
| unsigned long long rgpot_engine_model_state | ( | const RgpotEnginePot * | pot | ) |
| const char * rgpot_engine_name | ( | void | ) |
Definition at line 1752 of file GprEngineAbi.cpp.
| long rgpot_engine_neighbor_options | ( | const RgpotEnginePot * | pot, |
| RgpotEngineNeighborOptions * | opts, | ||
| long | capacity ) |
Definition at line 1808 of file GprEngineAbi.cpp.
| int rgpot_engine_predict_variance_checked | ( | RgpotEnginePot * | pot, |
| long | nSystems, | ||
| long | nAtoms, | ||
| const double * | positions, | ||
| size_t | positions_len, | ||
| const int * | atomicNrs, | ||
| double * | var_energy_out, | ||
| size_t | var_energy_len, | ||
| double * | var_gradient_out, | ||
| size_t | var_gradient_len, | ||
| const double * | boxes ) |
Extent-checked posterior energy and gradient variance query at nSystems geometries. positions_len and var_gradient_len must each be at least nSystems * n_coords (for residual sessions) or nSystems * 3 * nAtoms, and var_energy_len at least nSystems. Surrogate-phase rgpot_engine_force and rgpot_engine_force_batch write this energy variance into their variance slot, so a host does not treat the GP as exact. Oracle phases write 0: those evaluations are the true potential. The gradient variance is only available here. Returns 0 on success.
Definition at line 2365 of file GprEngineAbi.cpp.
| int rgpot_engine_prediction_supported_checked | ( | RgpotEnginePot * | pot, |
| long | nAtoms, | ||
| const double * | positions, | ||
| size_t | positions_len, | ||
| const int * | atomicNrs, | ||
| const double * | box, | ||
| int * | supported_out ) |
Extent-checked prediction-support query at one geometry. positions_len must be at least n_coords (for residual sessions) or 3*nAtoms. On success, *supported_out is 1 inside the prediction kernel support and 0 outside it.
Definition at line 2326 of file GprEngineAbi.cpp.
| int rgpot_engine_select_orbitals | ( | RgpotEnginePot * | pot, |
| long long | key ) |
Definition at line 1790 of file GprEngineAbi.cpp.
| int rgpot_engine_set_callbacks | ( | RgpotEnginePot * | pot, |
| const RgpotEngineCallbacks * | callbacks ) |
Definition at line 1694 of file GprEngineAbi.cpp.
| int rgpot_engine_set_charge_spin | ( | RgpotEnginePot * | pot, |
| int | charge, | ||
| int | spin ) |
Definition at line 1782 of file GprEngineAbi.cpp.
| int rgpot_engine_set_num_threads | ( | RgpotEnginePot * | pot, |
| int | intra_op, | ||
| int | inter_op ) |
Definition at line 1770 of file GprEngineAbi.cpp.
| const char * rgpot_engine_version | ( | void | ) |
Definition at line 1757 of file GprEngineAbi.cpp.