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.
- Linear
Constraint - A linear constraint: a^T x {<=, =} b.
- Optim
Problem - Declarative optimization problem.
Enums§
- Constraint
Kind - Kind of constraint: equality h(x)=0 or inequality g(x)<=0.
- Objective
Kind - Whether the objective is a scalar function or a least-squares residual.
- Problem
Hint - 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 ofx + h == x(manifesting for|x| > ~5e7at f64 precision). - finite_
diff_ jacobian - Compute a finite-difference Jacobian of residual
ratxusing the canonical central FD stepcbrt(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 ofx + h == x(manifesting for|x| > ~5e7at f64 precision).