Skip to main content

cartan_optim/
result.rs

1// ~/cartan/cartan-optim/src/result.rs
2
3//! Optimization result type.
4
5use cartan_core::Real;
6
7/// The outcome of a Riemannian optimization run.
8///
9/// Returned by all optimizers. Contains the final iterate, convergence info,
10/// and per-iteration diagnostics.
11#[derive(Debug, Clone)]
12pub struct OptResult<P> {
13    /// The final iterate (best point found).
14    pub point: P,
15    /// Cost function value at the final iterate.
16    pub value: Real,
17    /// Riemannian gradient norm at the final iterate.
18    pub grad_norm: Real,
19    /// Total number of iterations executed.
20    pub iterations: usize,
21    /// Whether the optimizer reached the gradient tolerance.
22    ///
23    /// `false` means max iterations were hit without converging.
24    pub converged: bool,
25}