Skip to main content

initialize_optimization_state

Function initialize_optimization_state 

Source
pub fn initialize_optimization_state(
    problem: &mut Problem,
) -> OptimizerResult<InitializedState>
Expand description

Initialize optimization state from problem and initial parameters.

This is the common initialization sequence used by all optimizers:

  1. Create variables from initial values
  2. Build variable-to-column index mapping
  3. Build symbolic sparsity structure for Jacobian (sparse mode only)
  4. Compute initial cost

The assembly mode is determined by problem.jacobian_mode.

§Unsupported: variable bounds

Problem::set_variable_bounds is validated and stored, but no optimizer step here enforces it — solving anyway would silently return the unconstrained answer (see codex/issues/ISSUE-0004-variable-bounds-ignored.md). Until bounded optimization is implemented, any variable carrying a non-trivial bound (lower > -inf or upper < inf) is rejected here with a typed error rather than silently ignored.