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

Go to the documentation of this file.
00001 // Copyright (C) 2004, 2009 International Business Machines and others.
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // $Id: IpIpoptApplication.hpp 1522 2009-07-15 23:32:57Z 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);
00071 
00073     ApplicationReturnStatus OptimizeNLP(const SmartPtr<NLP>& nlp, SmartPtr<AlgorithmBuilder>& alg_builder);
00074 
00080     ApplicationReturnStatus ReOptimizeTNLP(const SmartPtr<TNLP>& tnlp);
00081 
00087     ApplicationReturnStatus ReOptimizeNLP(const SmartPtr<NLP>& nlp);
00089 
00092     bool OpenOutputFile(std::string file_name, EJournalLevel print_level);
00093 
00097     SmartPtr<Journalist> Jnlst()
00098     {
00099       return jnlst_;
00100     }
00101 
00104     SmartPtr<RegisteredOptions> RegOptions()
00105     {
00106       return reg_options_;
00107     }
00108 
00110     SmartPtr<OptionsList> Options()
00111     {
00112       return options_;
00113     }
00114 
00116     SmartPtr<const OptionsList> Options() const
00117     {
00118       return ConstPtr(options_);
00119     }
00120 
00123     SmartPtr<SolveStatistics> Statistics();
00124 
00126     SmartPtr<IpoptNLP> IpoptNLPObject();
00127 
00129     SmartPtr<IpoptData> IpoptDataObject();
00130 
00132     SmartPtr<IpoptCalculatedQuantities> IpoptCQObject();
00133 
00135     SmartPtr<IpoptAlgorithm> AlgorithmObject();
00137 
00140     static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
00142 
00144     static void
00145     RegisterAllIpoptOptions(const SmartPtr<RegisteredOptions>& roptions);
00146 
00147   private:
00157     // IpoptApplication();
00158 
00160     IpoptApplication(const IpoptApplication&);
00161 
00163     void operator=(const IpoptApplication&);
00165 
00168     ApplicationReturnStatus call_optimize();
00169 
00173     bool read_params_dat_;
00175 
00177     SmartPtr<Journalist> jnlst_;
00178 
00180     SmartPtr<RegisteredOptions> reg_options_;
00181 
00183     SmartPtr<OptionsList> options_;
00184 
00187     SmartPtr<SolveStatistics> statistics_;
00188 
00191     SmartPtr<IpoptAlgorithm> alg_;
00192 
00195     SmartPtr<IpoptNLP> ip_nlp_;
00196 
00200     SmartPtr<IpoptData> ip_data_;
00201 
00205     SmartPtr<IpoptCalculatedQuantities> ip_cq_;
00206 
00209     SmartPtr<NLP> nlp_adapter_;
00210 
00214     bool inexact_algorithm_;
00217     bool replace_bounds_;
00220     bool skip_finalize_solution_call_;
00222   };
00223 
00224 } // namespace Ipopt
00225 
00226 #endif

Generated on Fri Jul 17 03:01:48 2009 by  doxygen 1.4.7