pympcc.MPCCResult¶
- class pympcc.MPCCResult(x, obj, status, message, G, H, comp_residual, comp_residual_mean, success, strategy, history=<factory>, solve_time=None, mult_g=None, stationarity='unknown', kkt_residual=None, cleanup_status=None, cleanup_n_iter=None, cleanup_obj=None, cleanup_active_set=None, cleanup_accepted=None, comp_G_scale=None, comp_H_scale=None, cq=None, cq_active_set_sizes=None, cq_rank_deficit=None, b_stationary=None, b_stationary_witness=None, b_stationary_min_descent=None, per_pair_status=None, mult_comp_G_mpcc=None, mult_comp_H_mpcc=None, tnlp_refined=None, sosc=None, sosc_min_eigenvalue=None, sosc_skipped_reason=None, jac_condition=None, hessian_condition_estimate=None, time_limit_hit=False, merit_cross_check=None, jac_row_norms=None, jac_col_norms=None, degeneracy_report=None, initial_point_stats=None, n_ipopt_iter_total=None, warmstart_savings_iter=None)[source]¶
Bases:
objectResult returned by
pympcc.solve()orpympcc.MPCCSolver.solve().- Parameters:
x (ndarray)
obj (float)
status (int)
message (str)
G (ndarray)
H (ndarray)
comp_residual (float)
comp_residual_mean (float)
success (bool)
strategy (str)
history (list[IterationInfo])
solve_time (float | None)
mult_g (ndarray | None)
stationarity (str)
kkt_residual (float | None)
cleanup_status (int | None)
cleanup_n_iter (int | None)
cleanup_obj (float | None)
cleanup_active_set (tuple | None)
cleanup_accepted (bool | None)
comp_G_scale (ndarray | None)
comp_H_scale (ndarray | None)
cq (str | None)
cq_active_set_sizes (dict | None)
cq_rank_deficit (int | None)
b_stationary (str | None)
b_stationary_witness (tuple | None)
b_stationary_min_descent (float | None)
per_pair_status (list | None)
mult_comp_G_mpcc (ndarray | None)
mult_comp_H_mpcc (ndarray | None)
tnlp_refined (Any | None)
sosc (bool | None)
sosc_min_eigenvalue (float | None)
sosc_skipped_reason (str | None)
jac_condition (float | None)
hessian_condition_estimate (float | None)
time_limit_hit (bool)
merit_cross_check (dict | None)
jac_row_norms (dict | None)
jac_col_norms (dict | None)
degeneracy_report (dict | None)
initial_point_stats (dict | None)
n_ipopt_iter_total (int | None)
warmstart_savings_iter (int | None)
- x¶
Solution vector.
- Type:
ndarray
- status¶
IPOPT exit code of the final NLP solve. Common values: 0 = Solve_Succeeded, 1 = Solved_To_Acceptable_Level, -1 = Maximum_Iterations_Exceeded, 2 = Infeasible_Problem_Detected.
- Type:
- success¶
Truewhen IPOPT status is 0 (Solve_Succeeded) or 1 (Solved_To_Acceptable_Level).- Type:
- solve_time¶
Sum of wall-clock seconds spent inside each
nlp.solve()call. Excludes strategy setup (NLP construction, sparsity computation), callback invocations, and post-solve stationarity classification.Nonewhen not measured (e.g. results constructed programmatically).- Type:
float or None
- history¶
Per-iteration diagnostics for iterative strategies (Scholtes, smoothing). Empty for the direct strategy.
- Type:
- __init__(x, obj, status, message, G, H, comp_residual, comp_residual_mean, success, strategy, history=<factory>, solve_time=None, mult_g=None, stationarity='unknown', kkt_residual=None, cleanup_status=None, cleanup_n_iter=None, cleanup_obj=None, cleanup_active_set=None, cleanup_accepted=None, comp_G_scale=None, comp_H_scale=None, cq=None, cq_active_set_sizes=None, cq_rank_deficit=None, b_stationary=None, b_stationary_witness=None, b_stationary_min_descent=None, per_pair_status=None, mult_comp_G_mpcc=None, mult_comp_H_mpcc=None, tnlp_refined=None, sosc=None, sosc_min_eigenvalue=None, sosc_skipped_reason=None, jac_condition=None, hessian_condition_estimate=None, time_limit_hit=False, merit_cross_check=None, jac_row_norms=None, jac_col_norms=None, degeneracy_report=None, initial_point_stats=None, n_ipopt_iter_total=None, warmstart_savings_iter=None)¶
- Parameters:
x (ndarray)
obj (float)
status (int)
message (str)
G (ndarray)
H (ndarray)
comp_residual (float)
comp_residual_mean (float)
success (bool)
strategy (str)
history (list[IterationInfo])
solve_time (float | None)
mult_g (ndarray | None)
stationarity (str)
kkt_residual (float | None)
cleanup_status (int | None)
cleanup_n_iter (int | None)
cleanup_obj (float | None)
cleanup_active_set (tuple | None)
cleanup_accepted (bool | None)
comp_G_scale (ndarray | None)
comp_H_scale (ndarray | None)
cq (str | None)
cq_active_set_sizes (dict | None)
cq_rank_deficit (int | None)
b_stationary (str | None)
b_stationary_witness (tuple | None)
b_stationary_min_descent (float | None)
per_pair_status (list | None)
mult_comp_G_mpcc (ndarray | None)
mult_comp_H_mpcc (ndarray | None)
tnlp_refined (Any | None)
sosc (bool | None)
sosc_min_eigenvalue (float | None)
sosc_skipped_reason (str | None)
jac_condition (float | None)
hessian_condition_estimate (float | None)
time_limit_hit (bool)
merit_cross_check (dict | None)
jac_row_norms (dict | None)
jac_col_norms (dict | None)
degeneracy_report (dict | None)
initial_point_stats (dict | None)
n_ipopt_iter_total (int | None)
warmstart_savings_iter (int | None)
- Return type:
None
Methods
__init__(x, obj, status, message, G, H, ...)summary([verbosity])Return a formatted summary of the result.
Return a per-complementarity-pair
pandas.DataFrame.to_json()Serialize the result to a JSON string.
unscale_comp_multipliers(mpcc_mult_G, ...)Convert scaled-space comp multipliers back to original space.
Attributes
- history: list[IterationInfo]¶
- unscale_comp_multipliers(mpcc_mult_G, mpcc_mult_H)[source]¶
Convert scaled-space comp multipliers back to original space.
If the problem was solved with
comp_G_scale/comp_H_scaleactive, IPOPT’s multipliers correspond to the scaled constraints · G(x) ≥ 0. Original-space duals satisfyμ = s · μ̃(chain rule). Returns the input unchanged if no scaling was used.
- to_json()[source]¶
Serialize the result to a JSON string.
Arrays are converted to lists. Fields that are
Noneare included as JSONnull. Thehistorylist is omitted (usesummary(verbosity=2)for human-readable history).- Returns:
JSON-encoded result suitable for logging, benchmarking, or storage.
- Return type:
- to_dataframe()[source]¶
Return a per-complementarity-pair
pandas.DataFrame.Columns:
pair,G,H,GH,status, and (when available from TNLP refinement)mu_G,mu_H.Requires
pandas.- Returns:
One row per complementarity pair.
- Return type:
pandas.DataFrame
- Raises:
ImportError – When
pandasis not installed.