Skip to main content

Module problem

Module problem 

Source
Expand description

Declarative optimization problem builder.

Author: Moussa Leblouba Date: 5 March 2026 Modified: 2 May 2026

Structs§

Constraint
A single constraint with optional gradient.
LinearConstraint
A linear constraint: a^T x {<=, =} b.
OptimProblem
Declarative optimization problem.

Enums§

ConstraintKind
Kind of constraint: equality h(x)=0 or inequality g(x)<=0.
ObjectiveKind
Whether the objective is a scalar function or a least-squares residual.
ProblemHint
Hint about problem structure for closure-based objectives.
VarType
Variable type for mixed-integer problems.

Functions§

finite_diff_gradient
Compute a finite-difference gradient using the canonical central FD step cbrt(S::EPSILON) * (1 + |x|), which scales with |x| to remain valid for large-magnitude parameters. The additive scaling prevents silent zero-gradient failures that occur when an unscaled step falls below the precision floor of x + h == x (manifesting for |x| > ~5e7 at f64 precision).
finite_diff_jacobian
Compute a finite-difference Jacobian of residual r at x using the canonical central FD step cbrt(S::EPSILON) * (1 + |x|), which scales with |x| to remain valid for large-magnitude parameters. The additive scaling prevents silent zero-Jacobian failures that occur when an unscaled step falls below the precision floor of x + h == x (manifesting for |x| > ~5e7 at f64 precision).

Type Aliases§

ScalarFn
Boxed scalar function &[S] -> S.
VectorFn
Boxed vector function (&[S], &mut [S]).