• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/tmp/buildd/coinor-ipopt-3.8.3/Ipopt/contrib/AsNMPC/AmplSolver/AsAmplNmpcTNLP.hpp

Go to the documentation of this file.
00001 // Copyright 2009 Hans Pirnay
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // Date   : 2009-05-11
00006 
00007 #ifndef __ASAMPLNMPCTNLP_HPP__
00008 #define __ASAMPLNMPCTNLP_HPP__
00009 
00010 #include "AmplTNLP.hpp"
00011 
00012 namespace Ipopt 
00013 {
00014 
00015   DECLARE_STD_EXCEPTION(SUFFIX_EMPTY);
00016 
00017   class AmplNmpcTNLP : public AmplTNLP
00018   {
00022   public:
00024     AmplNmpcTNLP(const SmartPtr<const Journalist>& jnlst,
00025                  const SmartPtr<OptionsList> options,
00026                  char**& argv,
00027                  SmartPtr<AmplSuffixHandler> suffix_handler= NULL,
00028                  bool allow_discrete = false,
00029                  SmartPtr<AmplOptionsList> ampl_options_list= NULL ,
00030                  const char* ampl_option_string = NULL ,
00031                  const char* ampl_invokation_string  = NULL,
00032                  const char* ampl_banner_string  = NULL,
00033                  std::string* nl_file_content  = NULL);
00034 
00035     virtual ~AmplNmpcTNLP();
00036 
00038     virtual bool get_bounds_info(Index n, Number* x_l, Number* x_u,
00039                                  Index m, Number* g_l, Number* g_u);
00040 
00041     void set_nmpc_solution(Index idx, SmartPtr<IteratesVector> nmpc_sol);
00042 
00043     virtual void finalize_solution(SolverReturn status,
00044                                    Index n, const Number* x, const Number* z_L, const Number* z_U,
00045                                    Index m, const Number* g, const Number* lambda,
00046                                    Number obj_value,
00047                                    const IpoptData* ip_data,
00048                                    IpoptCalculatedQuantities* ip_cq);    
00049 
00050     const Index* get_index_suffix(const char* suffix_name);
00051 
00052     std::vector<Index> get_index_suffix_vec(const char* suffix_name);
00053 
00054     const Number* get_number_suffix(const char* suffix_name);
00055 
00056     std::vector<Number> get_number_suffix_vec(const char* suffix_name);
00057 
00058     const Index* get_index_suffix_constr(const char* suffix_name);
00059 
00060     std::vector<Index> get_index_suffix_constr_vec(const char* suffix_name);
00061 
00062     const Number* get_number_suffix_constr(const char* suffix_name);
00063 
00064     virtual bool get_var_con_metadata(Index n,
00065                                       StringMetaDataMapType& var_string_md,
00066                                       IntegerMetaDataMapType& var_integer_md,
00067                                       NumericMetaDataMapType& var_numeric_md,
00068                                       Index m,
00069                                       StringMetaDataMapType& con_string_md,
00070                                       IntegerMetaDataMapType& con_integer_md,
00071                                       NumericMetaDataMapType& con_numeric_md);
00072 
00073   private:
00074     
00076     //    Number* x_L;
00077     //Number* x_U;
00078 
00079     SmartPtr<const Journalist> jnlst_;
00080     SmartPtr<OptionsList> options_;
00081 
00082     bool have_parameters_;
00083 
00084     Index* parameter_flags_;
00085     Number* parameter_values_;
00086 
00088     Index n_nmpc_steps_;
00089     bool run_nmpc_;
00090     bool compute_red_hessian_;
00091 
00092     std::vector< SmartPtr<IteratesVector> > nmpc_sol_;
00093     
00094   };
00095 
00096 }
00097 
00098 #endif

Generated on Thu Jul 29 2010 19:56:08 by  doxygen 1.7.1