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

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

Rename file with Bon prefix part II

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