00001
00002
00003
00004
00005
00006
00007
00008
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
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
00084 void printObjViol(OsiBranchingInformation *info);
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
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