Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
AmplTNLP.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2009 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: AmplTNLP.hpp 2242 2013-04-24 19:26:30Z stefan $
6 //
7 // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8
9 #ifndef __IPAMPLTNLP_HPP__
10 #define __IPAMPLTNLP_HPP__
11
12 #include "IpUtils.hpp"
13 #include "IpTNLP.hpp"
14 #include "IpJournalist.hpp"
15 #include "IpOptionsList.hpp"
16
17 #include <map>
18 #include <string>
19
20 /* non Ipopt forward declaration */
21 struct ASL_pfgh;
22 struct SufDecl;
23 struct SufDesc;
24
25 namespace Ipopt
26 {
27 class AmplSuffixHandler : public ReferencedObject
28 {
29 public:
30 AmplSuffixHandler();
31
32 ~AmplSuffixHandler();
33
34 enum Suffix_Type
35 {
36 Index_Type,
37 Number_Type
38 };
39
40 enum Suffix_Source
41 {
42 Variable_Source,
43 Constraint_Source,
44 Objective_Source,
45 Problem_Source
46 };
47
48 void AddAvailableSuffix(std::string suffix_string, Suffix_Source source, Suffix_Type type)
49 {
50 suffix_ids_.push_back(suffix_string);
51 suffix_types_.push_back(type);
52 suffix_sources_.push_back(source);
53 // suffix_values_.push_back();
54 }
55
56 const Index* GetIntegerSuffixValues(std::string suffix_string, Suffix_Source source) const;
57
58 const Number* GetNumberSuffixValues(std::string suffix_string, Suffix_Source source) const;
59
60 std::vector<Index> GetIntegerSuffixValues(Index n, std::string suffix_string, Suffix_Source source) const;
61
62 std::vector<Number> GetNumberSuffixValues(Index n, std::string suffix_string, Suffix_Source source) const;
63
64 private:
74 //AmplSuffixHandler();
75
77 AmplSuffixHandler(const AmplSuffixHandler&);
78
80 void operator=(const AmplSuffixHandler&);
82
83 mutable ASL_pfgh* asl_;
84
85 SufDecl* suftab_;
86
87 std::vector<std::string> suffix_ids_;
88 std::vector<Suffix_Type> suffix_types_;
89 std::vector<Suffix_Source> suffix_sources_;
90
92 void PrepareAmplForSuffixes(ASL_pfgh* asl);
93
95 // void RetrieveSuffixesFromAmpl(ASL_pfgh* asl);
96
97 friend class AmplTNLP;
98 };
99
102 class AmplOptionsList : public ReferencedObject
103 {
104 public:
105 enum AmplOptionType {
106 String_Option,
107 Number_Option,
108 Integer_Option,
109 WS_Option, /* this is for AMPL's internal wantsol callback */
110 HaltOnError_Option /* this is for our setting of the nerror_ member */
111 };
112
115 class AmplOption : public ReferencedObject
116 {
117 public:
118 AmplOption(const std::string ipopt_option_name,
119 AmplOptionType type,
120 const std::string description);
121
122 ~AmplOption()
123 {
124 delete [] description_;
125 }
126
127 const std::string& IpoptOptionName() const
128 {
129 return ipopt_option_name_;
130 }
131 AmplOptionType Type() const
132 {
133 return type_;
134 }
135 char* Description() const
136 {
137 return description_;
138 }
139 private:
149 AmplOption();
150
152 AmplOption(const AmplOption&);
153
155 void operator=(const AmplOption&);
157
158 const std::string ipopt_option_name_;
159 const AmplOptionType type_;
160 char* description_;
161 };
162
163 class PrivatInfo
164 {
165 public:
166 PrivatInfo(const std::string ipopt_name,
167 SmartPtr<OptionsList> options,
168 SmartPtr<const Journalist> jnlst,
169 void** nerror = NULL)
170 :
171 ipopt_name_(ipopt_name),
172 options_(options),
173 jnlst_(jnlst),
174 nerror_(nerror)
175 {}
176 const std::string& IpoptName() const
177 {
178 return ipopt_name_;
179 }
180 const SmartPtr<OptionsList>& Options() const
181 {
182 return options_;
183 }
184 const SmartPtr<const Journalist>& Jnlst() const
185 {
186 return jnlst_;
187 }
188 void** NError()
189 {
190 return nerror_;
191 }
192 private:
193 const std::string ipopt_name_;
194 const SmartPtr<OptionsList> options_;
195 const SmartPtr<const Journalist> jnlst_;
196 void** nerror_;
197 };
198
199 public:
201 AmplOptionsList()
202 :
203 keywds_(NULL),
204 nkeywds_(0)
205 {}
206
208 ~AmplOptionsList();
209
211 void AddAmplOption(const std::string ampl_option_name,
212 const std::string ipopt_option_name,
213 AmplOptionsList::AmplOptionType type,
214 const std::string description)
215 {
216 SmartPtr<AmplOption> new_option =
217 new AmplOption(ipopt_option_name, type, description);
218 ampl_options_map_[ampl_option_name] = ConstPtr(new_option);
219 }
220
222 Index NumberOfAmplOptions()
223 {
224 return (Index)ampl_options_map_.size();
225 }
226
228 void* Keywords(const SmartPtr<OptionsList>& options,
229 SmartPtr<const Journalist> jnlst,
230 void** nerror);
231
232 private:
242 //AmplOptionsList();
243
245 AmplOptionsList(const AmplOptionsList&);
246
248 void operator=(const AmplOptionsList&);
250
251 void MakeValidLatexString(std::string source, std::string& dest) const;
252
253 void PrintLatex(SmartPtr<const Journalist> jnlst);
254
256 std::map<std::string, SmartPtr<const AmplOption> > ampl_options_map_;
257 // AW: I think it should be with const like in the following line
258 // but with const the AIX compiler fails
259 // std::map<const std::string, SmartPtr<const AmplOption> > ampl_options_map_;
260
262 void* keywds_;
263
265 Index nkeywds_;
266 };
267
271 class AmplTNLP : public TNLP
272 {
273 public:
277 AmplTNLP(const SmartPtr<const Journalist>& jnlst,
278 const SmartPtr<OptionsList> options,
279 char**& argv, SmartPtr<AmplSuffixHandler>
280 suffix_handler = NULL, bool allow_discrete = false,
281 SmartPtr<AmplOptionsList> ampl_options_list = NULL,
282 const char* ampl_option_string = NULL,
283 const char* ampl_invokation_string = NULL,
284 const char* ampl_banner_string = NULL,
285 std::string* nl_file_content = NULL);
286
288 virtual ~AmplTNLP();
290
292 DECLARE_STD_EXCEPTION(NONPOSITIVE_SCALING_FACTOR);
293
299 virtual bool get_nlp_info(Index& n, Index& m, Index& nnz_jac_g,
300 Index& nnz_h_lag, IndexStyleEnum& index_style);
301
304 virtual bool get_var_con_metadata(Index n,
305 StringMetaDataMapType& var_string_md,
306 IntegerMetaDataMapType& var_integer_md,
307 NumericMetaDataMapType& var_numeric_md,
308 Index m,
309 StringMetaDataMapType& con_string_md,
310 IntegerMetaDataMapType& con_integer_md,
311 NumericMetaDataMapType& con_numeric_md);
312
314 virtual bool get_bounds_info(Index n, Number* x_l, Number* x_u,
315 Index m, Number* g_l, Number* g_u);
316
320 virtual bool get_constraints_linearity(Index m,
321 LinearityType* const_types);
322
325 virtual bool get_starting_point(Index n, bool init_x, Number* x,
326 bool init_z, Number* z_L, Number* z_U,
327 Index m, bool init_lambda, Number* lambda);
328
330 virtual bool eval_f(Index n, const Number* x, bool new_x,
331 Number& obj_value);
332
335 virtual bool eval_grad_f(Index n, const Number* x, bool new_x,
336 Number* grad_f);
337
339 virtual bool eval_g(Index n, const Number* x, bool new_x,
340 Index m, Number* g);
341
345 virtual bool eval_jac_g(Index n, const Number* x, bool new_x,
346 Index m, Index nele_jac, Index* iRow,
347 Index *jCol, Number* values);
348
352 virtual bool eval_h(Index n, const Number* x, bool new_x,
353 Number obj_factor, Index m, const Number* lambda,
354 bool new_lambda, Index nele_hess, Index* iRow,
355 Index* jCol, Number* values);
356
359 virtual bool get_scaling_parameters(Number& obj_scaling,
360 bool& use_x_scaling, Index n,
361 Number* x_scaling,
362 bool& use_g_scaling, Index m,
363 Number* g_scaling);
365
368 virtual void finalize_solution(SolverReturn status,
369 Index n, const Number* x, const Number* z_L, const Number* z_U,
370 Index m, const Number* g, const Number* lambda,
371 Number obj_value,
372 const IpoptData* ip_data,
373 IpoptCalculatedQuantities* ip_cq);
375
378 virtual Index get_number_of_nonlinear_variables();
379 virtual bool get_list_of_nonlinear_variables(Index num_nonlin_vars,
380 Index* pos_nonlin_vars);
382
383
387 ASL_pfgh* AmplSolverObject()
388 {
389 return asl_;
390 }
391
395 void write_solution_file(const std::string& message) const;
396
402 void get_discrete_info(Index& nlvb_,
403 Index& nlvbi_,
404 Index& nlvc_,
405 Index& nlvci_,
406 Index& nlvo_,
407 Index& nlvoi_,
408 Index& nbv_,
409 Index& niv_) const;
411
417 void set_active_objective(Index obj_no);
418
424 void set_string_metadata_for_var(std::string tag, std::vector<std::string> meta_data)
425 {
426 var_string_md_[tag] = meta_data;
427 }
428
429 void set_integer_metadata_for_var(std::string tag, std::vector<Index> meta_data)
430 {
431 var_integer_md_[tag] = meta_data;
432 }
433
434 void set_numeric_metadata_for_var(std::string tag, std::vector<Number> meta_data)
435 {
436 var_numeric_md_[tag] = meta_data;
437 }
438
439 void set_string_metadata_for_con(std::string tag, std::vector<std::string> meta_data)
440 {
441 con_string_md_[tag] = meta_data;
442 }
443
444 void set_integer_metadata_for_con(std::string tag, std::vector<Index> meta_data)
445 {
446 con_integer_md_[tag] = meta_data;
447 }
448
449 void set_numeric_metadata_for_con(std::string tag, std::vector<Number> meta_data)
450 {
451 con_numeric_md_[tag] = meta_data;
452 }
454
456 SmartPtr<AmplSuffixHandler> get_suffix_handler()
457 {
458 return suffix_handler_;
459 }
460
461 private:
471 AmplTNLP();
472
474 AmplTNLP(const AmplTNLP&);
475
477 void operator=(const AmplTNLP&);
479
481 SmartPtr<const Journalist> jnlst_;
482
484 ASL_pfgh* asl_;
485
487 double obj_sign_;
488
491 Index nz_h_full_; // number of nonzeros in the full_x hessian
492 /* the rest of the problem size data is available easily through the ampl variables */
494
498 Number* x_sol_;
499 Number* z_L_sol_;
500 Number* z_U_sol_;
501 Number* g_sol_;
502 Number* lambda_sol_;
503 Number obj_sol_;
505
511 bool objval_called_with_current_x_;
515 bool conval_called_with_current_x_;
517 bool hesset_called_;
519 bool set_active_objective_called_;
521
523 void* Oinfo_ptr_;
524
526 void* nerror_;
527
529 SmartPtr<AmplSuffixHandler> suffix_handler_;
530
532 bool internal_objval(const Number* x, Number& obj_val);
533
535 bool internal_conval(const Number* x, Index m, Number* g=NULL);
536
539 bool apply_new_x(bool new_x, Index n, const Number* x);
540
544 char* get_options(const SmartPtr<OptionsList>& options,
545 SmartPtr<AmplOptionsList>& ampl_options_list,
546 const char* ampl_option_string,
547 const char* ampl_invokation_string,
548 const char* ampl_banner_string, char**& argv);
549
551 bool nerror_ok(void* nerror);
552
554 void call_hesset();
555
557 StringMetaDataMapType var_string_md_;
558 IntegerMetaDataMapType var_integer_md_;
559 NumericMetaDataMapType var_numeric_md_;
560 StringMetaDataMapType con_string_md_;
561 IntegerMetaDataMapType con_integer_md_;
562 NumericMetaDataMapType con_numeric_md_;
563 };
564
565
566
567 } // namespace Ipopt
568
569 #endif
Ipopt::AmplOptionsList::AmplOption::ipopt_option_name_
const std::string ipopt_option_name_
Definition: AmplTNLP.hpp:158
Ipopt::TNLP::NumericMetaDataMapType
std::map< std::string, std::vector< Number > > NumericMetaDataMapType
Definition: IpTNLP.hpp:86
Ipopt::AmplTNLP::con_string_md_
StringMetaDataMapType con_string_md_
Definition: AmplTNLP.hpp:560
Ipopt::AmplSuffixHandler::~AmplSuffixHandler
~AmplSuffixHandler()
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
Ipopt::AmplTNLP::get_number_of_nonlinear_variables
virtual Index get_number_of_nonlinear_variables()
Ipopt::AmplTNLP::internal_objval
bool internal_objval(const Number *x, Number &obj_val)
Make the objective call to ampl.
Ipopt::AmplTNLP::get_suffix_handler
SmartPtr< AmplSuffixHandler > get_suffix_handler()
Method for returning the suffix handler.
Definition: AmplTNLP.hpp:456
Ipopt::AmplOptionsList::PrivatInfo::PrivatInfo
PrivatInfo(const std::string ipopt_name, SmartPtr< OptionsList > options, SmartPtr< const Journalist > jnlst, void **nerror=NULL)
Definition: AmplTNLP.hpp:166
Ipopt::AmplSuffixHandler
Definition: AmplTNLP.hpp:27
Ipopt::IpoptCalculatedQuantities
Class for all IPOPT specific calculated quantities.
Definition: IpIpoptCalculatedQuantities.hpp:81
IpUtils.hpp
index_style
Number Number Index Number Number Index Index Index index_style
indexing style for iRow &amp; jCol, 0 for C style, 1 for Fortran style
Definition: IpStdCInterface.h:137
Ipopt::AmplTNLP::nerror_
void * nerror_
nerror flag passed to ampl calls - set to NULL to halt on error
Definition: AmplTNLP.hpp:526
Ipopt::AmplTNLP::DECLARE_STD_EXCEPTION
DECLARE_STD_EXCEPTION(NONPOSITIVE_SCALING_FACTOR)
Exceptions.
Ipopt::AmplOptionsList::WS_Option
Definition: AmplTNLP.hpp:109
Ipopt::AmplOptionsList::Keywords
void * Keywords(const SmartPtr< OptionsList > &options, SmartPtr< const Journalist > jnlst, void **nerror)
ASL keywords list for the stored options.
Ipopt::AmplOptionsList::NumberOfAmplOptions
Index NumberOfAmplOptions()
Number of AMPL Options.
Definition: AmplTNLP.hpp:222
m
Number Number Index m
Number of constraints.
Definition: IpStdCInterface.h:137
Ipopt::AmplOptionsList::PrintLatex
void PrintLatex(SmartPtr< const Journalist > jnlst)
Ipopt::AmplTNLP::get_starting_point
virtual bool get_starting_point(Index n, bool init_x, Number *x, bool init_z, Number *z_L, Number *z_U, Index m, bool init_lambda, Number *lambda)
provides a starting point for the nlp variables.
Ipopt::AmplTNLP::set_numeric_metadata_for_var
void set_numeric_metadata_for_var(std::string tag, std::vector< Number > meta_data)
Definition: AmplTNLP.hpp:434
Ipopt::AmplTNLP::Oinfo_ptr_
void * Oinfo_ptr_
Pointer to the Oinfo structure.
Definition: AmplTNLP.hpp:523
Ipopt::AmplSuffixHandler::AddAvailableSuffix
void AddAvailableSuffix(std::string suffix_string, Suffix_Source source, Suffix_Type type)
Definition: AmplTNLP.hpp:48
Ipopt::AmplTNLP::get_discrete_info
void get_discrete_info(Index &nlvb_, Index &nlvbi_, Index &nlvc_, Index &nlvci_, Index &nlvo_, Index &nlvoi_, Index &nbv_, Index &niv_) const
ampl orders the variables like (continuous, binary, integer).
g
Number Number * g
Values of constraint at final point (output only - ignored if set to NULL)
Definition: IpStdCInterface.h:238
Ipopt::AmplSuffixHandler::Variable_Source
Definition: AmplTNLP.hpp:42
Ipopt::AmplOptionsList::PrivatInfo::Jnlst
const SmartPtr< const Journalist > & Jnlst() const
Definition: AmplTNLP.hpp:184
Ipopt::AmplSuffixHandler::AmplSuffixHandler
AmplSuffixHandler()
Ipopt::AmplOptionsList::PrivatInfo::ipopt_name_
const std::string ipopt_name_
Definition: AmplTNLP.hpp:193
Ipopt::AmplTNLP::get_list_of_nonlinear_variables
virtual bool get_list_of_nonlinear_variables(Index num_nonlin_vars, Index *pos_nonlin_vars)
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::AmplSuffixHandler::Constraint_Source
Definition: AmplTNLP.hpp:43
Ipopt::AmplTNLP::set_active_objective_called_
bool set_active_objective_called_
true when set_active_objective has been called
Definition: AmplTNLP.hpp:519
Ipopt::AmplTNLP::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::AmplTNLP::~AmplTNLP
virtual ~AmplTNLP()
Default destructor.
Ipopt::AmplSuffixHandler::Number_Type
Definition: AmplTNLP.hpp:37
Ipopt::AmplTNLP::set_integer_metadata_for_con
void set_integer_metadata_for_con(std::string tag, std::vector< Index > meta_data)
Definition: AmplTNLP.hpp:444
obj_val
Number Number Number * obj_val
Final value of objective function (output only - ignored if set to NULL)
Definition: IpStdCInterface.h:238
Ipopt::AmplTNLP::nerror_ok
bool nerror_ok(void *nerror)
returns true if the ampl nerror code is ok
Ipopt::AmplTNLP::asl_
ASL_pfgh * asl_
pointer to the main ASL structure
Definition: AmplTNLP.hpp:484
Ipopt::AmplTNLP::hesset_called_
bool hesset_called_
true when we have called hesset
Definition: AmplTNLP.hpp:517
Ipopt::AmplTNLP::conval_called_with_current_x_
bool conval_called_with_current_x_
true when the constraint values have been calculated with the current x, set to false in apply_new_x...
Definition: AmplTNLP.hpp:515
Ipopt::AmplSuffixHandler::GetNumberSuffixValues
const Number * GetNumberSuffixValues(std::string suffix_string, Suffix_Source source) const
Ipopt::AmplSuffixHandler::Problem_Source
Definition: AmplTNLP.hpp:45
Ipopt::AmplOptionsList::AmplOption::Type
AmplOptionType Type() const
Definition: AmplTNLP.hpp:131
Ipopt::AmplTNLP::obj_sign_
double obj_sign_
Sign of the objective fn (1 for min, -1 for max)
Definition: AmplTNLP.hpp:487
Ipopt::AmplTNLP::set_integer_metadata_for_var
void set_integer_metadata_for_var(std::string tag, std::vector< Index > meta_data)
Definition: AmplTNLP.hpp:429
Ipopt::AmplTNLP::con_integer_md_
IntegerMetaDataMapType con_integer_md_
Definition: AmplTNLP.hpp:561
Ipopt::TNLP::LinearityType
LinearityType
Type of the constraints.
Definition: IpTNLP.hpp:54
Ipopt::AmplOptionsList::AmplOption::IpoptOptionName
const std::string & IpoptOptionName() const
Definition: AmplTNLP.hpp:127
Ipopt::AmplOptionsList::AmplOption::AmplOption
AmplOption()
Default Constructor.
Ipopt::AmplOptionsList::MakeValidLatexString
void MakeValidLatexString(std::string source, std::string &dest) const
Ipopt::AmplOptionsList::operator=
void operator=(const AmplOptionsList &)
Overloaded Equals Operator.
Ipopt::AmplTNLP::objval_called_with_current_x_
bool objval_called_with_current_x_
true when the objective value has been calculated with the current x, set to false in apply_new_x...
Definition: AmplTNLP.hpp:511
Ipopt::AmplOptionsList::PrivatInfo::Options
const SmartPtr< OptionsList > & Options() const
Definition: AmplTNLP.hpp:180
Ipopt::AmplTNLP::set_string_metadata_for_con
void set_string_metadata_for_con(std::string tag, std::vector< std::string > meta_data)
Definition: AmplTNLP.hpp:439
Ipopt::AmplOptionsList::HaltOnError_Option
Definition: AmplTNLP.hpp:110
Ipopt::AmplTNLP::eval_grad_f
virtual bool eval_grad_f(Index n, const Number *x, bool new_x, Number *grad_f)
evaluates the gradient of the objective for the nlp.
Ipopt::AmplSuffixHandler::operator=
void operator=(const AmplSuffixHandler &)
Overloaded Equals Operator.
Ipopt::AmplTNLP::lambda_sol_
Number * lambda_sol_
Definition: AmplTNLP.hpp:502
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::ReferencedObject
ReferencedObject class.
Definition: IpReferenced.hpp:174
Ipopt::AmplTNLP::get_scaling_parameters
virtual bool get_scaling_parameters(Number &obj_scaling, bool &use_x_scaling, Index n, Number *x_scaling, bool &use_g_scaling, Index m, Number *g_scaling)
retrieve the scaling parameters for the variables, objective function, and constraints.
Ipopt::AmplOptionsList::AmplOption
Ampl Option class, contains name, type and description for an AMPL option.
Definition: AmplTNLP.hpp:115
Ipopt::AmplOptionsList::PrivatInfo::jnlst_
const SmartPtr< const Journalist > jnlst_
Definition: AmplTNLP.hpp:195
Ipopt::SolverReturn
SolverReturn
enum for the return from the optimize algorithm (obviously we need to add more)
Definition: IpAlgTypes.hpp:22
Ipopt::AmplOptionsList::nkeywds_
Index nkeywds_
Number of entries stored in keywds_.
Definition: AmplTNLP.hpp:265
Ipopt::AmplTNLP::AmplSolverObject
ASL_pfgh * AmplSolverObject()
Return the ampl solver object (ASL*)
Definition: AmplTNLP.hpp:387
Ipopt::AmplTNLP::get_constraints_linearity
virtual bool get_constraints_linearity(Index m, LinearityType *const_types)
Returns the constraint linearity.
Ipopt::AmplOptionsList::Integer_Option
Definition: AmplTNLP.hpp:108
Ipopt::AmplTNLP::get_options
char * get_options(const SmartPtr< OptionsList > &options, SmartPtr< AmplOptionsList > &ampl_options_list, const char *ampl_option_string, const char *ampl_invokation_string, const char *ampl_banner_string, char **&argv)
Method for obtaining the name of the NL file and the options set from AMPL.
Ipopt::AmplOptionsList::~AmplOptionsList
~AmplOptionsList()
Destructor.
nele_jac
Number Number Index Number Number Index nele_jac
Number of non-zero elements in constraint Jacobian.
Definition: IpStdCInterface.h:137
Ipopt::AmplOptionsList::String_Option
Definition: AmplTNLP.hpp:106
Ipopt::AmplTNLP::get_nlp_info
virtual bool get_nlp_info(Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style)
returns dimensions of the nlp.
Ipopt::AmplOptionsList::AmplOption::description_
char * description_
Definition: AmplTNLP.hpp:160
Ipopt::AmplTNLP::var_integer_md_
IntegerMetaDataMapType var_integer_md_
Definition: AmplTNLP.hpp:558
Ipopt::AmplSuffixHandler::suffix_ids_
std::vector< std::string > suffix_ids_
Definition: AmplTNLP.hpp:87
Ipopt::AmplSuffixHandler::suffix_types_
std::vector< Suffix_Type > suffix_types_
Definition: AmplTNLP.hpp:88
Ipopt::AmplTNLP::nz_h_full_
Index nz_h_full_
Definition: AmplTNLP.hpp:491
Ipopt::AmplOptionsList::AmplOptionType
AmplOptionType
Definition: AmplTNLP.hpp:105
Ipopt::AmplSuffixHandler::PrepareAmplForSuffixes
void PrepareAmplForSuffixes(ASL_pfgh *asl)
Method called by AmplTNLP to prepare the asl for the suffixes.
Ipopt::AmplOptionsList::PrivatInfo::NError
void ** NError()
Definition: AmplTNLP.hpp:188
Ipopt::IpoptData
Class to organize all the data required by the algorithm.
Definition: IpIpoptData.hpp:83
Ipopt::AmplOptionsList::AddAmplOption
void AddAmplOption(const std::string ampl_option_name, const std::string ipopt_option_name, AmplOptionsList::AmplOptionType type, const std::string description)
Adding a new AMPL Option.
Definition: AmplTNLP.hpp:211
Ipopt::AmplSuffixHandler::Suffix_Source
Suffix_Source
Definition: AmplTNLP.hpp:40
Ipopt::AmplTNLP::z_U_sol_
Number * z_U_sol_
Definition: AmplTNLP.hpp:500
Ipopt::AmplSuffixHandler::suftab_
SufDecl * suftab_
Definition: AmplTNLP.hpp:85
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::AmplTNLP::jnlst_
SmartPtr< const Journalist > jnlst_
Journlist.
Definition: AmplTNLP.hpp:481
Ipopt::AmplSuffixHandler::asl_
ASL_pfgh * asl_
Definition: AmplTNLP.hpp:83
Ipopt::AmplOptionsList::PrivatInfo::IpoptName
const std::string & IpoptName() const
Definition: AmplTNLP.hpp:176
Ipopt::AmplTNLP::set_numeric_metadata_for_con
void set_numeric_metadata_for_con(std::string tag, std::vector< Number > meta_data)
Definition: AmplTNLP.hpp:449
Ipopt::AmplOptionsList::PrivatInfo
Definition: AmplTNLP.hpp:163
Ipopt::AmplTNLP::eval_g
virtual bool eval_g(Index n, const Number *x, bool new_x, Index m, Number *g)
evaluates the constraint residuals for the nlp.
x_scaling
Number Number * x_scaling
Definition: IpStdCInterface.h:210
IpOptionsList.hpp
Ipopt::TNLP::IntegerMetaDataMapType
std::map< std::string, std::vector< Index > > IntegerMetaDataMapType
Definition: IpTNLP.hpp:85
Ipopt::AmplTNLP::call_hesset
void call_hesset()
calls hesset ASL function
Ipopt::AmplOptionsList::PrivatInfo::nerror_
void ** nerror_
Definition: AmplTNLP.hpp:196
IpTNLP.hpp
nele_hess
Number Number Index Number Number Index Index nele_hess
Number of non-zero elements in Hessian of Lagrangian.
Definition: IpStdCInterface.h:137
Ipopt::TNLP::StringMetaDataMapType
std::map< std::string, std::vector< std::string > > StringMetaDataMapType
Definition: IpTNLP.hpp:84
Ipopt::ConstPtr
SmartPtr< const U > ConstPtr(const SmartPtr< U > &smart_ptr)
Definition: IpSmartPtr.hpp:572
Ipopt::AmplTNLP::operator=
void operator=(const AmplTNLP &)
Overloaded Equals Operator.
Ipopt::AmplTNLP
Ampl Interface.
Definition: AmplTNLP.hpp:271
Ipopt::AmplOptionsList::keywds_
void * keywds_
pointer to the keywords
Definition: AmplTNLP.hpp:262
IpJournalist.hpp
Ipopt::AmplTNLP::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 ...
Ipopt::AmplTNLP::suffix_handler_
SmartPtr< AmplSuffixHandler > suffix_handler_
Suffix Handler.
Definition: AmplTNLP.hpp:529
Ipopt::AmplTNLP::set_string_metadata_for_var
void set_string_metadata_for_var(std::string tag, std::vector< std::string > meta_data)
Definition: AmplTNLP.hpp:424
Ipopt::AmplTNLP::eval_f
virtual bool eval_f(Index n, const Number *x, bool new_x, Number &obj_value)
evaluates the objective value for the nlp.
Ipopt::AmplOptionsList::AmplOption::Description
char * Description() const
Definition: AmplTNLP.hpp:135
Ipopt::AmplSuffixHandler::Suffix_Type
Suffix_Type
Definition: AmplTNLP.hpp:34
Ipopt::AmplTNLP::obj_sol_
Number obj_sol_
Definition: AmplTNLP.hpp:503
Ipopt::AmplTNLP::g_sol_
Number * g_sol_
Definition: AmplTNLP.hpp:501
Ipopt::AmplOptionsList
Class for storing a number of AMPL options that should be registered to the AMPL Solver library inter...
Definition: AmplTNLP.hpp:102
g_scaling
Number Number Number * g_scaling
Definition: IpStdCInterface.h:210
Ipopt::AmplOptionsList::AmplOptionsList
AmplOptionsList()
Default Constructor.
Definition: AmplTNLP.hpp:201
Ipopt::AmplTNLP::eval_jac_g
virtual bool eval_jac_g(Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values)
specifies the jacobian structure (if values is NULL) and evaluates the jacobian values (if values is ...
Ipopt::AmplTNLP::con_numeric_md_
NumericMetaDataMapType con_numeric_md_
Definition: AmplTNLP.hpp:562
Ipopt::AmplSuffixHandler::suffix_sources_
std::vector< Suffix_Source > suffix_sources_
Definition: AmplTNLP.hpp:89
Ipopt::AmplTNLP::AmplTNLP
AmplTNLP()
Default Constructor.
Ipopt::AmplTNLP::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::TNLP::IndexStyleEnum
IndexStyleEnum
overload this method to return the number of variables and constraints, and the number of non-zeros i...
Definition: IpTNLP.hpp:80
Ipopt::AmplTNLP::apply_new_x
bool apply_new_x(bool new_x, Index n, const Number *x)
Internal function to update the internal and ampl state if the x value changes.
Ipopt::AmplTNLP::internal_conval
bool internal_conval(const Number *x, Index m, Number *g=NULL)
Make the constraint call to ampl.
Ipopt::AmplOptionsList::AmplOption::operator=
void operator=(const AmplOption &)
Overloaded Equals Operator.
Ipopt::TNLP
Base class for all NLP&#39;s that use standard triplet matrix form and dense vectors. ...
Definition: IpTNLP.hpp:50
Ipopt::AmplSuffixHandler::Index_Type
Definition: AmplTNLP.hpp:36
Ipopt::AmplOptionsList::AmplOption::type_
const AmplOptionType type_
Definition: AmplTNLP.hpp:159
Ipopt::AmplOptionsList::Number_Option
Definition: AmplTNLP.hpp:107
Ipopt::AmplTNLP::z_L_sol_
Number * z_L_sol_
Definition: AmplTNLP.hpp:499
Ipopt::AmplTNLP::write_solution_file
void write_solution_file(const std::string &message) const
Write the solution file.
Ipopt::AmplTNLP::var_numeric_md_
NumericMetaDataMapType var_numeric_md_
Definition: AmplTNLP.hpp:559
Ipopt::AmplTNLP::set_active_objective
void set_active_objective(Index obj_no)
A method for setting the index of the objective function to be considered.
obj_scaling
Number obj_scaling
Definition: IpStdCInterface.h:210
Ipopt::AmplTNLP::x_sol_
Number * x_sol_
Solution Vectors.
Definition: AmplTNLP.hpp:498
Ipopt::AmplOptionsList::PrivatInfo::options_
const SmartPtr< OptionsList > options_
Definition: AmplTNLP.hpp:194
Ipopt::AmplSuffixHandler::GetIntegerSuffixValues
const Index * GetIntegerSuffixValues(std::string suffix_string, Suffix_Source source) const
Ipopt::AmplOptionsList::AmplOption::~AmplOption
~AmplOption()
Definition: AmplTNLP.hpp:122
Ipopt::AmplTNLP::var_string_md_
StringMetaDataMapType var_string_md_
meta data to pass on to TNLP
Definition: AmplTNLP.hpp:557
Ipopt::AmplTNLP::eval_h
virtual bool eval_h(Index n, const Number *x, bool new_x, Number obj_factor, Index m, const Number *lambda, bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values)
specifies the structure of the hessian of the lagrangian (if values is NULL) and evaluates the values...
Ipopt::AmplSuffixHandler::Objective_Source
Definition: AmplTNLP.hpp:44
Ipopt::AmplOptionsList::ampl_options_map_
std::map< std::string, SmartPtr< const AmplOption > > ampl_options_map_
map for storing registered AMPL options
Definition: AmplTNLP.hpp:256