Changeset 2498


Ignore:
Timestamp:
Feb 20, 2019 8:07:32 AM (2 months ago)
Author:
unxusr
Message:

updated driver 3 and 4 examples

Location:
trunk/Cbc/examples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/examples/driver3.cpp

    r2469 r2498  
    6969  }
    7070  // Pass to Cbc initialize defaults
     71  CbcSolverUsefulData cbcData;
    7172  CbcModel model(solver1);
    72   CbcMain0(model);
     73  CbcMain0(model, cbcData);
    7374
    7475  // Solve just to show there are no integers
     
    105106  */
    106107  if (argc > 2) {
    107     CbcMain1(argc - 1, argv + 1, model);
     108    CbcMain1(argc - 1, argv + 1, model, cbcData);
    108109  } else {
    109110    const char *argv2[] = { "driver3", "-solve", "-quit" };
    110     CbcMain1(3, argv2, model);
     111    CbcMain1(3, argv2, model, cbcData);
    111112  }
    112113
  • trunk/Cbc/examples/driver4.cpp

    r2469 r2498  
    255255      const double *bestSolution = model_->bestSolution();
    256256      assert(bestSolution);
    257       printf("value of solution is %g\n", model_->getObjValue());
    258       for (int i = 0; i < numberColumns; i++) {
    259         if (fabs(bestSolution[i]) > 1.0e-8)
    260           printf("%d %g\n", i, bestSolution[i]);
    261       }
     257      printf("event handler received a solution with cost %g\n", model_->getObjValue());
     258      // printing solution contents
     259      //for (int i = 0; i < numberColumns; i++) {
     260      //  if (fabs(bestSolution[i]) > 1.0e-8)
     261      //    printf("%d %g\n", i, bestSolution[i]);
     262      //}
    262263      return noAction; // carry on
    263264#endif
Note: See TracChangeset for help on using the changeset viewer.