Architecture#
rgmin follows a metatensor-style hourglass: solvers live in
Rust, C sees a small ABI, C++ is a header wrapper.
Layer diagram#
+-----------------------------------------------+
| C++ wrapper |
| include/xts/optimize.hpp |
| include/xts/xtensor.hpp |
+-----------------------------------------------+
| C ABI (cbindgen + hand headers) |
| include/xts.h |
| rgmin_solver_t create/step/free |
| rgmin_minimize over dlpk tensors |
| set_qn_step / set_accept / set_manifold |
+-----------------------------------------------+
| Rust core |
| Solver / Lbfgs / NLCG / BFGS / Newton |
| Manifold (Euclidean, RigidQuotient, MwRigid) |
| Sphere / SO3 / Stiefel / SE3 embeddings |
| LineSearch (Brent, Armijo, Goldstein, Wolfe) |
| eindir DifferentiableObjective |
+-----------------------------------------------+
Objects#
LbfgsPersistent pair history, two-loop recursion, strong Wolfe. Hopping chains hold this type (anneal
WarmLbfgsis a handle).SolverMethod-agnostic session. One
stepis one outer iteration. The C typergmin_solver_tis a pointer to this.minimize_methodCold-start dispatch for every
Method.LineSearch::WolfeNocedal-Wright 3.5 / 3.6. Default production choice for quasi-Newton directions.
OracleClosure adapter that implements
DifferentiableObjectivefor a fused(f, g)function.rgmin_solver_create/rgmin_solver_step/rgmin_solver_freeStateful C waist. Callbacks are per step.
abi_major1,abi_minor9,layout_revision2. Compatibility checks major and layout only.ManifoldKindEmbedded geometry. Euclidean is the identity. Sphere, SO(3), Stiefel
St(n,1), and SE(3) implementproject/retract/transport.rgmin_minimizeFirst-order / quasi-Newton C entry. CPU f64 tensors only; other devices return
RGMIN_UNSUPPORTED_DEVICE.rgmin_minimize_hessNewton / RFO C entry. Caller supplies a dense row-major Hessian. This is a different solver, not an L-BFGS option.
What does not live here#
Simulated annealing, basin hopping, and catalogue logic stay in anneal.
Objective algebra stays in eindir.
Sketch-map style collective variables stay in landfold.