source: stable/0.2/Couenne/src/branch/CouenneChooseStrong.hpp @ 159

Last change on this file since 159 was 159, checked in by pbelotti, 11 years ago

created new stable branch 0.2 from trunk (rev. 157)

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