You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to expose the dual variables associated with the constraint of an optimization problem.
For example,
// initialize parameters and variables
prob pr;
par a(pr, ...);
par b(pr, ...);
var x(pr, ...);
// setup and solve problem
minimize(...);
cons &c = (a*x <= b)
pr.solve();
// output
x.col(0); // solution to x
cons.dual_value(...); // dual variable associated with constraint a*x <= b
The last line is wanted but unimplemented.
Places to take a look
csocp/solver_lib.h, structslvOut_t.y and slvOut_t.s. These are the slack variables that are computed by the csocp module.
cprs/source/prob.cpp, function prob::unparse(slvOut_t). This is where we want to iterate through m_cons_list and populate the data in there using pSO->y and pSO->x.
cprs/header/cons.h. We should add a public get variable to access the data set in the previous set. the cons::m_nSlacks variable shows how many slack variables are associated with this one constraint.
search for slack in the project to find references of where slack variables are being set. For example, line 727 of cprs/source/prob.cpp states that there is one slack variable per inequality.
Things to worry about
indexing
it looks like we want to subtract pSO->y - pSO->s for some dual variables.
The text was updated successfully, but these errors were encountered:
We want to expose the dual variables associated with the constraint of an optimization problem.
For example,
The last line is wanted but unimplemented.
Places to take a look
csocp/solver_lib.h
, structslvOut_t.y
andslvOut_t.s
. These are the slack variables that are computed by the csocp module.cprs/source/prob.cpp
, functionprob::unparse(slvOut_t)
. This is where we want to iterate throughm_cons_list
and populate the data in there usingpSO->y
andpSO->x
.cprs/header/cons.h
. We should add a publicget
variable to access the data set in the previous set. thecons::m_nSlacks
variable shows how many slack variables are associated with this one constraint.slack
in the project to find references of where slack variables are being set. For example, line 727 ofcprs/source/prob.cpp
states that there is one slack variable per inequality.Things to worry about
pSO->y - pSO->s
for some dual variables.The text was updated successfully, but these errors were encountered: