/home/coin/SVN-release/Ipopt-3.3.1/Ipopt/src/Interfaces/IpIpoptApplication.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2004, 2006 International Business Machines and others.
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // $Id: IpIpoptApplication.hpp 1010 2007-06-21 15:54:36Z andreasw $
00006 //
00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
00008 
00009 #ifndef __IPIPOPTAPPLICATION_HPP__
00010 #define __IPIPOPTAPPLICATION_HPP__
00011 
00012 #include <iostream>
00013 
00014 #include "IpJournalist.hpp"
00015 #include "IpTNLP.hpp"
00016 #include "IpNLP.hpp"
00017 /* Return codes for the Optimize call for an application */
00018 #include "IpReturnCodes.hpp"
00019 
00020 namespace Ipopt
00021 {
00022   DECLARE_STD_EXCEPTION(IPOPT_APPLICATION_ERROR);
00023 
00024   /* forward declarations */
00025   class IpoptAlgorithm;
00026   class IpoptNLP;
00027   class IpoptData;
00028   class IpoptCalculatedQuantities;
00029   class AlgorithmBuilder;
00030   class RegisteredOptions;
00031   class OptionsList;
00032   class SolveStatistics;
00033 
00035   class IpoptApplication : public ReferencedObject
00036   {
00037   public:
00038     IpoptApplication(bool create_console_out = true,
00039                      bool create_empty = false);
00040 
00043     IpoptApplication(SmartPtr<RegisteredOptions> reg_options,
00044                      SmartPtr<OptionsList> options,
00045                      SmartPtr<Journalist> jnlst);
00046 
00047     virtual ~IpoptApplication();
00048 
00052     SmartPtr<IpoptApplication> clone();
00053 
00061     ApplicationReturnStatus Initialize(std::string params_file = "ipopt.opt");
00062     ApplicationReturnStatus Initialize(std::istream& is);
00063 
00067     ApplicationReturnStatus OptimizeTNLP(const SmartPtr<TNLP>& tnlp);
00068 
00070     ApplicationReturnStatus OptimizeNLP(const SmartPtr<NLP>& nlp, SmartPtr<AlgorithmBuilder> alg_builder=NULL);
00071 
00077     ApplicationReturnStatus ReOptimizeTNLP(const SmartPtr<TNLP>& tnlp);
00078 
00084     ApplicationReturnStatus ReOptimizeNLP(const SmartPtr<NLP>& nlp);
00086 
00089     bool OpenOutputFile(std::string file_name, EJournalLevel print_level);
00090 
00094     SmartPtr<Journalist> Jnlst()
00095     {
00096       return jnlst_;
00097     }
00098 
00101     SmartPtr<RegisteredOptions> RegOptions()
00102     {
00103       return reg_options_;
00104     }
00105 
00107     SmartPtr<OptionsList> Options()
00108     {
00109       return options_;
00110     }
00111 
00113     SmartPtr<const OptionsList> Options() const
00114     {
00115       return ConstPtr(options_);
00116     }
00117 
00120     SmartPtr<SolveStatistics> Statistics();
00122 
00125     static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
00127 
00129     static void
00130     RegisterAllIpoptOptions(const SmartPtr<RegisteredOptions>& roptions);
00131 
00132   private:
00142     // IpoptApplication();
00143 
00145     IpoptApplication(const IpoptApplication&);
00146 
00148     void operator=(const IpoptApplication&);
00150 
00153     ApplicationReturnStatus call_optimize();
00154 
00158     bool read_params_dat_;
00160 
00162     SmartPtr<Journalist> jnlst_;
00163 
00165     SmartPtr<RegisteredOptions> reg_options_;
00166 
00168     SmartPtr<OptionsList> options_;
00169 
00172     SmartPtr<SolveStatistics> statistics_;
00173 
00176     SmartPtr<IpoptAlgorithm> alg_;
00177 
00180     SmartPtr<IpoptNLP> ip_nlp_;
00181 
00185     SmartPtr<IpoptData> ip_data_;
00186 
00190     SmartPtr<IpoptCalculatedQuantities> ip_cq_;
00191 
00194     SmartPtr<NLP> nlp_adapter_;
00195   };
00196 
00197 } // namespace Ipopt
00198 
00199 #endif

Generated on Thu May 15 22:25:43 2008 by  doxygen 1.4.7