source: branches/devel/Bonmin/src/CbcBonmin/BonCbc.hpp @ 62

Last change on this file since 62 was 62, checked in by pbonami, 13 years ago

astyled the devel branch

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 2.6 KB
Line 
1#ifndef BonminBB_hpp
2#define BonminBB_hpp
3
4#include "BonCbcParam.hpp"
5
6
7class CbcObject;
8
9namespace Bonmin
10{
11  class OsiTMINLPInterface;
12  /** Class which performs optimization of an MINLP stored in an IpoptInterface. */
13  class Bab
14  {
15  public:
16    /** Integer optimization return codes.*/
17    enum MipStatuses {FeasibleOptimal /** Optimum solution has been found and its optimality proved.*/,
18        ProvenInfeasible /** Problem has been proven to be infeasible.*/,
19        Feasible /** An integer solution to the problem has been found.*/,
20        NoSolutionKnown/** No feasible solution to the problem is known*/};
21    /** Constructor.*/
22    Bab();
23    /** destructor.*/
24    virtual ~Bab();
25    /** Perform a branch-and-bound on given IpoptInterface using passed parameters.*/
26    void branchAndBound(OsiTMINLPInterface * nlp,
27        const BonminCbcParam&par);
28
29    /**operator() performs the branchAndBound*/
30    void operator()(OsiTMINLPInterface * nlp, const BonminCbcParam& par)
31    {
32      branchAndBound(nlp,par);
33    }
34
35    /** get the best solution known to the problem (is optimal if MipStatus is FeasibleOptimal).
36        if no solution is known returns NULL.*/
37    const double * bestSolution() const
38    {
39      return bestSolution_;
40    }
41    /** return objective value of the bestSolution */
42    double bestObj() const
43    {
44      return bestObj_;
45    }
46    /** return Mip Status */
47    MipStatuses mipStatus() const
48    {
49      return mipStatus_;
50    }
51    /** return the best known lower bound on the objective value*/
52    double bestBound();
53    /** return the total number of nodes explored.*/
54    int numNodes() const
55    {
56      return numNodes_;
57    }
58    /** return the total number of iterations in the last mip solved.*/
59    int iterationCount()
60    {
61      return mipIterationCount_;
62    }
63    /** returns the value of the continuous relaxation. */
64    double continuousRelaxation()
65    {
66      return continuousRelaxation_;
67    }
68
69    /** virtual callback function to eventually modify objects for integer variable
70        (replace with user set). This is called after CbcModel::findIntegers */
71    virtual void replaceIntegers(CbcObject ** objects, int numberObjects)
72    {};
73  private:
74    /** Stores the solution of MIP. */
75    double * bestSolution_;
76    /** Status of the mixed integer program. */
77    MipStatuses mipStatus_;
78    /** objValue of MIP */
79    double bestObj_;
80    /** best known (lower) bound.*/
81    double bestBound_;
82    /** Continuous relaxation of the problem */
83    double continuousRelaxation_;
84    /** Number of nodes enumerated.*/
85    int numNodes_;
86    /** get total number of iterations in last mip solved.*/
87    int mipIterationCount_;
88  };
89}
90#endif
Note: See TracBrowser for help on using the repository browser.