source: Couenne/src/branch/CouenneChooseStrong.hpp @ 1

Last change on this file since 1 was 1, checked in by coin, 12 years ago

Initial import

File size: 2.8 KB
Line 
1/*
2 * Name:    CouenneChooseStrong.hpp
3 * Authors: Andreas Waechter, IBM Corp.
4 * Purpose: Strong branching object for Couenne
5 *
6 * (C) Carnegie-Mellon University, 2006-08.
7 * This file is licensed under the Common Public License (CPL)
8 */
9
10#ifndef COUENNECHOOSESTRONG_HPP
11#define COUENNECHOOSESTRONG_HPP
12
13#include "BonChooseVariable.hpp"
14#include "CouenneJournalist.hpp"
15
16
17// Forward declaration
18class CouenneProblem;
19
20namespace Bonmin {
21
22  class CouenneChooseStrong : public BonChooseVariable  {
23
24  public:
25
26    /// Constructor from solver (so we can set up arrays etc)
27    CouenneChooseStrong (BabSetupBase& b, CouenneProblem* problem, JnlstPtr jnlst);
28
29    /// Copy constructor
30    CouenneChooseStrong (const CouenneChooseStrong &);
31
32    /// Assignment operator
33    CouenneChooseStrong & operator= (const CouenneChooseStrong& rhs);
34
35    /// Clone
36    virtual OsiChooseVariable * clone() const;
37
38    /// Destructor
39    virtual ~CouenneChooseStrong ();
40
41    /// Sets up strong list and clears all if initialize is true.
42    /// Returns number of infeasibilities.
43    virtual int setupList (OsiBranchingInformation *info, bool initialize);
44
45    /**  This is a utility function which does strong branching on a
46         list of objects and stores the results in OsiHotInfo.objects.
47         On entry the object sequence is stored in the OsiHotInfo
48         object and maybe more.
49         It returns -
50         -1 - one branch was infeasible both ways
51         0 - all inspected - nothing can be fixed
52         1 - all inspected - some can be fixed                         (returnCriterion==0)
53         2 - may be returning early - one can be fixed (last one done) (returnCriterion==1)
54         3 - returning because max time
55    */
56    virtual int doStrongBranching( OsiSolverInterface * solver, 
57                                   OsiBranchingInformation *info,
58                                   int numberToDo, int returnCriterion);
59
60    /// Returns true if solution looks feasible against given objects
61    virtual bool feasibleSolution (const OsiBranchingInformation * info,
62                                   const double * solution,
63                                   int numberObjects,
64                                   const OsiObject ** objects);
65
66    /// choose object to branch based on earlier setup
67    virtual int chooseVariable (OsiSolverInterface * solver,
68                                OsiBranchingInformation *info,
69                                bool fixVariables);
70
71    /// Add list of options to be read from file
72    static void registerOptions (Ipopt::SmartPtr <Bonmin::RegisteredOptions> roptions);
73
74  private:
75
76    /** Default Constructor, forbidden for some reason.*/
77    CouenneChooseStrong ();
78   
79  protected:
80
81    /// Pointer to the associated MINLP problem
82    CouenneProblem *problem_;
83
84    /// should we update the pseudocost multiplier with the distance
85    /// between the LP point and the solution of the resulting
86    /// branches' LPs? If so, this only happens in strong branching
87    bool pseudoUpdateLP_;
88
89    /// pointer to journalist for detailed information
90    JnlstPtr jnlst_;
91  };
92}
93
94#endif
Note: See TracBrowser for help on using the repository browser.