- Main Page
- Classes
- Files

- File List
- File Members

# src/Interfaces/IpIpoptApplication.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2004, 2010 International Business Machines and others.
    00002 // All Rights Reserved.
    00003 // This code is published under the Eclipse Public License.
    00004 //
    00005 // $Id: IpIpoptApplication.hpp 2400 2013-10-19 18:38:36Z stefan $
    00006 //
    00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
    00008
    00009 #ifndef __IPIPOPTAPPLICATION_HPP__
    00010 #define __IPIPOPTAPPLICATION_HPP__
    00011
    00012 #ifndef IPOPT_EXPORT
    00013 #ifdef _MSC_VER
    00014 #ifdef IPOPT_DLL
    00015 #define IPOPT_EXPORT(type) __declspec(dllexport) type __cdecl
    00016 #else
    00017 #define IPOPT_EXPORT(type) type __cdecl
    00018 #endif
    00019 #else
    00020 #define IPOPT_EXPORT(type) type
    00021 #endif
    00022 #endif
    00023
    00024 #include <iostream>
    00025
    00026 #include "IpJournalist.hpp"
    00027 #include "IpTNLP.hpp"
    00028 #include "IpNLP.hpp"
    00029 /* Return codes for the Optimize call for an application */
    00030 #include "IpReturnCodes.hpp"
    00031
    00032 namespace Ipopt
    00033 {
    00034   DECLARE_STD_EXCEPTION(IPOPT_APPLICATION_ERROR);
    00035
    00036   /* forward declarations */
    00037   class IpoptAlgorithm;
    00038   class IpoptNLP;
    00039   class IpoptData;
    00040   class IpoptCalculatedQuantities;
    00041   class AlgorithmBuilder;
    00042   class RegisteredOptions;
    00043   class OptionsList;
    00044   class SolveStatistics;
    00045
    00047   class IpoptApplication : public ReferencedObject
    00048   {
    00049   public:
    00050     IpoptApplication(bool create_console_out = true,
    00051                      bool create_empty = false);
    00052
    00055     IpoptApplication(SmartPtr<RegisteredOptions> reg_options,
    00056                      SmartPtr<OptionsList> options,
    00057                      SmartPtr<Journalist> jnlst);
    00058
    00059     virtual ~IpoptApplication();
    00060
    00064     virtual SmartPtr<IpoptApplication> clone();
    00065
    00073     virtual ApplicationReturnStatus Initialize(std::istream& is);
    00083     virtual ApplicationReturnStatus Initialize(std::string params_file);
    00091     virtual ApplicationReturnStatus Initialize();
    00092
    00096     virtual ApplicationReturnStatus OptimizeTNLP(const SmartPtr<TNLP>& tnlp);
    00097
    00099     virtual ApplicationReturnStatus OptimizeNLP(const SmartPtr<NLP>& nlp);
    00100
    00102     virtual ApplicationReturnStatus OptimizeNLP(const SmartPtr<NLP>& nlp, SmartPtr<AlgorithmBuilder>& alg_builder);
    00103
    00109     virtual ApplicationReturnStatus ReOptimizeTNLP(const SmartPtr<TNLP>& tnlp);
    00110
    00116     virtual ApplicationReturnStatus ReOptimizeNLP(const SmartPtr<NLP>& nlp);
    00118
    00121     virtual bool OpenOutputFile(std::string file_name, EJournalLevel print_level);
    00122
    00126     virtual SmartPtr<Journalist> Jnlst()
    00127     {
    00128       return jnlst_;
    00129     }
    00130
    00133     virtual SmartPtr<RegisteredOptions> RegOptions()
    00134     {
    00135       return reg_options_;
    00136     }
    00137
    00139     virtual SmartPtr<OptionsList> Options()
    00140     {
    00141       return options_;
    00142     }
    00143
    00145     virtual SmartPtr<const OptionsList> Options() const
    00146     {
    00147       return ConstPtr(options_);
    00148     }
    00149
    00152     virtual SmartPtr<SolveStatistics> Statistics();
    00153
    00155     virtual SmartPtr<IpoptNLP> IpoptNLPObject();
    00156
    00158     SmartPtr<IpoptData> IpoptDataObject();
    00159
    00161     virtual SmartPtr<IpoptCalculatedQuantities> IpoptCQObject();
    00162
    00164     SmartPtr<IpoptAlgorithm> AlgorithmObject();
    00166
    00171     void PrintCopyrightMessage();
    00172
    00180     void RethrowNonIpoptException(bool dorethrow)
    00181     {
    00182        rethrow_nonipoptexception_ = dorethrow;
    00183     }
    00184
    00187     static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
    00189
    00191     static void
    00192     RegisterAllIpoptOptions(const SmartPtr<RegisteredOptions>& roptions);
    00193
    00194   private:
    00204     // IpoptApplication();
    00205
    00207     IpoptApplication(const IpoptApplication&);
    00208
    00210     void operator=(const IpoptApplication&);
    00212
    00215     ApplicationReturnStatus call_optimize();
    00216
    00220     bool read_params_dat_;
    00221
    00223     bool rethrow_nonipoptexception_;
    00225
    00227     SmartPtr<Journalist> jnlst_;
    00228
    00230     SmartPtr<RegisteredOptions> reg_options_;
    00231
    00233     SmartPtr<OptionsList> options_;
    00234
    00237     SmartPtr<SolveStatistics> statistics_;
    00238
    00241     SmartPtr<IpoptAlgorithm> alg_;
    00242
    00245     SmartPtr<IpoptNLP> ip_nlp_;
    00246
    00250     SmartPtr<IpoptData> ip_data_;
    00251
    00255     SmartPtr<IpoptCalculatedQuantities> ip_cq_;
    00256
    00259     SmartPtr<NLP> nlp_adapter_;
    00260
    00264     bool inexact_algorithm_;
    00267     bool replace_bounds_;
    00269   };
    00270
    00271 } // namespace Ipopt
    00272
    00273 extern "C" IPOPT_EXPORT(class Ipopt::IpoptApplication *) IpoptApplicationFactory();
    00274
    00275 #endif

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines