Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SensAmplTNLP.hpp
Go to the documentation of this file.
1 // Copyright 2009 Hans Pirnay
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Date : 2009-05-11
6
7 #ifndef __SENSAMPLTNLP_HPP__
8 #define __SENSAMPLTNLP_HPP__
9
10 #include "AmplTNLP.hpp"
11
12 namespace Ipopt
13 {
14
15 DECLARE_STD_EXCEPTION(SUFFIX_EMPTY);
16
17 class SensAmplTNLP : public AmplTNLP
18 {
22 public:
24 SensAmplTNLP(const SmartPtr<const Journalist>& jnlst,
25 const SmartPtr<OptionsList> options,
26 char**& argv,
27 SmartPtr<AmplSuffixHandler> suffix_handler= NULL,
28 bool allow_discrete = false,
29 SmartPtr<AmplOptionsList> ampl_options_list= NULL ,
30 const char* ampl_option_string = NULL ,
31 const char* ampl_invokation_string = NULL,
32 const char* ampl_banner_string = NULL,
33 std::string* nl_file_content = NULL);
34
35 virtual ~SensAmplTNLP();
36
38 virtual bool get_bounds_info(Index n, Number* x_l, Number* x_u,
39 Index m, Number* g_l, Number* g_u);
40
41 void set_sens_solution(Index idx, SmartPtr<IteratesVector> sens_sol);
42
43 virtual void finalize_metadata(Index n,
44 const StringMetaDataMapType& var_string_md,
45 const IntegerMetaDataMapType& var_integer_md,
46 const NumericMetaDataMapType& var_numeric_md,
47 Index m,
48 const StringMetaDataMapType& con_string_md,
49 const IntegerMetaDataMapType& con_integer_md,
50 const NumericMetaDataMapType& con_numeric_md);
51
52 virtual void finalize_solution(SolverReturn status,
53 Index n, const Number* x, const Number* z_L, const Number* z_U,
54 Index m, const Number* g, const Number* lambda,
55 Number obj_value,
56 const IpoptData* ip_data,
57 IpoptCalculatedQuantities* ip_cq);
58
59 const Index* get_index_suffix(const char* suffix_name);
60
61 std::vector<Index> get_index_suffix_vec(const char* suffix_name);
62
63 const Number* get_number_suffix(const char* suffix_name);
64
65 std::vector<Number> get_number_suffix_vec(const char* suffix_name);
66
67 const Index* get_index_suffix_constr(const char* suffix_name);
68
69 std::vector<Index> get_index_suffix_constr_vec(const char* suffix_name);
70
71 const Number* get_number_suffix_constr(const char* suffix_name);
72
73 virtual bool get_var_con_metadata(Index n,
74 StringMetaDataMapType& var_string_md,
75 IntegerMetaDataMapType& var_integer_md,
76 NumericMetaDataMapType& var_numeric_md,
77 Index m,
78 StringMetaDataMapType& con_string_md,
79 IntegerMetaDataMapType& con_integer_md,
80 NumericMetaDataMapType& con_numeric_md);
81
82 private:
83
85 // Number* x_L;
86 //Number* x_U;
87
88 SmartPtr<const Journalist> jnlst_;
89 SmartPtr<OptionsList> options_;
90
91 bool have_parameters_;
92
93 Index* parameter_flags_;
94 Number* parameter_values_;
95
97 Index n_sens_steps_;
98 bool run_sens_;
99 bool compute_red_hessian_;
100
101 std::vector< SmartPtr<IteratesVector> > sens_sol_;
102
103 };
104
105 }
106
107 #endif
Ipopt::TNLP::NumericMetaDataMapType
std::map< std::string, std::vector< Number > > NumericMetaDataMapType
Definition: IpTNLP.hpp:86
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
Ipopt::SensAmplTNLP::set_sens_solution
void set_sens_solution(Index idx, SmartPtr< IteratesVector > sens_sol)
Ipopt::IpoptCalculatedQuantities
Class for all IPOPT specific calculated quantities.
Definition: IpIpoptCalculatedQuantities.hpp:81
Ipopt::SensAmplTNLP::get_var_con_metadata
virtual bool get_var_con_metadata(Index n, StringMetaDataMapType &var_string_md, IntegerMetaDataMapType &var_integer_md, NumericMetaDataMapType &var_numeric_md, Index m, StringMetaDataMapType &con_string_md, IntegerMetaDataMapType &con_integer_md, NumericMetaDataMapType &con_numeric_md)
returns names and other meta data for the variables and constraints Overloaded from TNLP ...
m
Number Number Index m
Number of constraints.
Definition: IpStdCInterface.h:137
Ipopt::SensAmplTNLP::get_index_suffix
const Index * get_index_suffix(const char *suffix_name)
Ipopt::SensAmplTNLP::SensAmplTNLP
SensAmplTNLP(const SmartPtr< const Journalist > &jnlst, const SmartPtr< OptionsList > options, char **&argv, SmartPtr< AmplSuffixHandler > suffix_handler=NULL, bool allow_discrete=false, SmartPtr< AmplOptionsList > ampl_options_list=NULL, const char *ampl_option_string=NULL, const char *ampl_invokation_string=NULL, const char *ampl_banner_string=NULL, std::string *nl_file_content=NULL)
This class is the Sens-wrapper for the ampltnlp, adapts the get bounds function and some others to ou...
Ipopt::SensAmplTNLP
Definition: SensAmplTNLP.hpp:17
g
Number Number * g
Values of constraint at final point (output only - ignored if set to NULL)
Definition: IpStdCInterface.h:238
Ipopt::SensAmplTNLP::compute_red_hessian_
bool compute_red_hessian_
Definition: SensAmplTNLP.hpp:99
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::SensAmplTNLP::parameter_values_
Number * parameter_values_
Definition: SensAmplTNLP.hpp:94
Ipopt::SensAmplTNLP::sens_sol_
std::vector< SmartPtr< IteratesVector > > sens_sol_
Definition: SensAmplTNLP.hpp:101
AmplTNLP.hpp
Ipopt::SensAmplTNLP::finalize_solution
virtual void finalize_solution(SolverReturn status, Index n, const Number *x, const Number *z_L, const Number *z_U, Index m, const Number *g, const Number *lambda, Number obj_value, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq)
This method is called when the algorithm is complete so the TNLP can store/write the solution...
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::SensAmplTNLP::get_index_suffix_constr_vec
std::vector< Index > get_index_suffix_constr_vec(const char *suffix_name)
Ipopt::SolverReturn
SolverReturn
enum for the return from the optimize algorithm (obviously we need to add more)
Definition: IpAlgTypes.hpp:22
Ipopt::SensAmplTNLP::jnlst_
SmartPtr< const Journalist > jnlst_
local copy of current lower and upper bounds - needed for parameter change
Definition: SensAmplTNLP.hpp:88
Ipopt::SensAmplTNLP::get_index_suffix_vec
std::vector< Index > get_index_suffix_vec(const char *suffix_name)
Ipopt::SensAmplTNLP::parameter_flags_
Index * parameter_flags_
Definition: SensAmplTNLP.hpp:93
Ipopt::SensAmplTNLP::get_number_suffix
const Number * get_number_suffix(const char *suffix_name)
Ipopt::SensAmplTNLP::get_number_suffix_vec
std::vector< Number > get_number_suffix_vec(const char *suffix_name)
Ipopt::IpoptData
Class to organize all the data required by the algorithm.
Definition: IpIpoptData.hpp:83
Ipopt::SensAmplTNLP::have_parameters_
bool have_parameters_
Definition: SensAmplTNLP.hpp:91
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::SensAmplTNLP::get_number_suffix_constr
const Number * get_number_suffix_constr(const char *suffix_name)
Ipopt::SensAmplTNLP::run_sens_
bool run_sens_
Definition: SensAmplTNLP.hpp:98
Ipopt::TNLP::IntegerMetaDataMapType
std::map< std::string, std::vector< Index > > IntegerMetaDataMapType
Definition: IpTNLP.hpp:85
Ipopt::SensAmplTNLP::n_sens_steps_
Index n_sens_steps_
important Options
Definition: SensAmplTNLP.hpp:97
Ipopt::TNLP::StringMetaDataMapType
std::map< std::string, std::vector< std::string > > StringMetaDataMapType
Definition: IpTNLP.hpp:84
Ipopt::AmplTNLP
Ampl Interface.
Definition: AmplTNLP.hpp:271
Ipopt::DECLARE_STD_EXCEPTION
DECLARE_STD_EXCEPTION(SUFFIX_EMPTY)
Ipopt::SensAmplTNLP::~SensAmplTNLP
virtual ~SensAmplTNLP()
Ipopt::SensAmplTNLP::get_index_suffix_constr
const Index * get_index_suffix_constr(const char *suffix_name)
Ipopt::SensAmplTNLP::get_bounds_info
virtual bool get_bounds_info(Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
returns bounds of the nlp.
Ipopt::SensAmplTNLP::finalize_metadata
virtual void finalize_metadata(Index n, const StringMetaDataMapType &var_string_md, const IntegerMetaDataMapType &var_integer_md, const NumericMetaDataMapType &var_numeric_md, Index m, const StringMetaDataMapType &con_string_md, const IntegerMetaDataMapType &con_integer_md, const NumericMetaDataMapType &con_numeric_md)
This method is called just before finalize_solution.
Ipopt::SensAmplTNLP::options_
SmartPtr< OptionsList > options_
Definition: SensAmplTNLP.hpp:89