CouenneUserInterface.hpp

Go to the documentation of this file.
00001 // $Id$
00002 //
00003 // (C) Copyright XXX 2009
00004 // All Rights Reserved.
00005 // This code is published under the Common Public License.
00006 //
00007 // Authors :
00008 // Pietro Belotti, Lehigh University
00009 // Stefan Vigerske, Humboldt University
00010 //
00011 // Date : 07/18/2009
00012 
00013 #ifndef COUENNEUSERINTERFACE_HPP_
00014 #define COUENNEUSERINTERFACE_HPP_
00015 
00016 #include "CouenneConfig.h"
00017 #include "IpOptionsList.hpp"
00018 #include "IpJournalist.hpp"
00019 
00020 class CouenneProblem;
00021 class CouenneBaB;
00022 namespace Bonmin {
00023 class TMINLP;
00024 class Bab;
00025 }
00026 
00027 /* abstract base class of an interface for Couenne users
00028  */ 
00029 class CouenneUserInterface {
00030 protected:
00031         Ipopt::SmartPtr<Ipopt::OptionsList> options;
00032         Ipopt::SmartPtr<Ipopt::Journalist>  jnlst;
00033         
00034 public:
00035         CouenneUserInterface(Ipopt::SmartPtr<Ipopt::OptionsList> options_, Ipopt::SmartPtr<Ipopt::Journalist> jnlst_)
00036         : options(options_), jnlst(jnlst_)
00037         { }
00038         
00039         virtual ~CouenneUserInterface() { }
00040         
00044         virtual bool setupJournals() {
00045                 Ipopt::SmartPtr<Ipopt::Journal> stdout_jrnl = jnlst->AddFileJournal("console", "stdout", Ipopt::J_ITERSUMMARY);
00046                 stdout_jrnl->SetPrintLevel(Ipopt::J_DBG, Ipopt::J_NONE);
00047                 return true;
00048         }
00049         
00053         virtual CouenneProblem* getCouenneProblem() = 0;
00054         
00057         virtual Ipopt::SmartPtr<Bonmin::TMINLP> getTMINLP() = 0;
00058         
00062   virtual bool addBabPlugins(Bonmin::Bab& bab) {
00063         //  CutGenerator1   myCutGenerator   (problem, optionList);
00064         //  BoundTightener1 myBoundTightener (problem, optionList);
00065         //  Heuristic       myHeuristic      (problem, optionList);
00066 
00067         //  bab.addCutGenerator   (myCutGenerator);
00068         //  bab.addBoundTightener (myBoundTightener);
00069         //  bab.addHeuristic      (myHeur1);
00070         //  bab.addJournalist     (myJour);
00071         return true;
00072   }
00073 
00076         virtual bool writeSolution(Bonmin::Bab& bab) {
00077                 return true;
00078         }
00079 };
00080 
00081 
00082 #endif /*COUENNEUSERINTERFACE_HPP_*/

Generated on Wed Jan 20 03:03:55 2010 for Couenne by  doxygen 1.4.7