Changeset 1898 for trunk/Cbc/examples/simpleBAB.cpp
 Timestamp:
 Apr 9, 2013 2:06:04 PM (6 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Cbc/examples/simpleBAB.cpp
r1854 r1898 4 4 // This code is licensed under the terms of the Eclipse Public License (EPL). 5 5 6 #if defined(_MSC_VER)7 // Turn off compiler warning about long names8 # pragma warning(disable:4786)9 #endif10 11 6 #include <cassert> 12 7 #include <iomanip> 13 8 14 9 10 #include "CoinPragma.hpp" 15 11 #include "OsiClpSolverInterface.hpp" 16 12 #include "CoinPackedVector.hpp" … … 41 37 model.setInteger(0); 42 38 model.setObjSense(1.0); 43 bool optimal;39 //bool optimal; 44 40 45 41 #ifndef USE_CBC … … 54 50 model.getDblParam(OsiDualObjectiveLimit,objLimit); 55 51 model.branchAndBound(); 56 optimal = model.isProvenOptimal();52 //optimal = model.isProvenOptimal(); 57 53 const double *val = model.getColSolution(); // x0 = 3, x1 = 0.45 58 54 printf("Solution %g %g\n",val[0],val[1]); … … 65 61 CbcModel model2(model); 66 62 model2.branchAndBound(); 67 optimal = model2.isProvenOptimal();63 //optimal = model2.isProvenOptimal(); 68 64 const double *val = model2.getColSolution(); // x0 = 3, x1 = 0.45 69 65 printf("Solution %g %g\n",val[0],val[1]); … … 79 75 #ifndef USE_CBC 80 76 model.branchAndBound(); 81 optimal = model.isProvenOptimal(); // should be x0 = 2, x1 = 0.9577 //optimal = model.isProvenOptimal(); // should be x0 = 2, x1 = 0.95 82 78 // Address of solution will be same as only adding rows  but be safe 83 79 val = model.getColSolution(); … … 87 83 CbcModel model2(model); 88 84 model2.branchAndBound(); 89 optimal = model2.isProvenOptimal(); // should be x0 = 2, x1 = 0.9585 //optimal = model2.isProvenOptimal(); // should be x0 = 2, x1 = 0.95 90 86 const double *val = model2.getColSolution(); 91 87 printf("Solution %g %g\n",val[0],val[1]);
Note: See TracChangeset
for help on using the changeset viewer.