BonCouenneSetup.hpp

Go to the documentation of this file.
00001 /* $Id: BonCouenneSetup.hpp 804 2012-01-30 23:40:42Z 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 #include "CouenneTNLP.hpp"
00019 
00020 struct ASL;
00021 
00022 namespace Bonmin{
00023   class Bab;
00024 }
00025 
00026 namespace Couenne {
00027 
00028   class CouenneInterface;
00029   class CouenneCutGenerator;
00030   class CouenneProblem;
00031   class CouenneTNLP;
00032 
00033   class SmartAsl : public Ipopt::ReferencedObject{
00034   public:
00035     ASL * asl;
00036     SmartAsl():
00037       Ipopt::ReferencedObject(),
00038       asl(NULL)
00039     {}
00040     virtual ~SmartAsl();
00041   };
00042 
00043   class CouenneSetup : public Bonmin::BonminSetup{
00044   public:
00046     CouenneSetup():
00047     BonminSetup(),
00048     aslfg_(NULL),
00049     CouennePtr_ (NULL),
00050     displayStats_ (false),
00051     couenneProb_ (NULL),
00052     couenneProb_is_own_(true) {}
00053 
00055     CouenneSetup(const CouenneSetup& other):
00056       BonminSetup(other),
00057       aslfg_(NULL),
00058       displayStats_ (other.displayStats_),
00059       couenneProb_ (other.couenneProb_) {}
00060     
00062     virtual Bonmin::BabSetupBase * clone () const
00063     {return new CouenneSetup (*this);}
00064     
00066     virtual ~CouenneSetup();
00067 
00069     bool InitializeCouenne(char ** argv = NULL, 
00070                            CouenneProblem *couenneProb = NULL,
00071                            Ipopt::SmartPtr<Bonmin::TMINLP> tminlp = NULL,
00072                            CouenneInterface *ci = NULL,
00073                            Bonmin::Bab *bb = NULL);
00074     
00076     virtual void registerOptions();
00078     static void registerAllOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
00079     
00081     virtual void readOptionsFile(){
00082       if (readOptions_) return;
00083       Bonmin::BabSetupBase::readOptionsFile ("couenne.opt");
00084     }
00085 
00087     CouenneCutGenerator *couennePtr () const
00088     {return CouennePtr_;}
00089 
00091     bool displayStats () 
00092     {return displayStats_;}
00093 
00095     void addMilpCutGenerators ();
00096 
00098     inline void setDoubleParameter (const DoubleParameter &p, const double val)
00099     {doubleParam_ [p] = val;}
00100 
00102     inline double getDoubleParameter (const DoubleParameter &p) const
00103     {return doubleParam_ [p];}
00104 
00105     void setNodeComparisonMethod (Bonmin::BabSetupBase::NodeComparison c)
00106     {nodeComparisonMethod_ = c;}
00107 
00108 private:
00109     Ipopt::SmartPtr<SmartAsl> aslfg_;
00110 
00115     CouenneCutGenerator *CouennePtr_;
00116 
00118     bool displayStats_;
00119 
00121     CouenneProblem *couenneProb_;
00122     
00124     bool couenneProb_is_own_;
00125   };
00126 }
00127 
00128 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 13 May 2015 for Couenne by  doxygen 1.6.1