API reference

Problem types

MPCCProblem

Defines an MPCC in the form.

StructuredMPCC

MPCC with explicitly separated linear and nonlinear constraint layers.

ParametricMPCC

JAX-traceable MPCC parameterised by an external vector θ.

Solving

solve

Solve an MPCC problem — convenience wrapper around MPCCSolver.

MPCCSolver

Solver for Mathematical Programs with Complementarity Constraints (MPCC).

solve_jax

Solve a parametric MPCC; returns x* differentiable in θ.

multistart

Solve problem from n_starts perturbed initial points.

Result types

MPCCResult

Result returned by pympcc.solve() or pympcc.MPCCSolver.solve().

IterationInfo

Diagnostic snapshot for one NLP solve in an iterative strategy.

IPOPTStatus

IPOPT solver return codes (integer values match cyipopt's status field).

MultiStartResult

Aggregate result of a multi-start solve.

TNLPResult

Result of a TNLP active-set refinement re-solve (§2.6).

SensitivityResult

Result of a parametric sensitivity solve.

Diagnostics

active_sets

Partition constraint indices into active subsets at result.x.

classify_cq

Classify the strongest MPCC constraint qualification at result.x.

degeneracy_report

Combined degeneracy summary at result.x.

initial_point_statistics

Replicate PATH's output_initial_point_statistics at x0.

jac_norms

Row- and column-norm summary of the active-constraint Jacobian.

merit_cross_check

Cross-check three independent MPCC merit functions at result.x.

sosc_check

Check MPCC second-order sufficient conditions at result.x.

classify_stationarity

Classify the MPCC stationarity type of a solved result.

compute_kkt_residual

MPCC stationarity residual: ||∇f + Jg^T λ_g + Jh^T λ_h + JG^T μ_G + JH^T μ_H - z_L + z_U||_∞.

verify_b_stationarity

Test B-stationarity of an MPCC solution by enumerating linearised-MPCC tangent-cone branches and solving an LP per branch.

Sensitivity

sensitivity

Compute dx*/dp via implicit differentiation through the KKT system.

active_row_labels

Return active-row labels in the order sensitivity() expects dc_dp.

Presolve and scaling

presolve

Reduce problem by FBBT, pinned-var elimination and dead-pair pruning.

PresolveMap

Mapping between an original MPCCProblem and its reduced form.

autoscale_comp_pairs

Return per-pair diagonal scales that equilibrate the comp block.

unscale_multipliers

Module-level alias for MPCCResult.unscale_comp_multipliers().

Bilevel

bilevel.from_lower_level

Emit an MPCCProblem from a bilevel program.

I/O

frontend.ampl.from_nl

Read an AMPL text-format .nl file and return an pympcc.MPCCProblem.