BonCouenneSetup.hpp

Go to the documentation of this file.
00001 /* $Id: BonCouenneSetup.hpp 749 2011-07-31 11:54:55Z pbelotti $ */
00002 // (C) Copyright International Business Machines Corporation 2007
00003 // All Rights Reserved.
00004 // This code is published under the Eclipse Public License (EPL).
00005 //
00006 // Authors :
00007 // Pierre Bonami, International Business Machines Corporation
00008 //
00009 // Date : 04/18/2007
00010 
00011 #ifndef BonCouenneSetup_H
00012 #define BonCouenneSetup_H
00013 
00014 #include "BonBabSetupBase.hpp"
00015 #include "BonBonminSetup.hpp"
00016 #include "CbcFeasibilityBase.hpp"
00017 
00018 struct ASL;
00019 
00020 namespace Bonmin{
00021   class Bab;
00022 }
00023 
00024 namespace Couenne {
00025 
00026   class CouenneInterface;
00027   class CouenneCutGenerator;
00028   class CouenneProblem;
00029 
00030   class SmartAsl : public Ipopt::ReferencedObject{
00031   public:
00032     ASL * asl;
00033     SmartAsl():
00034       Ipopt::ReferencedObject(),
00035       asl(NULL)
00036     {}
00037     virtual ~SmartAsl();
00038   };
00039 
00040   class CouenneSetup : public Bonmin::BonminSetup{
00041   public:
00043     CouenneSetup():
00044     BonminSetup(),
00045     aslfg_(NULL),
00046     CouennePtr_ (NULL),
00047     displayStats_ (false),
00048     couenneProb_ (NULL),
00049     couenneProb_is_own_(true) {}
00050 
00052     CouenneSetup(const CouenneSetup& other):
00053       BonminSetup(other),
00054       aslfg_(NULL),
00055       displayStats_ (other.displayStats_),
00056       couenneProb_ (other.couenneProb_) {}
00057     
00059     virtual Bonmin::BabSetupBase * clone () const
00060     {return new CouenneSetup (*this);}
00061     
00063     virtual ~CouenneSetup();
00064 
00066     bool InitializeCouenne(char ** argv = NULL, 
00067                            CouenneProblem *couenneProb = NULL,
00068                            Ipopt::SmartPtr<Bonmin::TMINLP> tminlp = NULL,
00069                            CouenneInterface *ci = NULL,
00070                            Bonmin::Bab *bb = NULL);
00071     
00073     virtual void registerOptions();
00075     static void registerAllOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
00076     
00078     virtual void readOptionsFile(){
00079       if (readOptions_) return;
00080       Bonmin::BabSetupBase::readOptionsFile("couenne.opt");
00081     }
00082 
00084     CouenneCutGenerator *couennePtr () const
00085     {return CouennePtr_;}
00086 
00088     bool displayStats () 
00089     {return displayStats_;}
00090 
00092     void addMilpCutGenerators ();
00093 
00095     inline void setDoubleParameter (const DoubleParameter &p, const double val)
00096     {doubleParam_ [p] = val;}
00097 
00099     inline double getDoubleParameter (const DoubleParameter &p) const
00100     {return doubleParam_ [p];}
00101 
00102     void setNodeComparisonMethod (Bonmin::BabSetupBase::NodeComparison c)
00103     {nodeComparisonMethod_ = c;}
00104 
00105 private:
00106     Ipopt::SmartPtr<SmartAsl> aslfg_;
00107 
00112     CouenneCutGenerator *CouennePtr_;
00113 
00115     bool displayStats_;
00116 
00118     CouenneProblem *couenneProb_;
00119     
00121     bool couenneProb_is_own_;
00122   };
00123 }
00124 
00125 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 17 Sep 2013 for Couenne by  doxygen 1.6.1