[Osi] Question about function getRowPrice()
danh hua
hcd176 at gmail.com
Sun May 24 07:35:49 EDT 2009
Hi all,
I tried to use function getRowPrice() to get the solution of dual solution
from an IP problem. But I received the result contain all zero value. I
don't know the reason why. Can anyone give me an suggestion?
my IP problem is:
*NAME EXAMPLE
ROWS
N OBJ
L ROW1
L ROW2
L ROW3
COLUMNS
INT1 'MARKER' 'INTORG'
COL1 OBJ 20
COL1 ROW1 1 ROW3 1
COL2 OBJ 20
COL2 ROW1 1 ROW2 1
COL3 OBJ 20
COL3 ROW2 1 ROW3 1
COL4 OBJ 5
COL4 ROW3 1
COL5 OBJ 5
COL5 ROW1 1
COL6 OBJ 5
COL6 ROW2 1
INT1END 'MARKER' 'INTEND'
RHS
RHS ROW1 1
RHS ROW2 1
RHS ROW3 1
ENDATA*
and my code is:
...
*model.setObjSense(-1);
model.branchAndBound();
//..................get dual solution................*
*OsiSolverInterface * solver;*
*if** (preProcess) {*
*process.postProcess(*model.solver());*
*// Solution now back in solver1*
*solver = & solver1;*
*} **else** {*
*solver = model.solver();*
*}*
*const double *dualSolution= solver->getRowPrice();
int numberRows=model.getNumRows();
int iRows;*
*for(iRows=0;iRows<numberRows;iRows++){
double value=dualSolution[iRows];
std::cout<<value<<std::endl;
}*
the result I got is (0,0,0).
Thanks,
Danh Hua
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/osi/attachments/20090524/1c726fb9/attachment.html>
More information about the Osi
mailing list