00001 // $Id: CouenneAmplInterface.hpp 488 2011-01-10 17:06:41Z 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 COUENNEAMPLINTERFACE_HPP_ 00014 #define COUENNEAMPLINTERFACE_HPP_ 00015 00016 #include "CouenneUserInterface.hpp" 00017 #include "BonRegisteredOptions.hpp" 00018 00019 struct ASL; 00020 struct expr; 00021 00022 namespace Couenne { 00023 00024 class expression; 00025 00026 class CouenneAmplInterface : public CouenneUserInterface { 00027 private: 00028 CouenneProblem* problem; 00029 Ipopt::SmartPtr<Bonmin::TMINLP> tminlp; 00030 00031 Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions; 00032 struct ASL* asl; 00033 00034 bool readASLfg(); 00035 bool readnl(); 00036 expression* nl2e(expr *e); 00037 00038 public: 00039 static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions); 00040 00041 CouenneAmplInterface(Ipopt::SmartPtr<Ipopt::OptionsList> options_, Ipopt::SmartPtr<Ipopt::Journalist> jnlst_) 00042 : CouenneUserInterface(options_, jnlst_), problem(NULL), asl(NULL) 00043 { } 00044 00045 ~CouenneAmplInterface(); 00046 00047 CouenneProblem* getCouenneProblem(); 00048 00049 Ipopt::SmartPtr<Bonmin::TMINLP> getTMINLP(); 00050 00051 bool writeSolution(Bonmin::Bab& bab); 00052 00053 void setRegisteredOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions_) 00054 { roptions = roptions_; } 00055 00056 }; 00057 00058 } 00059 00060 #endif /*COUENNEAMPLINTERFACE_HPP_*/