Builds an Expression representing the optimal value of prob as
a function of the variables you choose NOT to optimise over. Useful
for two-stage / hierarchical optimisation, custom atom definitions,
and embedding sub-problems inside larger problems.
Arguments
- prob
A Problem to partially optimise.
- opt_vars
Optional list of Variables to optimise over.
- dont_opt_vars
Optional list of Variables to keep as free arguments of the resulting expression.
- solver
Optional solver name (passed to
psolve()when the PartialProblem is evaluated viavalue()orgrad()).- ...
Additional named arguments forwarded to
psolve()whenvalue()/grad()are called.
Details
Exactly one of opt_vars or dont_opt_vars may be NULL; the
missing list is taken to be the complement (relative to the full
list of variables in prob). If both are supplied, they must
together cover every variable in prob.
The returned PartialProblem is an Expression with scalar shape:
it is convex when prob is DCP with a Minimize objective and
concave when DCP with Maximize. Embed it like any other
expression in a larger Problem; the larger problem's canonicalizer
will pull the inner objective and constraints into the outer cone
form so a single solve handles both layers.
