.. index:: pair: group; Free-energy surrogate (ABI 1.23) .. _doxid-group__gpr__capi__fes: Free-energy surrogate (ABI 1.23) ================================ .. toctree:: :hidden: struct_gpr_fes_config_t.rst struct_gpr_fes_rate_config_t.rst struct_gpr_fes_rate_report_t.rst A :ref:`gpr_fes_t ` holds a Gaussian process over a free energy F(s) on a ``dimension`` -dimensional collective-variable space. It observes F at points s, each with its own noise variance, and optionally the gradient of F at some of those points. The prior is the squared-exponential kernel of the scaled distance (one length scale, or one per coordinate when ard is set) around a constant mean equal to the arithmetic mean of the observed F. F must be a free energy: a bias potential, or a biased histogram that has not been reweighted, is not one. Ownership. gpr_fes_create returns a handle that the caller owns until it passes it to gpr_fes_destroy. Every pointer argument is read or written during the call and stays with the caller; the library copies what it keeps, including both configurations. Arrays are row-major, one row per point, and every length counts elements, not bytes. Single writer. A :ref:`gpr_fes_t ` has one writer at a time: gpr_fes_train_checked and gpr_fes_destroy must not overlap any other call on the same handle. A destroyed handle is refused: a second gpr_fes_destroy sets GPR_ERR_INVALID_ARG in :ref:`gpr_last_status() `, and any other call returns GPR_ERR_NULL_HANDLE (the query functions return 0). Failure. Every function that returns int returns GPR_SUCCESS (0) or a negative status and leaves its outputs unwritten on failure. A train call that fails keeps the previous posterior. GPR_ERR_CHOLESKY means the training covariance does not factor at the fitted hyperparameters; GPR_ERR_OPTIMIZER means hyperparameter inference diverged. Size-prefixed structures. :ref:`gpr_fes_config_t `, :ref:`gpr_fes_rate_config_t ` and :ref:`gpr_fes_rate_report_t ` begin with struct_size. An init function writes the first min(out_size, sizeof) bytes of the defaults and sets struct_size to that count; a call reads or writes only the first struct_size bytes, so a caller compiled against an older, shorter structure keeps working when fields are appended. Fields past struct_size take their defaults. .. ref-code-block:: cpp :class: doxyrest-overview-code-block // structs struct :ref:`gpr_fes_config_t`; struct :ref:`gpr_fes_rate_config_t`; struct :ref:`gpr_fes_rate_report_t`;