Changeset 946


Ignore:
Timestamp:
May 19, 2008 12:02:14 PM (12 years ago)
Author:
forrest
Message:

change assert to message if bad solution in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/2.1/Cbc/src/CbcModel.cpp

    r943 r946  
    1092210922    double * saveUpper = CoinCopyOfArray(solver_->getColUpper(),numberColumns);
    1092310923    // Fix integers
     10924    int numberAway=0;
    1092410925    for (int i=0;i<numberColumns;i++) {
    1092510926      if (solver_->isInteger(i)) {
    1092610927        double value = solution[i];
    1092710928        double intValue = floor(value+0.5);
    10928         assert (fabs(value-intValue)<1.0e-4);
     10929        if (fabs(value-intValue)>1.0e-4)
     10930          numberAway++;
    1092910931        solver_->setColLower(i,intValue);
    1093010932        solver_->setColUpper(i,intValue);
     
    1093610938    solver_->initialSolve();
    1093710939    char printBuffer[200];
     10940    if (numberAway) {
     10941      sprintf(printBuffer,"Warning %d integer variables were more than 1.0e-4 away from integer",numberAway);
     10942      messageHandler()->message(CBC_FPUMP1,messages())
     10943        << printBuffer << CoinMessageEol ;
     10944    }
    1093810945    bool looksGood = solver_->isProvenOptimal();
    1093910946    if (looksGood) {
Note: See TracChangeset for help on using the changeset viewer.