File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,8 @@ int computeCompleteSolution(CbcModel *model,
124124 int notFound = 0 ;
125125 char colNotFound[256 ] = " " ;
126126 int nContinuousFixed = 0 ;
127+ double *realObj = new double [lp->getNumCols ()];
128+ memcpy (realObj, lp->getObjCoefficients (), sizeof (double )*lp->getNumCols ());
127129
128130#ifndef JUST_FIX_INTEGER
129131#define JUST_FIX_INTEGER 0
@@ -321,7 +323,11 @@ int computeCompleteSolution(CbcModel *model,
321323 }
322324 } else {
323325 foundIntegerSol = true ;
324- obj = compObj = lp->getObjValue ();
326+
327+ obj = 0.0 ;
328+ for ( int i=0 ; (i<lp->getNumCols ()) ; ++i )
329+ obj += realObj[i]*lp->getColSolution ()[i];
330+ compObj = obj;
325331 copy (lp->getColSolution (), lp->getColSolution () + lp->getNumCols (), sol);
326332 }
327333
@@ -564,6 +570,7 @@ int computeCompleteSolution(CbcModel *model,
564570 }
565571
566572TERMINATE:
573+ delete[] realObj;
567574 delete lp;
568575 return status;
569576}
You can’t perform that action at this time.
0 commit comments