Changeset 853 for stable/0.4


Ignore:
Timestamp:
Jun 7, 2012 1:46:34 PM (8 years ago)
Author:
stefan
Message:

merge r849-850,852 from trunk; update externals to latest releases

Location:
stable/0.4
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • stable/0.4

  • stable/0.4/Couenne

  • stable/0.4/Couenne/src

  • stable/0.4/Couenne/src/bound_tightening

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.4/Couenne/src/branch

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.4/Couenne/src/expression/operators/exprGroup.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.4/Couenne/src/heuristics/BonNlpHeuristic.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.4/Couenne/src/main/CouenneBab.cpp

    r814 r853  
    5959//     }
    6060//     if (currentBranchModel!=NULL)
    61 //       currentBranchModel->setMaximumNodes(0); // stop at next node
     61//       currentBranchModel->sayEventHappened(); // stop at next node
    6262//     if (OAModel!=NULL)
    63 //       OAModel->setMaximumNodes(0); // stop at next node
     63//       OAModel->sayEventHappened(); // stop at next node
    6464//     if (currentOA!=NULL)
    6565//       currentOA->parameter().maxLocalSearchTime_ = 0.; // stop OA
     
    7777CouenneBab::CouenneBab ():
    7878
    79   Bab () //,
     79  Bab (),
     80  problem_(NULL) //,
    8081  // bestSolution_(NULL),
    8182  // mipStatus_(),
     
    647648      mipStatus_ = Feasible;
    648649    }
     650    else {
     651      mipStatus_ = NoSolutionKnown;
     652    }
    649653  }
    650654  else if (model_.status() == 0) {
     
    663667      }
    664668  }
    665   else if (model_.status() == 1) {
     669  else if (model_.status() == 1 || model_.status() == 5) {
     670#if (BONMIN_VERSION_MAJOR > 1) || (BONMIN_VERSION_MINOR > 6)
     671    status = model_.status() == 1 ? TMINLP::LIMIT_EXCEEDED : TMINLP::USER_INTERRUPT;
     672#else
    666673    status = TMINLP::LIMIT_EXCEEDED;
     674#endif
    667675    if (bestSolution_) {
    668676      mipStatus_ = Feasible;
     
    678686  // Which solution should we use? false if RBS's, true if Cbc's
    679687  bool use_RBS_Cbc =
     688    !problem_ ||
    680689    !(problem_ -> getRecordBestSol ()) ||
    681690    (((fabs (bestObj_) < COUENNE_INFINITY / 1e4) &&
     
    700709
    701710
     711const double * CouenneBab::bestSolution() const {
     712  if(!problem_ ||
     713     !(problem_ -> getRecordBestSol ()) ||
     714     (((fabs (bestObj_) < COUENNE_INFINITY / 1e4) &&
     715       (problem_ -> getRecordBestSol () -> getVal () > bestObj_))))
     716    return bestSolution_;
     717  return problem_ -> getRecordBestSol () -> getSol ();
     718}
     719
     720double CouenneBab::bestObj() const {
     721  if(!problem_ ||
     722     !(problem_ -> getRecordBestSol ()) ||
     723     (((fabs (bestObj_) < COUENNE_INFINITY / 1e4) &&
     724       (problem_ -> getRecordBestSol () -> getVal () > bestObj_))))
     725    return bestObj_;
     726  return problem_ -> getRecordBestSol () -> getVal ();
     727}
  • stable/0.4/Couenne/src/main/CouenneBab.hpp

    r795 r853  
    3939    virtual ~CouenneBab(); ///< Destructor
    4040
     41    void setProblem (CouenneProblem *p);
     42
    4143    virtual void branchAndBound (Bonmin::BabSetupBase &s); ///< Carry out branch and bound
    4244
     
    5052    /** get the best solution known to the problem (is optimal if MipStatus is FeasibleOptimal).
    5153        if no solution is known returns NULL.*/
    52     const double * bestSolution() const
    53     {
    54       return bestSolution_;
    55     }
    56 
    57     void setProblem (CouenneProblem *p);
     54    const double * bestSolution() const;
    5855
    5956    /** return objective value of the bestSolution */
    60     double bestObj() const
    61     {
    62       return bestObj_;
    63     }
     57    double bestObj() const;
    6458
    6559    // /** return Mip Status */
Note: See TracChangeset for help on using the changeset viewer.