Expand description
Per-iteration “intermediate” context shared with downstream
callers (notably the C-API inspector functions
GetIpoptCurrentIterate / GetIpoptCurrentViolations).
Mirrors upstream Ipopt’s OrigIpoptNLP::GetIpoptCurrent* flow: the
main loop installs a snapshot of the algorithm-side state into
thread-local storage immediately before invoking the user’s
intermediate callback, and clears it on return. Inspector functions
consult the TLS slot; outside the callback window every accessor
reports “not available”.
The snapshot is intentionally cheap to assemble — we stash Rc
handles to IpoptData, IpoptCq, and the algorithm-side IpoptNlp
rather than precomputing every field, so callers that read just one
quantity pay only for what they look at.
Structs§
- CtxGuard
- RAII guard — installs
ctxon construction, clears on drop. Used by the algorithm to scope visibility of live iterate state to one callback fire. - Intermediate
Context - Snapshot stashed in TLS for the duration of one
TNLP::intermediate_callbackinvocation.
Functions§
- is_
active - Whether a context is currently installed.
- with_
current - Read access to the currently installed context. Returns
Noneoutside the intermediate-callback window.