Bonmin  1.7
BonCbc.hpp
Go to the documentation of this file.
00001 // (C) Copyright International Business Machines Corporation 2007
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // Authors :
00006 // Pierre Bonami, International Business Machines Corporation
00007 //
00008 // Date : 04/19/2007
00009 
00010 #ifndef BonCbc_H
00011 #define BonCbc_H
00012 
00013 //#include "BonBabSetupBase.hpp"
00014 #include "CbcModel.hpp"
00015 
00016 namespace Bonmin
00017 {
00018   class BabSetupBase;
00019   class Bab
00020   {
00021   public:
00023     enum MipStatuses {FeasibleOptimal ,
00024         ProvenInfeasible ,
00025         Feasible ,
00026         UnboundedOrInfeasible /*Coninuous relaxation is unbounded.*/,
00027         NoSolutionKnown,
00028         NumMipStats};
00029 
00030 
00032     Bab();
00034     virtual ~Bab();
00036     virtual void branchAndBound(BabSetupBase & s);
00037 
00039     virtual void operator()(BabSetupBase & s);
00040 
00042     virtual void operator()(BabSetupBase * s){
00043        operator()(*s);}
00044 
00047     const double * bestSolution() const
00048     {
00049       return bestSolution_;
00050     }
00052     double bestObj() const
00053     {
00054       return bestObj_;
00055     }
00056 
00058     MipStatuses mipStatus() const
00059     {
00060       return mipStatus_;
00061     }
00062 
00064     double bestBound();
00065 
00067     int numNodes() const
00068     {
00069       return numNodes_;
00070     }
00072     int iterationCount()
00073     {
00074       return mipIterationCount_;
00075     }
00077     double continuousRelaxation()
00078     {
00079       return continuousRelaxation_;
00080     }
00081 
00084     virtual void replaceIntegers(OsiObject ** objects, int numberObjects)
00085     {}
00087     const CbcModel&  model() const
00088     {
00089       return model_;
00090     }
00091 
00094     CbcModel&  model()
00095     {
00096       return model_;
00097     }
00098 
00099   protected:
00101     double * bestSolution_;
00102 
00104     MipStatuses mipStatus_;
00106     double bestObj_;
00108     double bestBound_;
00110     double continuousRelaxation_;
00112     int numNodes_;
00114     int mipIterationCount_;
00116     CbcModel model_;
00118     CoinMessageHandler * modelHandler_;
00122     OsiObject** objects_;
00124     int nObjects_;
00125   };
00126 }
00127 #endif