Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CouenneUserInterface.hpp
Go to the documentation of this file.
1 // $Id: CouenneUserInterface.hpp 530 2011-03-12 16:52:06Z pbelotti $
2 //
3 // (C) Copyright XXX 2009
4 // All Rights Reserved.
5 // This code is published under the Eclipse Public License (EPL).
6 //
7 // Authors :
8 // Pietro Belotti, Lehigh University
9 // Stefan Vigerske, Humboldt University
10 //
11 // Date : 07/18/2009
12 
13 #ifndef COUENNEUSERINTERFACE_HPP_
14 #define COUENNEUSERINTERFACE_HPP_
15 
16 //#include "CouenneConfig.h"
17 #include "IpOptionsList.hpp"
18 #include "IpJournalist.hpp"
19 
20 namespace Bonmin {
21 class TMINLP;
22 class Bab;
23 }
24 
25 namespace Couenne {
26 
27 class CouenneProblem;
28 class CouenneBaB;
29 
30 /* abstract base class of an interface for Couenne users
31  */
33 protected:
36 
37 public:
39  : options(options_), jnlst(jnlst_)
40  { }
41 
42  virtual ~CouenneUserInterface() { }
43 
47  virtual bool setupJournals() {
48  Ipopt::SmartPtr<Ipopt::Journal> stdout_jrnl = jnlst->AddFileJournal("console", "stdout", Ipopt::J_ITERSUMMARY);
49  stdout_jrnl->SetPrintLevel(Ipopt::J_DBG, Ipopt::J_NONE);
50  return true;
51  }
52 
56  virtual CouenneProblem* getCouenneProblem() = 0;
57 
61 
65  virtual bool addBabPlugins(Bonmin::Bab& bab) {
66  // CutGenerator1 myCutGenerator (problem, optionList);
67  // BoundTightener1 myBoundTightener (problem, optionList);
68  // Heuristic myHeuristic (problem, optionList);
69 
70  // bab.addCutGenerator (myCutGenerator);
71  // bab.addBoundTightener (myBoundTightener);
72  // bab.addHeuristic (myHeur1);
73  // bab.addJournalist (myJour);
74  return true;
75  }
76 
79  virtual bool writeSolution(Bonmin::Bab& bab) {
80  return true;
81  }
82 };
83 
84 }
85 
86 #endif /*COUENNEUSERINTERFACE_HPP_*/
Ipopt::SmartPtr< Ipopt::OptionsList > options
Ipopt::SmartPtr< Ipopt::Journalist > jnlst
virtual bool addBabPlugins(Bonmin::Bab &bab)
Called after B&amp;B object is setup.
virtual Ipopt::SmartPtr< Bonmin::TMINLP > getTMINLP()=0
Should return the problem to solve as TMINLP.
virtual bool writeSolution(Bonmin::Bab &bab)
Called after B&amp;B finished.
virtual bool setupJournals()
Setup journals for printing.
virtual CouenneProblem * getCouenneProblem()=0
Should return the problem to solve in algebraic form.
Class for MINLP problems with symbolic information.
CouenneUserInterface(Ipopt::SmartPtr< Ipopt::OptionsList > options_, Ipopt::SmartPtr< Ipopt::Journalist > jnlst_)