00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef BonCouenneSetup_H
00011 #define BonCouenneSetup_H
00012 #include "BonBabSetupBase.hpp"
00013 #include "CbcFeasibilityBase.hpp"
00014
00015 struct ASL;
00016
00017 class CouenneCutGenerator;
00018 class CouenneProblem;
00019
00020 namespace Bonmin{
00021
00022 class CouenneInterface;
00023
00024 class SmartAsl : public Ipopt::ReferencedObject{
00025 public:
00026 ASL * asl;
00027 SmartAsl():
00028 Ipopt::ReferencedObject(),
00029 asl(NULL)
00030 {}
00031 virtual ~SmartAsl();
00032 };
00033
00034 class CouenneSetup : public BabSetupBase{
00035 public:
00037 CouenneSetup():
00038 BabSetupBase(),
00039 aslfg_(NULL),
00040 CouennePtr_ (NULL),
00041 displayStats_ (false),
00042 couenneProb_ (NULL),
00043 couenneProb_is_own_(true) {}
00044
00046 CouenneSetup(const CouenneSetup& other):
00047 BabSetupBase(other),
00048 aslfg_(NULL),
00049 displayStats_ (other.displayStats_),
00050 couenneProb_ (other.couenneProb_) {}
00051
00053 virtual BabSetupBase * clone () const
00054 {return new CouenneSetup (*this);}
00055
00057 virtual ~CouenneSetup();
00058
00060 bool InitializeCouenne(char ** argv = NULL,
00061 CouenneProblem *couenneProb = NULL,
00062 Ipopt::SmartPtr<Bonmin::TMINLP> tminlp = NULL,
00063 CouenneInterface *ci = NULL);
00064
00066 virtual void registerOptions();
00068 static void registerAllOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
00069
00071 virtual void readOptionsFile(){
00072 if (readOptions_) return;
00073 BabSetupBase::readOptionsFile("couenne.opt");
00074 }
00075
00077 CouenneCutGenerator *couennePtr () const
00078 {return CouennePtr_;}
00079
00081 bool displayStats ()
00082 {return displayStats_;}
00083
00085 void addMilpCutGenerators ();
00086
00088 inline void setDoubleParameter (const DoubleParameter &p, const double val)
00089 {doubleParam_ [p] = val;}
00090
00092 inline double getDoubleParameter (const DoubleParameter &p) const
00093 {return doubleParam_ [p];}
00094
00095 private:
00096 SmartPtr<SmartAsl> aslfg_;
00097
00102 CouenneCutGenerator *CouennePtr_;
00103
00105 bool displayStats_;
00106
00108 CouenneProblem *couenneProb_;
00109
00111 bool couenneProb_is_own_;
00112 };
00113 }
00114
00115 #endif