BonNWayChoose.hpp
Go to the documentation of this file.
1 // Copyright (C) 2006, 2008 International Business Machines
2 // Corporation and others. All Rights Reserved.
3 #ifndef BonNWayChoose_H
4 #define BonNWayChoose_H
5 
6 #include "OsiChooseVariable.hpp"
7 #include "BonBabSetupBase.hpp"
8 #include "BonNWayObject.hpp"
9 
10 #define OLD_USEFULLNESS
11 
12 namespace Bonmin
13 {
14 
22  class BonNWayChoose : public OsiChooseVariable
23  {
24  protected:
25 
26  public:
27 
29  BonNWayChoose (BabSetupBase& b, const OsiSolverInterface* solver);
30 
32  BonNWayChoose (const BonNWayChoose &);
33 
36 
38  virtual OsiChooseVariable * clone() const;
39 
41  virtual ~BonNWayChoose ();
42 
44  double compute_usefulness(int objectIndex, const OsiBranchingInformation * info) const;
45 
46  double compute_usefulness(const OsiBranchingInformation * info,
47  size_t n, const int * vars, const std::vector<double> &bounds, const std::vector<double> &unit_changes) const;
50  virtual int setupList ( OsiBranchingInformation *info, bool initialize);
51 
65  virtual int chooseVariable( OsiSolverInterface * solver, OsiBranchingInformation *info, bool fixVariables);
66 
79  virtual int doStrongBranching( OsiSolverInterface * solver,
80  OsiBranchingInformation *info,
81  int iObject, double * saveLow, double * saveUp, double &score);
82 
83 
86 
87  private:
89  BonNWayChoose ();
90 
92  int br_depth_;
94  Ipopt::Index do_fixings_;
100  double time_limit_;
101 
103  double start_time_;
104 
107 
109  int log_;
110  typedef std::vector< std::vector<double> > full_mat;
111 
113 
115 
116  std::vector < std::vector<int> > num_ps_costs_;
117 
118  std::vector<int> num_eval_;
119 
121  };
122 
123 }
124 #endif
double start_time_
Starting time of algorithm.
void fint fint fint real fint real real real real real real real real real fint real fint fint fint real fint fint fint fint * info
double time_limit_
Global time limit for algorithm.
virtual ~BonNWayChoose()
Destructor.
This class chooses a variable to branch on.
Ipopt::Index do_fixings_
Do we fix?*.
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register class options.
std::vector< std::vector< int > > num_ps_costs_
virtual int doStrongBranching(OsiSolverInterface *solver, OsiBranchingInformation *info, int iObject, double *saveLow, double *saveUp, double &score)
This is a utility function which does strong branching on a list of objects and stores the results in...
A class to have all elements necessary to setup a branch-and-bound.
virtual int chooseVariable(OsiSolverInterface *solver, OsiBranchingInformation *info, bool fixVariables)
Choose a variable Returns - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All lo...
virtual OsiChooseVariable * clone() const
Clone.
int start_nway_
Start of nway objects in array.
double pseudocost_trust_value_
Trust value for the pseudo costs.
std::vector< std::vector< double > > full_mat
virtual int setupList(OsiBranchingInformation *info, bool initialize)
Sets up strong list and clears all if initialize is true.
double compute_usefulness(int objectIndex, const OsiBranchingInformation *info) const
Helper function for setupList and chooseVariable, compute usefullness of an nway object.
BonNWayChoose & operator=(const BonNWayChoose &rhs)
Assignment operator.
double cutoff_multiplier_
Cutoff multiplier for infeasibles.
std::vector< int > num_eval_
BonNWayChoose()
Default Constructor, forbiden for some reason.
void fint * n
return b
Definition: OSdtoa.cpp:1719
int br_depth_
depth of strong-branching.