numra-optim 0.1.0

Optimization for Numra: BFGS, L-BFGS, L-BFGS-B, Levenberg-Marquardt, Nelder-Mead, CMA-ES, SQP, LP/MILP, augmented Lagrangian, NSGA-II.
Documentation

numra-optim

Optimization for the Numra workspace — unconstrained, bound-constrained, general constrained, global, multi-objective, and LP / MILP solvers behind a single OptimProblem builder with automatic algorithm selection.

Crates.io docs.rs

Ten-plus algorithms unified under one declarative API. Hand a problem to OptimProblem, optionally with a gradient, and the auto-selector picks BFGS / L-BFGS / L-BFGS-B / SQP / augmented Lagrangian / Nelder-Mead / CMA-ES / NSGA-II based on the constraint structure. For known patterns (nonlinear least squares, linear programs, mixed-integer linear programs), call the specialized solvers directly.

Example

use numra_optim::OptimProblem;

// Minimize Rosenbrock: f(x, y) = (1-x)² + 100(y-x²)²
let r = OptimProblem::new(2)
    .x0(&[0.0, 0.0])
    .objective(|x: &[f64]| {
        let a = 1.0 - x[0];
        let b = x[1] - x[0] * x[0];
        a * a + 100.0 * b * b
    })
    .solve()
    .unwrap();

assert!((r.x[0] - 1.0).abs() < 0.01);
assert!((r.x[1] - 1.0).abs() < 0.01);

What's in this crate

Family Solvers
Unconstrained (quasi-Newton) Bfgs, Lbfgs, bfgs_minimize, lbfgs_minimize
Bound-constrained Lbfgsb, lbfgsb_minimize
Nonlinear least squares lm_minimize (Levenberg-Marquardt)
Constrained (general) sqp_minimize, augmented_lagrangian_minimize
Derivative-free nelder_mead, powell
Global de_minimize (Differential Evolution), cmaes_minimize
Multi-objective nsga2_optimize
Quadratic / Linear active_set_qp_solve, simplex_solve, milp_solve
Declarative builder OptimProblem (auto solver choice via ProblemHint)

Extras: RobustProblem / StochasticProblem for uncertainty-aware optimization; compute_param_sensitivity for post-solve parameter-sensitivity analysis.

Composes with

  • numra-autodiff — supplies analytical gradients / Jacobians
  • numra-nonlinear — Newton inner solves inside SQP and augmented Lagrangian
  • numra-linalg — Hessian factorizations and QP subproblems
  • numra-fit — Levenberg-Marquardt as the curve-fitting backend
  • numra-ocp — outer optimizer for parameter estimation, shooting, and collocation

See interop workflows for the verified autodiff → optim → fit workflow.

Install

[dependencies]
numra-optim = "0.1"

Or via the umbrella crate:

[dependencies]
numra = "0.1"

Documentation

License

Numra Academic & Research License (Non-Commercial). Academic and research use is free; commercial use requires a separate license — contact contact@spectralautomata.com. See LICENSE.