pympcc.PresolveMap¶
- class pympcc.PresolveMap(keep_vars, fixed_vars, fixed_vals, keep_comp, n_orig, n_comp_orig, n_ineq=0, n_eq=0, keep_ineq=None, keep_eq=None, promote_G=<factory>, promote_H=<factory>, prefix_H_eq=<factory>, prefix_G_eq=<factory>)[source]¶
Bases:
objectMapping between an original
MPCCProblemand its reduced form.Use
expand_result()to lift a result on the reduced problem back to the original variable / comp-pair indexing.- Parameters:
- __init__(keep_vars, fixed_vars, fixed_vals, keep_comp, n_orig, n_comp_orig, n_ineq=0, n_eq=0, keep_ineq=None, keep_eq=None, promote_G=<factory>, promote_H=<factory>, prefix_H_eq=<factory>, prefix_G_eq=<factory>)¶
- Parameters:
- Return type:
None
Methods
__init__(keep_vars, fixed_vars, fixed_vals, ...)expand_comp(vec_red, *[, fill])Scatter a length-
len(keep_comp)vector back ton_comp_orig.expand_result(result, problem_orig)Expand
result(built on the reduced problem) into original space.expand_x(x_red)Scatter a reduced-space
xback to the originaln_origslots.Attributes
- expand_comp(vec_red, *, fill=0.0)[source]¶
Scatter a length-
len(keep_comp)vector back ton_comp_orig.
- expand_result(result, problem_orig)[source]¶
Expand
result(built on the reduced problem) into original space.Mutates
resultin place and also returns it.- Return type:
- Parameters:
result (MPCCResult)
problem_orig (MPCCProblem)