00001
00002
00003 #ifndef BonNWayChoose_H
00004 #define BonNWayChoose_H
00005
00006 #include "OsiChooseVariable.hpp"
00007 #include "BonBabSetupBase.hpp"
00008 #include "BonNWayObject.hpp"
00009
00010 #define OLD_USEFULLNESS
00011
00012 namespace Bonmin
00013 {
00014
00022 class BonNWayChoose : public OsiChooseVariable
00023 {
00024 protected:
00025
00026 public:
00027
00029 BonNWayChoose (BabSetupBase& b, const OsiSolverInterface* solver);
00030
00032 BonNWayChoose (const BonNWayChoose &);
00033
00035 BonNWayChoose & operator= (const BonNWayChoose& rhs);
00036
00038 virtual OsiChooseVariable * clone() const;
00039
00041 virtual ~BonNWayChoose ();
00042
00044 double compute_usefulness(int objectIndex, const OsiBranchingInformation * info) const;
00045
00046 double compute_usefulness(const OsiBranchingInformation * info,
00047 size_t n, const int * vars, const std::vector<double> &bounds, const std::vector<double> &unit_changes) const;
00050 virtual int setupList ( OsiBranchingInformation *info, bool initialize);
00051
00065 virtual int chooseVariable( OsiSolverInterface * solver, OsiBranchingInformation *info, bool fixVariables);
00066
00079 virtual int doStrongBranching( OsiSolverInterface * solver,
00080 OsiBranchingInformation *info,
00081 int iObject, double * saveLow, double * saveUp, double &score);
00082
00083
00085 static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
00086
00087 private:
00089 BonNWayChoose ();
00090
00092 int br_depth_;
00094 Ipopt::Index do_fixings_;
00096 double cutoff_multiplier_;
00098 double pseudocost_trust_value_;
00100 double time_limit_;
00101
00103 double start_time_;
00104
00106 int start_nway_;
00107
00109 int log_;
00110 typedef std::vector< std::vector<double> > full_mat;
00111
00112 full_mat bounds_;
00113
00114 full_mat unit_changes_;
00115
00116 std::vector < std::vector<int> > num_ps_costs_;
00117
00118 std::vector<int> num_eval_;
00119
00120 int geo_means_;
00121 };
00122
00123 }
00124 #endif