Skip to main content

Crate pounce_cinterface

Crate pounce_cinterface 

Source
Expand description

POUNCE C ABI — port of Interfaces/IpStdCInterface.{h,cpp}.

Provides the CreateIpoptProblem / IpoptSolve / FreeIpoptProblem C entry points that existing PyIpopt / cyipopt / JuMP wrappers link against. Function names and signatures match upstream Ipopt 3.14.x exactly so consumers can swap libipopt.{dylib,so} for libpounce_cinterface without rebuilding.

Surface area (in IpStdCInterface.h order):

Pounce extensions for post-solve stats (not present in upstream Ipopt’s C API): GetIpoptIterCount, GetIpoptSolveTime, GetIpoptPrimalInf, GetIpoptDualInf, GetIpoptComplInf.

All entry points are extern "C" and #[no_mangle]. Pointers are raw and the caller is responsible for lifetime; the IpoptProblem handle is opaque (*mut c_void from C’s perspective). The Fortran 77 ABI shim lives in fortran.

Modules§

fortran
Fortran 77 ABI shim — port of Interfaces/IpStdFInterface.c.
solver
Session-style C ABI built on pounce_sensitivity::Solver.

Structs§

IpoptProblemInfo
Internal owned state behind the opaque IpoptProblem handle. #[repr(C)] is unnecessary because C only sees the pointer.

Functions§

AddIpoptIntOption
Port of AddIpoptIntOption.
AddIpoptNumOption
Port of AddIpoptNumOption.
AddIpoptStrOption
Port of IpStdCInterface.cpp:AddIpoptStrOption.
CreateIpoptProblem
Port of IpStdCInterface.cpp:CreateIpoptProblem. Returns NULL on invalid arguments (negative n/m, missing required callbacks, NULL bound pointers when the corresponding dimension is positive).
FreeIpoptProblem
Port of IpStdCInterface.cpp:FreeIpoptProblem.
GetIpoptComplInf
Final complementarity error for the most recent solve.
GetIpoptCurrentIterate
Port of IpStdCInterface.cpp:GetIpoptCurrentIterate (Ipopt 3.14+). Designed to be called from inside an intermediate callback to inspect x, the bound multipliers z_L/z_U, the constraint values g, and the constraint multipliers lambda at the current iterate.
GetIpoptCurrentViolations
Port of IpStdCInterface.cpp:GetIpoptCurrentViolations (Ipopt 3.14+). Same contract as GetIpoptCurrentIterate; returns FALSE when called outside an active intermediate callback.
GetIpoptDualInf
Final dual infeasibility (max gradient-of-Lagrangian norm) for the most recent solve.
GetIpoptIterCount
Number of IPM iterations in the most recent solve, or 0 if the problem has not been solved yet.
GetIpoptPrimalInf
Final primal infeasibility (max constraint violation) for the most recent solve.
GetIpoptSolveTime
Wall-clock solve time in seconds for the most recent solve, or 0.0 if the problem has not been solved yet.
GetIpoptVersion
Port of IpStdCInterface.cpp:GetIpoptVersion (Ipopt 3.14.18+). Writes the pounce crate’s major.minor.patch into the buffers. Any pointer may be NULL to skip that component.
IpoptClearWarmStartWorkingSet
Drop any pending warm-start working set without solving. The next IpoptSolve will cold-start.
IpoptEnableIterHistory
Enable per-iteration history capture on the underlying IpoptApplication. Must be called before IpoptSolve for the trajectory to appear in the report written by IpoptWriteSolveReport. Off by default — capturing each iterate has a small per-iter cost the IPM core skips otherwise.
IpoptGetWorkingSet
Retrieve the working set produced by the most recent SQP solve (algorithm = active-set-sqp). Buffer sizes are n for bound_status_out and m for cons_status_out. Pass NULL for either to skip that side.
IpoptSetWarmStartWorkingSet
Supply a warm-start working set consumed by the next IpoptSolve on this problem. Pass NULL for either side to cold-start it. The caller-owned buffers are copied; reuse across calls is safe.
IpoptSolve
Port of IpStdCInterface.cpp:IpoptSolve. Returns the ApplicationReturnStatus integer.
IpoptSolveWarmStart
Convenience one-shot: equivalent to IpoptSetWarmStartWorkingSet + IpoptSolve + IpoptGetWorkingSet in sequence. The input/output working-set buffers are independent (so a caller can read back the new working set into the same array used as input). Pass NULL for any in/out buffer to skip that side.
IpoptWriteSolveReport
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").
OpenIpoptOutputFile
Port of IpStdCInterface.cpp:OpenIpoptOutputFile. Opens file_name at print_level and attaches a journalist FileJournal so all solver output is mirrored to disk. Equivalent to setting output_file + file_print_level options and triggering IpoptApplication::Initialize.
SetIntermediateCallback
Port of SetIntermediateCallback.
SetIpoptProblemScaling
Port of IpStdCInterface.cpp:SetIpoptProblemScaling. Stores user-provided NLP scaling on the problem; the scaling is forwarded to the solver via TNLP::get_scaling_parameters when the option nlp_scaling_method=user-scaling is set. Passing NULL for x_scaling / g_scaling disables scaling on that axis.

Type Aliases§

Bool
Mirrors C Bool.
Eval_F_CB
Eval_G_CB
Eval_Grad_F_CB
Eval_H_CB
Eval_Jac_G_CB
Index
Mirrors C Index.
Intermediate_CB
IpoptBoundStatus
C-ABI encoding of pounce_qp::BoundStatus (§7.2 of the active-set-SQP design note). Stable values: 0 = Inactive, 1 = AtLower, 2 = AtUpper, 3 = Fixed.
IpoptConsStatus
C-ABI encoding of pounce_qp::ConsStatus (§7.2). Stable values: 0 = Inactive, 1 = AtLower, 2 = AtUpper, 3 = Equality.
IpoptProblem
Number
Mirrors C Number typedef in IpStdCInterface.h.