Skip to main content

Module intermediate

Module intermediate 

Source
Expand description

Intermediate callback infrastructure for ripopt.

Provides a per-iteration callback mechanism matching IPOPT’s SetIntermediateCallback. The callback is stored in a thread-local (same pattern as logging) and invoked after each iteration in the IPM loop.

Also provides thread-local storage for the current iterate, so that ripopt_get_current_iterate and ripopt_get_current_violations can retrieve solver state during the intermediate callback (matching Ipopt’s GetIpoptCurrentIterate and GetIpoptCurrentViolations).

Structs§

IterateSnapshot
Snapshot of solver state, stored during the intermediate callback so that GetCurrentIterate/GetCurrentViolations can read it.

Functions§

invoke_intermediate
Invoke the intermediate callback with current iteration data. Signature matches Ipopt’s Intermediate_CB parameters. Returns true to continue, false to stop (user requested termination).
set_current_iterate
Store a snapshot of the current iterate for GetCurrentIterate/Violations access.
set_intermediate_callback
Install an intermediate callback for the current thread. Pass None to clear.
with_current_iterate
Access the current iterate snapshot (only valid during intermediate callback).