Changeset 265 for trunk


Ignore:
Timestamp:
Mar 7, 2006 3:53:09 PM (14 years ago)
Author:
forrest
Message:

for bon-min

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcModel.cpp

    r264 r265  
    70477047      Perhaps an opportunity for a sanity check?
    70487048    */
    7049     if ((solver_->isProvenOptimal()||(specialOptions_&4)!=0) && objectiveValue <= cutoff)
    7050       {
    7051         double * solution = new double[numberColumns];
    7052         memcpy(solution ,solver_->getColSolution(),numberColumns*sizeof(double)) ;
    7053        
     7049    if ((solver_->isProvenOptimal()||(specialOptions_&4)!=0) && objectiveValue <= cutoff) {
     7050      double * solution = new double[numberColumns];
     7051      memcpy(solution ,solver_->getColSolution(),numberColumns*sizeof(double)) ;
     7052     
     7053      int iColumn;
     7054#ifndef NDEBUG
     7055      double integerTolerance = getIntegerTolerance() ;
     7056#endif
     7057      for (iColumn = 0 ; iColumn < numberColumns ; iColumn++) {
     7058        double value = solution[iColumn] ;
     7059        value = CoinMax(value, saveLower[iColumn]) ;
     7060        value = CoinMin(value, saveUpper[iColumn]) ;
     7061        if (solver_->isInteger(iColumn))
     7062          assert(fabs(value-solution[iColumn]) <= integerTolerance) ;
     7063        solution[iColumn] = value ;
     7064      }
     7065      if ((specialOptions_&16)==0) {
    70547066        const double * rowLower = solver_->getRowLower() ;
    70557067        const double * rowUpper = solver_->getRowUpper() ;
     
    70577069        double *rowActivity = new double[numberRows] ;
    70587070        memset(rowActivity,0,numberRows*sizeof(double)) ;
    7059        
    7060 #ifndef NDEBUG
    7061         double integerTolerance = getIntegerTolerance() ;
    7062 #endif
    7063         int iColumn;
    7064         for (iColumn = 0 ; iColumn < numberColumns ; iColumn++)
    7065           { double value = solution[iColumn] ;
    7066           value = CoinMax(value, saveLower[iColumn]) ;
    7067           value = CoinMin(value, saveUpper[iColumn]) ;
    7068           if (solver_->isInteger(iColumn))
    7069             assert(fabs(value-solution[iColumn]) <= integerTolerance) ;
    7070           solution[iColumn] = value ; }
    7071        
    70727071        solver_->getMatrixByCol()->times(solution,rowActivity) ;
    7073         delete [] solution;
    70747072        double primalTolerance ;
    70757073        solver_->getDblParam(OsiPrimalTolerance,primalTolerance) ;
     
    70817079                                         rowActivity[i]-rowUpper[i]);
    70827080        }
    7083         if (largestInfeasibility>100.0*primalTolerance)
     7081        if (largestInfeasibility>100.0*primalTolerance) {
    70847082          handler_->message(CBC_NOTFEAS3, messages_)
    70857083            << largestInfeasibility << CoinMessageEol ;
    7086        
    7087         delete [] rowActivity ; }
    7088     else
    7089       { objectiveValue=1.0e50 ; }
     7084          objectiveValue=1.0e50 ;
     7085        }
     7086        delete [] rowActivity ;
     7087      }
     7088      delete [] solution;
     7089    } else {
     7090      objectiveValue=1.0e50 ;
     7091    }
    70907092    /*
    70917093      Regardless of what we think of the solution, we may need to restore the
  • trunk/include/CbcModel.hpp

    r264 r265  
    12691269      0 bit (1) - check if cuts valid (if on debugger list)
    12701270      1 bit (2) - use current basis to check integer solution (rather than all slack)
    1271       2 bit (4) - don't check integer solution
     1271      2 bit (4) - don't check integer solution (by solving LP)
    12721272      3 bit (8) - fast analyze
     1273      4 bit (16) - non-linear model and someone too lazy to code "times" correctly - so skip row check
    12731274  */
    12741275  /// Set special options
Note: See TracChangeset for help on using the changeset viewer.