Go to the documentation of this file.00001
00002
00003
00004
00005
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
00077
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