# CouenneChooseStrong.hpp

Go to the documentation of this file.

    00001 /* $Id: CouenneChooseStrong.hpp 792 2012-01-24 17:24:15Z pbelotti $
    00002  *
    00003  * Name:    CouenneChooseStrong.hpp
    00004  * Authors: Andreas Waechter, IBM Corp.
    00005  * Purpose: Strong branching object for Couenne
    00006  *
    00007  * (C) Carnegie-Mellon University, 2006-10.
    00008  * This file is licensed under the Eclipse Public License (EPL)
    00009  */
    00010
    00011 #ifndef COUENNECHOOSESTRONG_HPP
    00012 #define COUENNECHOOSESTRONG_HPP
    00013
    00014 #include "BonChooseVariable.hpp"
    00015 #include "CouenneJournalist.hpp"
    00016
    00017 namespace Couenne {
    00018
    00019 class CouenneProblem;
    00020
    00021 template <class T> class CouenneSolverInterface;
    00022
    00023 class CouenneChooseStrong : public Bonmin::BonChooseVariable {
    00024
    00025 public:
    00026
    00028   CouenneChooseStrong (Bonmin::BabSetupBase& b, CouenneProblem* problem, JnlstPtr jnlst);
    00029
    00031   CouenneChooseStrong (const CouenneChooseStrong &);
    00032
    00034   CouenneChooseStrong & operator= (const CouenneChooseStrong& rhs);
    00035
    00037   virtual OsiChooseVariable * clone() const;
    00038
    00040   virtual ~CouenneChooseStrong ();
    00041
    00044   virtual int setupList (OsiBranchingInformation *info, bool initialize);
    00045
    00046   // actually setting up the list
    00047   int gutsOfSetupList(OsiBranchingInformation *info, bool initialize);
    00048
    00060   virtual int doStrongBranching (OsiSolverInterface * OsiSolver,
    00061                                  OsiBranchingInformation *info,
    00062                                  int numberToDo, int returnCriterion);
    00063
    00065   virtual bool feasibleSolution (const OsiBranchingInformation * info,
    00066                                  const double * solution,
    00067                                  int numberObjects,
    00068                                  const OsiObject ** objects);
    00069
    00071   virtual int chooseVariable (OsiSolverInterface * solver,
    00072                               OsiBranchingInformation *info,
    00073                               bool fixVariables);
    00074
    00076   static void registerOptions (Ipopt::SmartPtr <Bonmin::RegisteredOptions> roptions);
    00077
    00078 private:
    00079
    00081   CouenneChooseStrong ();
    00082
    00083   // print object violations
    00084   void printObjViol(OsiBranchingInformation *info);
    00085
    00086   // Due to possible fixing during strong branching, must check
    00087   // that variable reference vInd for the selected object (if not -1)
    00088   // is not fixed or has a current value inside bounds.
    00089   // Return value is:
    00090   // 0: OsiSimpleInteger with upper[vInd] == lower[vInd]
    00091   // 1: OsiSimpleInteger with upper[vInd] > lower[vInd] and
    00092   //    info->solution[vInd] outside bounds
    00093   // 2: CouenneBranchingObject with upper[vInd] == lower[vInd]
    00094   // 3: otherwise (meaning good object)
    00095   int goodCandidate(OsiSolverInterface *solver,
    00096                     OsiBranchingInformation *info,
    00097                     OsiObject **object, const int iObject, const double prec);
    00098
    00100   bool saveBestCand(OsiObject **object, const int iObject,
    00101                     const double value,
    00102                     const double upEstimate,
    00103                     const double downEstimate,
    00104                     double &bestVal1,
    00105                     double &bestVal2, int &bestIndex,
    00106                     int &bestWay);
    00107
    00108 protected:
    00109
    00111   int simulateBranch (OsiObject *Object,
    00112                       OsiBranchingInformation *info,
    00113                       OsiBranchingObject *branch,
    00114                       OsiSolverInterface *solver,
    00115                       Bonmin::HotInfo * result,
    00116                       int direction);
    00117
    00119   CouenneProblem *problem_;
    00120
    00124   bool pseudoUpdateLP_;
    00125
    00135   bool estimateProduct_;
    00136
    00138   JnlstPtr jnlst_;
    00139
    00141   double branchtime_;
    00142 };
    00143
    00144 }
    00145
    00146 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines