C++ API ======= The pages under *C++ API reference* are generated from the Doxygen comments in the headers, so they change when the headers change. This page says where to start in them and how the installed header names map to the source tree. The C API in ``gpr/capi/gpridge_c.h`` is the versioned boundary (ABI 1.26, see :doc:`C API `); the C++ classes are the same code without a version contract. .. warning:: Experimental instanton and quantum-path work in progress. These interfaces may change. This status applies to the quantum-path and instanton headers, including ``GPLineIntegralNEB.h``, ``LineIntegralNEB.h``, and the ``Quantum*.h`` family. See :doc:`Quantum paths and fluctuations <../explanation/quantum_paths>`. Where the headers are --------------------- The source tree keeps headers under ``gpr/``, ``structures/``, ``backend/``, ``data_types/`` and ``managers/``. A generated page shows the source path, for example ``gpr/ml/GaussianProcessRegression.h``. An installed prefix (``do_install``, the default) also carries forwarding headers in ``include/gpridge/``. Each one is a single ``#include`` of the source header, and the implementation headers they reach are installed beside them under the same relative paths, so relative includes resolve. A consumer writes .. code:: cpp #include #include int main() { return 0; } and links ``libgpridge``. The ``gpridge.pc`` file and the CMake package ``gpridge`` (``find_package(gpridge)``) add the include directory and the library. ``scripts/check_install_closure.py`` checks that every header reachable from ``include/gpridge/*.h`` is installed. Signatures use Eigen and standard-library types, so a C++ program has to be built with the compiler, standard library and Eigen version that built ``libgpridge``. A program that cannot do that links the C API instead. No C++ ABI is versioned. ``abi/gpridge_c.symbols`` records the C functions only, and there is no record of C++ class layouts. Adding a data member or a virtual function to an installed class changes its size, member offsets or virtual table, so a program built against earlier headers has to be rebuilt with the library. The exact NLML Hessian-vector product did this: ``gpr::GaussianProcessRegression`` gained the virtual ``exactNlmlHessianVectorAvailable()`` and five data members, ``funcmin::RgminScg`` gained ``hessianVectorFallback``, ``gpr::StudentTProcessRegression`` overrides the new virtual, and ``gpr::ScgCurvatureMode`` gained ``NLML_HESSIAN_VECTOR``. The C ABI is unchanged. Exact posterior-mean curvature changes the C++ surface again. ``gpr::KernelOperator`` gains the ``MeanCurvature`` status and the virtual ``meanCurvature()``. The ``gpr::geometry::CoordinateChart`` base gains the virtual ``providesDirectionalJacobian()`` and ``directionalJacobian()`` methods; charts that cannot provide the latter leave it empty instead of inviting a finite-difference fallback. The exact forward-mode implementation of ``gpr::tersoffForces(parameters, atoms)`` also drops its former ``step`` argument. Programs built against the earlier C++ declarations must be rebuilt. Entry points ------------ .. list-table:: :header-rows: 1 :widths: 30 35 35 * - To do this - Start at - Installed header * - Fit a GP to energies and gradients and predict - :doc:`../api/class_gpr_GaussianProcessRegression` - ``gpridge/GaussianProcessRegression.h`` * - Search for a first-order saddle with the dimer method - :doc:`../api/class_atmd_AtomicDimer` - ``gpridge/AtomicDimer.h`` * - Run a GP-accelerated NEB (``gpNEB``) - :doc:`../api/struct_gpr_neb_GPNEBConfig`, :doc:`../api/struct_gpr_neb_GPNEBResult` - ``gpridge/GPNEB.h`` * - Hold and interpolate a band - :doc:`../api/class_gpr_neb_NEBPath` - ``gpridge/NEBPath.h`` * - Wrap a potential as an oracle - :doc:`../api/class_pot_PotentialWrapper` - ``gpridge/PotentialWrapper.h`` * - Use a Student-t process instead of a GP - :doc:`../api/class_gpr_StudentTProcessRegression` - ``gpridge/StudentTProcessRegression.h`` * - Everything, by namespace - :doc:`../api/global` - ``include/gpridge/*.h`` The namespaces a reader meets first: ``gpr`` (the GP, kernels, priors and the surrogate-driven searches), ``gpr::neb`` (path, driver, acquisition), ``atmd`` (the dimer), ``pot`` (potential wrappers) and ``gpr::linalg`` (solver and backend selection). The index page lists the rest. The standalone tree ------------------- A second HTML tree built from the same comments, with inline source and a tree view, is published beside this site as `api-cpp `_. Both trees leave out private members, the ``detail`` and ``tests`` namespaces and the ``\*_for_testing`` hooks. Those stay in the headers. Rebuilding the pages -------------------- .. code:: bash pixi run -e docs doxybuild # Doxygen XML, then doxyrest into docs/source/api pixi run -e docs install-doxyhtml The configuration is ``docs/source/Doxyfile_gpridge.cfg``; the namespace summaries are in ``docs/source/namespaces.dox``. The :doc:`documentation build <../development/docs>` page gives the full sequence.