Skip to main content

IpoptWriteSolveReport

Function IpoptWriteSolveReport 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn IpoptWriteSolveReport( ipopt_problem: IpoptProblem, path: *const c_char, detail: *const c_char, ) -> Bool
Expand description

Write a pounce.solve-report/v1 JSON file capturing the most recent IpoptSolve result. path is a NUL-terminated UTF-8 filesystem path. detail is one of "summary" or "full" (NUL-terminated); pass NULL for the default ("summary").

When detail = "full" and IpoptEnableIterHistory was called pre-solve, the per-iteration trajectory is embedded so that downstream tools (diagnose, find_stalls, convergence_trace) see the same trace the pounce CLI’s --json-output path produces. The input descriptor is recorded as tnlp-direct because the cinterface receives callbacks rather than a file.

When that solve ran the complementarity driver (pairs were declared), the report carries the complementarity block at either detail level, built by the same conversion as the CLI’s and Python’s reports; it is absent otherwise.

When that solve took the path without pairs and the second-opinion ladder ran at least one rung, the report carries the second_opinion block (gh#850) at either detail level, from the same conversion and under the same condition as the CLI’s and Python’s; absent when no rung ran, after a driver solve, and after a session solve.

Returns TRUE on a successful write, FALSE for NULL handle, no prior solve, an invalid detail, a bad path, or an I/O error.

§Safety

ipopt_problem must be a valid handle; path must be a valid NUL-terminated UTF-8 string; detail must be NULL or a valid NUL-terminated UTF-8 string.