/home/coin/SVN-release/OS-2.1.1/Couenne/src/main/BonCouenneSetup.hpp

Go to the documentation of this file.
00001 /* $Id: BonCouenneSetup.hpp 284 2010-01-24 15:09:39Z stefan $ */
00002 // (C) Copyright International Business Machines Corporation 2007
00003 // All Rights Reserved.
00004 // This code is published under the Common Public License.
00005 //
00006 // Authors :
00007 // Pierre Bonami, International Business Machines Corporation
00008 //
00009 // Date : 04/18/2007
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 
00067     bool InitializeCouenne(char ** argv = NULL,
00068          CouenneProblem *couenneProb = NULL,
00069          CouenneInterface *ci = NULL);
00070 
00072     virtual void registerOptions();
00074     static void registerAllOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
00075     
00077     virtual void readOptionsFile(){
00078       if (readOptions_) return;
00079       BabSetupBase::readOptionsFile("couenne.opt");
00080     }
00081 
00083     CouenneCutGenerator *couennePtr () const
00084     {return CouennePtr_;}
00085 
00087     bool displayStats () 
00088     {return displayStats_;}
00089 
00091     void addMilpCutGenerators ();
00092 
00094     inline void setDoubleParameter (const DoubleParameter &p, const double val)
00095     {doubleParam_ [p] = val;}
00096 
00098     inline double getDoubleParameter (const DoubleParameter &p) const
00099     {return doubleParam_ [p];}
00100 
00101 private:
00102       SmartPtr<SmartAsl> aslfg_;
00103 
00108     CouenneCutGenerator *CouennePtr_;
00109 
00111     bool displayStats_;
00112 
00114     CouenneProblem *couenneProb_;
00115     
00117     bool couenneProb_is_own_;
00118   };
00119 }
00120 
00121 #endif

Generated on Mon May 3 03:05:21 2010 by  doxygen 1.4.7