| 1 |
// (C) Copyright International Business Machines Corporation 2007 |
| 2 |
// All Rights Reserved. |
| 3 |
// This code is published under the Eclipse Public License. |
| 4 |
// |
| 5 |
// Authors : |
| 6 |
// Pierre Bonami, International Business Machines Corporation |
| 7 |
// |
| 8 |
// Date : 04/23/2007 |
| 9 |
|
| 10 |
#ifndef BonBabInfos_H |
| 11 |
#define BonBabInfos_H |
| 12 |
#include <stdlib.h> |
| 13 |
#include "BonAuxInfos.hpp" |
| 14 |
|
| 15 |
namespace Bonmin |
| 16 |
{ |
| 17 |
class Bab; |
| 18 |
/** Bonmin class for passing info between components of branch-and-cuts.*/ |
| 19 |
class BabInfo : public Bonmin::AuxInfo |
| 20 |
{ |
| 21 |
public: |
| 22 |
/** Default constructor.*/ |
| 23 |
BabInfo(int type); |
| 24 |
|
| 25 |
/** Constructor from OsiBabSolver.*/ |
| 26 |
BabInfo(const OsiBabSolver &other); |
| 27 |
|
| 28 |
/** Copy constructor.*/ |
| 29 |
BabInfo(const BabInfo &other); |
| 30 |
|
| 31 |
/** Destructor.*/ |
| 32 |
virtual ~BabInfo(); |
| 33 |
|
| 34 |
/** Virtual copy constructor.*/ |
| 35 |
virtual OsiAuxInfo * clone() const; |
| 36 |
|
| 37 |
/** Set pointer to the branch-and-bound algorithm (to access CbcModel).*/ |
| 38 |
void setBabPtr(Bab * babPtr) |
| 39 |
{ |
| 40 |
babPtr_ = babPtr; |
| 41 |
} |
| 42 |
|
| 43 |
/** Pointer to the branch-and-bound algorithm (to access CbcModel).*/ |
| 44 |
Bab * babPtr() |
| 45 |
{ |
| 46 |
return babPtr_; |
| 47 |
} |
| 48 |
|
| 49 |
bool hasSolution() const{ |
| 50 |
return bestSolution_ != NULL;} |
| 51 |
protected: |
| 52 |
/** Pointer to branch-and-bound algorithm.*/ |
| 53 |
Bab * babPtr_; |
| 54 |
}; |
| 55 |
}/* End namespace.*/ |
| 56 |
|
| 57 |
#endif |