Skip to content

Commit e6fb2f6

Browse files
committed
merge part of r2777 from trunk
1 parent 3b94d71 commit e6fb2f6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Cbc/src/CbcMipStartIO.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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

566572
TERMINATE:
573+
delete[] realObj;
567574
delete lp;
568575
return status;
569576
}

0 commit comments

Comments
 (0)