# CouenneUserInterface.hpp

Go to the documentation of this file.

    00001 // $Id: CouenneUserInterface.hpp 530 2011-03-12 16:52:06Z pbelotti $
    00002 //
    00003 // (C) Copyright XXX 2009
    00004 // All Rights Reserved.
    00005 // This code is published under the Eclipse Public License (EPL).
    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 namespace Bonmin {
    00021 class TMINLP;
    00022 class Bab;
    00023 }
    00024
    00025 namespace Couenne {
    00026
    00027 class CouenneProblem;
    00028 class CouenneBaB;
    00029
    00030 /* abstract base class of an interface for Couenne users
    00031  */
    00032 class CouenneUserInterface {
    00033 protected:
    00034         Ipopt::SmartPtr<Ipopt::OptionsList> options;
    00035         Ipopt::SmartPtr<Ipopt::Journalist>  jnlst;
    00036
    00037 public:
    00038         CouenneUserInterface(Ipopt::SmartPtr<Ipopt::OptionsList> options_, Ipopt::SmartPtr<Ipopt::Journalist> jnlst_)
    00039         : options(options_), jnlst(jnlst_)
    00040         { }
    00041
    00042         virtual ~CouenneUserInterface() { }
    00043
    00047         virtual bool setupJournals() {
    00048                 Ipopt::SmartPtr<Ipopt::Journal> stdout_jrnl = jnlst->AddFileJournal("console", "stdout", Ipopt::J_ITERSUMMARY);
    00049                 stdout_jrnl->SetPrintLevel(Ipopt::J_DBG, Ipopt::J_NONE);
    00050                 return true;
    00051         }
    00052
    00056         virtual CouenneProblem* getCouenneProblem() = 0;
    00057
    00060         virtual Ipopt::SmartPtr<Bonmin::TMINLP> getTMINLP() = 0;
    00061
    00065   virtual bool addBabPlugins(Bonmin::Bab& bab) {
    00066         //  CutGenerator1   myCutGenerator   (problem, optionList);
    00067         //  BoundTightener1 myBoundTightener (problem, optionList);
    00068         //  Heuristic       myHeuristic      (problem, optionList);
    00069
    00070         //  bab.addCutGenerator   (myCutGenerator);
    00071         //  bab.addBoundTightener (myBoundTightener);
    00072         //  bab.addHeuristic      (myHeur1);
    00073         //  bab.addJournalist     (myJour);
    00074         return true;
    00075   }
    00076
    00079         virtual bool writeSolution(Bonmin::Bab& bab) {
    00080                 return true;
    00081         }
    00082 };
    00083
    00084 }
    00085
    00086 #endif /*COUENNEUSERINTERFACE_HPP_*/

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines