1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// ~/cartan/cartan-optim/src/lib.rs
//! # cartan-optim
//!
//! Riemannian optimization algorithms for the cartan library.
//!
//! This crate implements first- and second-order optimization algorithms that
//! operate on any manifold implementing the `Manifold` trait from `cartan-core`.
//!
//! ## Algorithms
//!
//! | Algorithm | Struct/function | Trait requirements |
//! |-----------|----------------|--------------------|
//! | Riemannian Gradient Descent | [`minimize_rgd`] | `Manifold + Retraction` |
//! | Riemannian Conjugate Gradient | [`minimize_rcg`] | `+ ParallelTransport` |
//! | Fréchet Mean (Karcher flow) | [`frechet_mean`] | `Manifold` |
//! | Riemannian Trust Region | [`minimize_rtr`] | `+ Connection` |
//!
//! ## Usage pattern
//!
//! ```rust,no_run
//! use nalgebra::SVector;
//! use cartan_core::manifold::Manifold;
//! use cartan_manifolds::Sphere;
//! use cartan_optim::{minimize_rgd, RGDConfig};
//!
//! let s2 = Sphere::<3>;
//! let config = RGDConfig::default();
//! let p0 = SVector::<f64, 3>::from([0.0, 1.0, 0.0]); // start on equator
//!
//! // Minimize f(p) = -p[0] (drives p toward [1, 0, 0]) on S²
//! let result = minimize_rgd(
//! &s2,
//! |p| -p[0],
//! |p| s2.project_tangent(p, &SVector::from([1.0, 0.0, 0.0])),
//! p0,
//! &config,
//! );
//! ```
//!
//! ## References
//!
//! - Absil, Mahony, Sepulchre. "Optimization Algorithms on Matrix Manifolds."
//! Princeton, 2008.
//! - Boumal. "An Introduction to Optimization on Smooth Manifolds."
//! Cambridge, 2023.
pub use ;
pub use ;
pub use OptResult;
pub use ;
pub use ;