- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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

Go to the documentation of this file.

    00001 // Copyright (C) 2004, 2007 International Business Machines and others.
    00002 // All Rights Reserved.
    00003 // This code is published under the Common Public License.
    00004 //
    00005 // $Id: IpIpoptApplication.hpp 1056 2007-07-24 20:43:53Z 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();
    00125
    00128     static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
    00130
    00132     static void
    00133     RegisterAllIpoptOptions(const SmartPtr<RegisteredOptions>& roptions);
    00134
    00135   private:
    00145     // IpoptApplication();
    00146
    00148     IpoptApplication(const IpoptApplication&);
    00149
    00151     void operator=(const IpoptApplication&);
    00153
    00156     ApplicationReturnStatus call_optimize();
    00157
    00161     bool read_params_dat_;
    00163
    00165     SmartPtr<Journalist> jnlst_;
    00166
    00168     SmartPtr<RegisteredOptions> reg_options_;
    00169
    00171     SmartPtr<OptionsList> options_;
    00172
    00175     SmartPtr<SolveStatistics> statistics_;
    00176
    00179     SmartPtr<IpoptAlgorithm> alg_;
    00180
    00183     SmartPtr<IpoptNLP> ip_nlp_;
    00184
    00188     SmartPtr<IpoptData> ip_data_;
    00189
    00193     SmartPtr<IpoptCalculatedQuantities> ip_cq_;
    00194
    00197     SmartPtr<NLP> nlp_adapter_;
    00198   };
    00199
    00200 } // namespace Ipopt
    00201
    00202 #endif