Bonmin 1.4trunk
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();
00066     int numNodes() const
00067     {
00068       return numNodes_;
00069     }
00071     int iterationCount()
00072     {
00073       return mipIterationCount_;
00074     }
00076     double continuousRelaxation()
00077     {
00078       return continuousRelaxation_;
00079     }
00080 
00083     virtual void replaceIntegers(OsiObject ** objects, int numberObjects)
00084     {}
00086     const CbcModel&  model() const
00087     {
00088       return model_;
00089     }
00090 
00093     CbcModel&  model()
00094     {
00095       return model_;
00096     }
00098     void setUsingCouenne(bool v)
00099     {
00100       usingCouenne_ = v;
00101     }
00102 
00104     bool getUsingCouenne()
00105     {
00106       return usingCouenne_;
00107     }
00108   protected:
00110     double * bestSolution_;
00111 
00113     MipStatuses mipStatus_;
00115     double bestObj_;
00117     double bestBound_;
00119     double continuousRelaxation_;
00121     int numNodes_;
00123     int mipIterationCount_;
00125     CbcModel model_;
00127     CoinMessageHandler * modelHandler_;
00131     OsiObject** objects_;
00133     int nObjects_;
00134 
00136     bool usingCouenne_;
00137   };
00138 }
00139 #endif