Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IpRegOptions.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2007 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpRegOptions.hpp 2189 2013-03-31 15:06:11Z stefan $
6 //
7 // Authors: Carl Laird, Andreas Waechter IBM 2005-06-18
8
9 #ifndef __IPREGOPTIONS_HPP__
10 #define __IPREGOPTIONS_HPP__
11
12 #include "IpUtils.hpp"
13 #include "IpReferenced.hpp"
14 #include "IpException.hpp"
15 #include "IpSmartPtr.hpp"
16
17 #include <map>
18
19 namespace Ipopt
20 {
21
22 enum RegisteredOptionType
23 {
24 OT_Number,
25 OT_Integer,
26 OT_String,
27 OT_Unknown
28 };
29
33 class RegisteredOption : public ReferencedObject
34 {
35 public:
37 class string_entry
38 {
39 public:
40 string_entry(const std::string& value, const std::string& description)
41 : value_(value), description_(description)
42 {}
43 std::string value_;
44 std::string description_;
45 };
46
49 RegisteredOption(Index counter)
50 :
51 type_(OT_Unknown),
52 has_lower_(false),
53 has_upper_(false),
54 counter_(counter)
55 {}
56
57 RegisteredOption(const std::string& name,
58 const std::string& short_description,
59 const std::string& long_description,
60 const std::string& registering_category,
61 Index counter)
62 :
63 name_(name),
64 short_description_(short_description),
65 long_description_(long_description),
66 registering_category_(registering_category),
67 type_(OT_Unknown),
68 has_lower_(false),
69 has_upper_(false),
70 counter_(counter)
71 {}
72
73 RegisteredOption(const RegisteredOption& copy)
74 :
75 name_(copy.name_),
76 short_description_(copy.short_description_),
77 long_description_(copy.long_description_),
78 registering_category_(copy.registering_category_),
79 type_(copy.type_),
80 has_lower_(copy.has_lower_),
81 lower_(copy.lower_),
82 has_upper_(copy.has_upper_),
83 upper_(copy.upper_),
84 valid_strings_(copy.valid_strings_),
85 counter_(copy.counter_)
86 {}
87
88 virtual ~RegisteredOption()
89 {}
91
92 DECLARE_STD_EXCEPTION(ERROR_CONVERTING_STRING_TO_ENUM);
93
97 virtual const std::string& Name() const
98 {
99 return name_;
100 }
102 virtual void SetName(const std::string& name)
103 {
104 name_ = name;
105 }
107 virtual const std::string& ShortDescription() const
108 {
109 return short_description_;
110 }
112 virtual const std::string& LongDescription() const
113 {
114 return long_description_;
115 }
117 virtual void SetShortDescription(const std::string& short_description)
118 {
119 short_description_ = short_description;
120 }
122 virtual void SetLongDescription(const std::string& long_description)
123 {
124 long_description_ = long_description;
125 }
127 virtual const std::string& RegisteringCategory() const
128 {
129 return registering_category_;
130 }
132 virtual void SetRegisteringCategory(const std::string& registering_category)
133 {
134 registering_category_ = registering_category;
135 }
137 virtual const RegisteredOptionType& Type() const
138 {
139 return type_;
140 }
142 virtual void SetType(const RegisteredOptionType& type)
143 {
144 type_ = type;
145 }
147 virtual Index Counter() const
148 {
149 return counter_;
150 }
152
159 virtual const bool& HasLower() const
160 {
161 DBG_ASSERT(type_ == OT_Number || type_ == OT_Integer);
162 return has_lower_;
163 }
166 virtual const bool& LowerStrict() const
167 {
168 DBG_ASSERT(type_ == OT_Number && has_lower_ == true);
169 return lower_strict_;
170 }
173 virtual Number LowerNumber() const
174 {
175 DBG_ASSERT(has_lower_ == true && type_ == OT_Number);
176 return lower_;
177 }
180 virtual void SetLowerNumber(const Number& lower, const bool& strict)
181 {
182 DBG_ASSERT(type_ == OT_Number);
183 lower_ = lower;
184 lower_strict_ = strict, has_lower_ = true;
185 }
188 virtual Index LowerInteger() const
189 {
190 DBG_ASSERT(has_lower_ == true && type_ == OT_Integer);
191 return (Index)lower_;
192 }
195 virtual void SetLowerInteger(const Index& lower)
196 {
197 DBG_ASSERT(type_ == OT_Integer);
198 lower_ = (Number)lower;
199 has_lower_ = true;
200 }
203 virtual const bool& HasUpper() const
204 {
205 DBG_ASSERT(type_ == OT_Number || type_ == OT_Integer);
206 return has_upper_;
207 }
210 virtual const bool& UpperStrict() const
211 {
212 DBG_ASSERT(type_ == OT_Number && has_upper_ == true);
213 return upper_strict_;
214 }
217 virtual Number UpperNumber() const
218 {
219 DBG_ASSERT(has_upper_ == true && type_ == OT_Number);
220 return upper_;
221 }
224 virtual void SetUpperNumber(const Number& upper, const bool& strict)
225 {
226 DBG_ASSERT(type_ == OT_Number);
227 upper_ = upper;
228 upper_strict_ = strict;
229 has_upper_ = true;
230 }
233 virtual Index UpperInteger() const
234 {
235 DBG_ASSERT(has_upper_ == true && type_ == OT_Integer);
236 return (Index)upper_;
237 }
240 virtual void SetUpperInteger(const Index& upper)
241 {
242 DBG_ASSERT(type_ == OT_Integer);
243 upper_ = (Number)upper;
244 has_upper_ = true;
245 }
248 virtual void AddValidStringSetting(const std::string value,
249 const std::string description)
250 {
251 DBG_ASSERT(type_ == OT_String);
252 valid_strings_.push_back(string_entry(value, description));
253 }
255 virtual Number DefaultNumber() const
256 {
257 DBG_ASSERT(type_ == OT_Number);
258 return default_number_;
259 }
261 virtual void SetDefaultNumber(const Number& default_value)
262 {
263 DBG_ASSERT(type_ == OT_Number);
264 default_number_ = default_value;
265 }
267 virtual Index DefaultInteger() const
268 {
269 DBG_ASSERT(type_ == OT_Integer);
270 return (Index)default_number_;
271 }
274 virtual void SetDefaultInteger(const Index& default_value)
275 {
276 DBG_ASSERT(type_ == OT_Integer);
277 default_number_ = (Number)default_value;
278 }
280 virtual std::string DefaultString() const
281 {
282 DBG_ASSERT(type_ == OT_String);
283 return default_string_;
284 }
288 virtual Index DefaultStringAsEnum() const
289 {
290 DBG_ASSERT(type_ == OT_String);
291 return MapStringSettingToEnum(default_string_);
292 }
294 virtual void SetDefaultString(const std::string& default_value)
295 {
296 DBG_ASSERT(type_ == OT_String);
297 default_string_ = default_value;
298 }
300 virtual std::vector<string_entry> GetValidStrings() const
301 {
302 DBG_ASSERT(type_ == OT_String);
303 return valid_strings_;
304 }
307 virtual bool IsValidNumberSetting(const Number& value) const
308 {
309 DBG_ASSERT(type_ == OT_Number);
310 if (has_lower_ && ((lower_strict_ == true && value <= lower_) ||
311 (lower_strict_ == false && value < lower_))) {
312 return false;
313 }
314 if (has_upper_ && ((upper_strict_ == true && value >= upper_) ||
315 (upper_strict_ == false && value > upper_))) {
316 return false;
317 }
318 return true;
319 }
322 virtual bool IsValidIntegerSetting(const Index& value) const
323 {
324 DBG_ASSERT(type_ == OT_Integer);
325 if (has_lower_ && value < lower_) {
326 return false;
327 }
328 if (has_upper_ && value > upper_) {
329 return false;
330 }
331 return true;
332 }
335 virtual bool IsValidStringSetting(const std::string& value) const;
336
340 virtual std::string MapStringSetting(const std::string& value) const;
341
346 virtual Index MapStringSettingToEnum(const std::string& value) const;
348
350 virtual void OutputDescription(const Journalist& jnlst) const;
352 virtual void OutputShortDescription(const Journalist& jnlst) const;
354 virtual void OutputLatexDescription(const Journalist& jnlst) const;
355
356 private:
357 std::string name_;
358 std::string short_description_;
359 std::string long_description_;
360 std::string registering_category_;
361 RegisteredOptionType type_;
362
363 bool has_lower_;
364 bool lower_strict_;
365 Number lower_;
366 bool has_upper_;
367 bool upper_strict_;
368 Number upper_;
369 Number default_number_;
370
371 void MakeValidLatexString(std::string source, std::string& dest) const;
372 std::string MakeValidLatexNumber(Number value) const;
373
376 bool string_equal_insensitive(const std::string& s1,
377 const std::string& s2) const;
378
379 std::vector<string_entry> valid_strings_;
380 std::string default_string_;
381
384 const Index counter_;
385 };
386
390 class RegisteredOptions : public ReferencedObject
391 {
392 public:
396 RegisteredOptions()
397 :
398 next_counter_(0),
399 current_registering_category_("Uncategorized")
400 {}
401
403 virtual ~RegisteredOptions()
404 {}
406
407 DECLARE_STD_EXCEPTION(OPTION_ALREADY_REGISTERED);
408
413 virtual void SetRegisteringCategory(const std::string& registering_category)
414 {
415 current_registering_category_ = registering_category;
416 }
417
419 virtual std::string RegisteringCategory()
420 {
421 return current_registering_category_;
422 }
423
425 virtual void AddNumberOption(const std::string& name,
426 const std::string& short_description,
427 Number default_value,
428 const std::string& long_description="");
430 virtual void AddLowerBoundedNumberOption(const std::string& name,
431 const std::string& short_description,
432 Number lower, bool strict,
433 Number default_value,
434 const std::string& long_description="");
436 virtual void AddUpperBoundedNumberOption(const std::string& name,
437 const std::string& short_description,
438 Number upper, bool strict,
439 Number default_value,
440 const std::string& long_description="");
442 virtual void AddBoundedNumberOption(const std::string& name,
443 const std::string& short_description,
444 Number lower, bool lower_strict,
445 Number upper, bool upper_strict,
446 Number default_value,
447 const std::string& long_description="");
449 virtual void AddIntegerOption(const std::string& name,
450 const std::string& short_description,
451 Index default_value,
452 const std::string& long_description="");
454 virtual void AddLowerBoundedIntegerOption(const std::string& name,
455 const std::string& short_description,
456 Index lower, Index default_value,
457 const std::string& long_description="");
459 virtual void AddUpperBoundedIntegerOption(const std::string& name,
460 const std::string& short_description,
461 Index upper, Index default_value,
462 const std::string& long_description="");
464 virtual void AddBoundedIntegerOption(const std::string& name,
465 const std::string& short_description,
466 Index lower, Index upper,
467 Index default_value,
468 const std::string& long_description="");
469
471 virtual void AddStringOption(const std::string& name,
472 const std::string& short_description,
473 const std::string& default_value,
474 const std::vector<std::string>& settings,
475 const std::vector<std::string>& descriptions,
476 const std::string& long_description="");
479 virtual void AddStringOption1(const std::string& name,
480 const std::string& short_description,
481 const std::string& default_value,
482 const std::string& setting1,
483 const std::string& description1,
484 const std::string& long_description="");
485 virtual void AddStringOption2(const std::string& name,
486 const std::string& short_description,
487 const std::string& default_value,
488 const std::string& setting1,
489 const std::string& description1,
490 const std::string& setting2,
491 const std::string& description2,
492 const std::string& long_description="");
493 virtual void AddStringOption3(const std::string& name,
494 const std::string& short_description,
495 const std::string& default_value,
496 const std::string& setting1,
497 const std::string& description1,
498 const std::string& setting2,
499 const std::string& description2,
500 const std::string& setting3,
501 const std::string& description3,
502 const std::string& long_description="");
503 virtual void AddStringOption4(const std::string& name,
504 const std::string& short_description,
505 const std::string& default_value,
506 const std::string& setting1,
507 const std::string& description1,
508 const std::string& setting2,
509 const std::string& description2,
510 const std::string& setting3,
511 const std::string& description3,
512 const std::string& setting4,
513 const std::string& description4,
514 const std::string& long_description="");
515 virtual void AddStringOption5(const std::string& name,
516 const std::string& short_description,
517 const std::string& default_value,
518 const std::string& setting1,
519 const std::string& description1,
520 const std::string& setting2,
521 const std::string& description2,
522 const std::string& setting3,
523 const std::string& description3,
524 const std::string& setting4,
525 const std::string& description4,
526 const std::string& setting5,
527 const std::string& description5,
528 const std::string& long_description="");
529 virtual void AddStringOption6(const std::string& name,
530 const std::string& short_description,
531 const std::string& default_value,
532 const std::string& setting1,
533 const std::string& description1,
534 const std::string& setting2,
535 const std::string& description2,
536 const std::string& setting3,
537 const std::string& description3,
538 const std::string& setting4,
539 const std::string& description4,
540 const std::string& setting5,
541 const std::string& description5,
542 const std::string& setting6,
543 const std::string& description6,
544 const std::string& long_description="");
545 virtual void AddStringOption7(const std::string& name,
546 const std::string& short_description,
547 const std::string& default_value,
548 const std::string& setting1,
549 const std::string& description1,
550 const std::string& setting2,
551 const std::string& description2,
552 const std::string& setting3,
553 const std::string& description3,
554 const std::string& setting4,
555 const std::string& description4,
556 const std::string& setting5,
557 const std::string& description5,
558 const std::string& setting6,
559 const std::string& description6,
560 const std::string& setting7,
561 const std::string& description7,
562 const std::string& long_description="");
563 virtual void AddStringOption8(const std::string& name,
564 const std::string& short_description,
565 const std::string& default_value,
566 const std::string& setting1,
567 const std::string& description1,
568 const std::string& setting2,
569 const std::string& description2,
570 const std::string& setting3,
571 const std::string& description3,
572 const std::string& setting4,
573 const std::string& description4,
574 const std::string& setting5,
575 const std::string& description5,
576 const std::string& setting6,
577 const std::string& description6,
578 const std::string& setting7,
579 const std::string& description7,
580 const std::string& setting8,
581 const std::string& description8,
582 const std::string& long_description="");
583 virtual void AddStringOption9(const std::string& name,
584 const std::string& short_description,
585 const std::string& default_value,
586 const std::string& setting1,
587 const std::string& description1,
588 const std::string& setting2,
589 const std::string& description2,
590 const std::string& setting3,
591 const std::string& description3,
592 const std::string& setting4,
593 const std::string& description4,
594 const std::string& setting5,
595 const std::string& description5,
596 const std::string& setting6,
597 const std::string& description6,
598 const std::string& setting7,
599 const std::string& description7,
600 const std::string& setting8,
601 const std::string& description8,
602 const std::string& setting9,
603 const std::string& description9,
604 const std::string& long_description="");
605 virtual void AddStringOption10(const std::string& name,
606 const std::string& short_description,
607 const std::string& default_value,
608 const std::string& setting1,
609 const std::string& description1,
610 const std::string& setting2,
611 const std::string& description2,
612 const std::string& setting3,
613 const std::string& description3,
614 const std::string& setting4,
615 const std::string& description4,
616 const std::string& setting5,
617 const std::string& description5,
618 const std::string& setting6,
619 const std::string& description6,
620 const std::string& setting7,
621 const std::string& description7,
622 const std::string& setting8,
623 const std::string& description8,
624 const std::string& setting9,
625 const std::string& description9,
626 const std::string& setting10,
627 const std::string& description10,
628 const std::string& long_description="");
629
632 virtual SmartPtr<const RegisteredOption> GetOption(const std::string& name);
633
636 virtual void OutputOptionDocumentation(const Journalist& jnlst, std::list<std::string>& categories);
637
639 virtual void OutputLatexOptionDocumentation(const Journalist& jnlst, std::list<std::string>& categories);
641
642 typedef std::map<std::string, SmartPtr<RegisteredOption> > RegOptionsList;
643
646 virtual const RegOptionsList& RegisteredOptionsList () const
647 {
648 return registered_options_;
649 }
650
651 private:
652 Index next_counter_;
653 std::string current_registering_category_;
654 std::map<std::string, SmartPtr<RegisteredOption> > registered_options_;
655 };
656 } // namespace Ipopt
657
658 #endif
Ipopt::RegisteredOption::MapStringSettingToEnum
virtual Index MapStringSettingToEnum(const std::string &value) const
Map a user setting (allowing any case) to the index of the matched setting in the list of string sett...
Ipopt::RegisteredOption::IsValidIntegerSetting
virtual bool IsValidIntegerSetting(const Index &value) const
Check if the Integer value is a valid setting - can be called for OT_Integer.
Definition: IpRegOptions.hpp:322
Ipopt::RegisteredOption::string_entry::string_entry
string_entry(const std::string &value, const std::string &description)
Definition: IpRegOptions.hpp:40
Ipopt::RegisteredOptions::AddNumberOption
virtual void AddNumberOption(const std::string &name, const std::string &short_description, Number default_value, const std::string &long_description="")
Add a Number option (with no restrictions)
Ipopt::RegisteredOption::LongDescription
virtual const std::string & LongDescription() const
Get the long description.
Definition: IpRegOptions.hpp:112
Ipopt::RegisteredOptions::AddBoundedNumberOption
virtual void AddBoundedNumberOption(const std::string &name, const std::string &short_description, Number lower, bool lower_strict, Number upper, bool upper_strict, Number default_value, const std::string &long_description="")
Add a Number option (with a both bounds)
IpUtils.hpp
Ipopt::RegisteredOptions::SetRegisteringCategory
virtual void SetRegisteringCategory(const std::string &registering_category)
Methods to interact with registered options.
Definition: IpRegOptions.hpp:413
Ipopt::RegisteredOption::SetLowerInteger
virtual void SetLowerInteger(const Index &lower)
set the Integer version of the lower bound - can be called for OT_Integer
Definition: IpRegOptions.hpp:195
Ipopt::RegisteredOption::SetType
virtual void SetType(const RegisteredOptionType &type)
Get the Option&#39;s type.
Definition: IpRegOptions.hpp:142
Ipopt::RegisteredOption::registering_category_
std::string registering_category_
Definition: IpRegOptions.hpp:360
Ipopt::RegisteredOption::GetValidStrings
virtual std::vector< string_entry > GetValidStrings() const
get the valid string settings - can be called for OT_String
Definition: IpRegOptions.hpp:300
Ipopt::RegisteredOption::Counter
virtual Index Counter() const
Counter.
Definition: IpRegOptions.hpp:147
Ipopt::RegisteredOption::DefaultInteger
virtual Index DefaultInteger() const
get the default as an Integer - can be called for OT_Integer
Definition: IpRegOptions.hpp:267
Ipopt::RegisteredOption::SetDefaultInteger
virtual void SetDefaultInteger(const Index &default_value)
Set the default as an Integer - can be called for OT_Integer
Definition: IpRegOptions.hpp:274
Ipopt::RegisteredOptions::AddLowerBoundedNumberOption
virtual void AddLowerBoundedNumberOption(const std::string &name, const std::string &short_description, Number lower, bool strict, Number default_value, const std::string &long_description="")
Add a Number option (with a lower bound)
Ipopt::RegisteredOption::Name
virtual const std::string & Name() const
Standard Get / Set Methods.
Definition: IpRegOptions.hpp:97
Ipopt::RegisteredOption::lower_strict_
bool lower_strict_
Definition: IpRegOptions.hpp:364
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::RegisteredOption::OutputLatexDescription
virtual void OutputLatexDescription(const Journalist &jnlst) const
output a latex version
Ipopt::RegisteredOptions::AddStringOption1
virtual void AddStringOption1(const std::string &name, const std::string &short_description, const std::string &default_value, const std::string &setting1, const std::string &description1, const std::string &long_description="")
Methods that make adding string options with only a few entries easier.
Ipopt::RegisteredOption::UpperStrict
virtual const bool & UpperStrict() const
check if the upper bound is strict - can be called for OT_Number
Definition: IpRegOptions.hpp:210
Ipopt::RegisteredOptions::AddStringOption9
virtual void AddStringOption9(const std::string &name, const std::string &short_description, const std::string &default_value, const std::string &setting1, const std::string &description1, const std::string &setting2, const std::string &description2, const std::string &setting3, const std::string &description3, const std::string &setting4, const std::string &description4, const std::string &setting5, const std::string &description5, const std::string &setting6, const std::string &description6, const std::string &setting7, const std::string &description7, const std::string &setting8, const std::string &description8, const std::string &setting9, const std::string &description9, const std::string &long_description="")
Ipopt::RegisteredOption
Base class for registered options.
Definition: IpRegOptions.hpp:33
Ipopt::OT_Integer
Definition: IpRegOptions.hpp:25
Ipopt::RegisteredOption::OutputShortDescription
virtual void OutputShortDescription(const Journalist &jnlst) const
output a more concise version
Ipopt::RegisteredOption::UpperNumber
virtual Number UpperNumber() const
get the Number version of the upper bound - can be called for OT_Number
Definition: IpRegOptions.hpp:217
Ipopt::RegisteredOption::default_number_
Number default_number_
Definition: IpRegOptions.hpp:369
Ipopt::RegisteredOption::SetRegisteringCategory
virtual void SetRegisteringCategory(const std::string &registering_category)
Set the registering class.
Definition: IpRegOptions.hpp:132
Ipopt::RegisteredOption::string_entry::value_
std::string value_
Definition: IpRegOptions.hpp:43
Ipopt::RegisteredOption::RegisteringCategory
virtual const std::string & RegisteringCategory() const
Get the registering class.
Definition: IpRegOptions.hpp:127
Ipopt::OT_Number
Definition: IpRegOptions.hpp:24
Ipopt::RegisteredOption::MakeValidLatexString
void MakeValidLatexString(std::string source, std::string &dest) const
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::RegisteredOption::type_
RegisteredOptionType type_
Definition: IpRegOptions.hpp:361
Ipopt::ReferencedObject
ReferencedObject class.
Definition: IpReferenced.hpp:174
Ipopt::RegisteredOptions::~RegisteredOptions
virtual ~RegisteredOptions()
Standard Destructor.
Definition: IpRegOptions.hpp:403
Ipopt::RegisteredOption::upper_
Number upper_
Definition: IpRegOptions.hpp:368
Ipopt::RegisteredOption::DefaultStringAsEnum
virtual Index DefaultStringAsEnum() const
get the default as a string, but as the index of the string in the list - helps map from a string to ...
Definition: IpRegOptions.hpp:288
Ipopt::RegisteredOptions::DECLARE_STD_EXCEPTION
DECLARE_STD_EXCEPTION(OPTION_ALREADY_REGISTERED)
Ipopt::RegisteredOptions::AddBoundedIntegerOption
virtual void AddBoundedIntegerOption(const std::string &name, const std::string &short_description, Index lower, Index upper, Index default_value, const std::string &long_description="")
Add a Integer option (with a both bounds)
Ipopt::RegisteredOption::has_upper_
bool has_upper_
Definition: IpRegOptions.hpp:366
Ipopt::RegisteredOption::RegisteredOption
RegisteredOption(const std::string &name, const std::string &short_description, const std::string &long_description, const std::string &registering_category, Index counter)
Definition: IpRegOptions.hpp:57
Ipopt::RegisteredOption::string_entry::description_
std::string description_
Definition: IpRegOptions.hpp:44
Ipopt::RegisteredOption::ShortDescription
virtual const std::string & ShortDescription() const
Get the short description.
Definition: IpRegOptions.hpp:107
Ipopt::RegisteredOptions::RegisteringCategory
virtual std::string RegisteringCategory()
retrieve the value of the current registering category
Definition: IpRegOptions.hpp:419
Ipopt::RegisteredOptions::AddStringOption3
virtual void AddStringOption3(const std::string &name, const std::string &short_description, const std::string &default_value, const std::string &setting1, const std::string &description1, const std::string &setting2, const std::string &description2, const std::string &setting3, const std::string &description3, const std::string &long_description="")
Ipopt::RegisteredOption::has_lower_
bool has_lower_
Definition: IpRegOptions.hpp:363
Ipopt::RegisteredOption::SetLowerNumber
virtual void SetLowerNumber(const Number &lower, const bool &strict)
set the Number version of the lower bound - can be called for OT_Number
Definition: IpRegOptions.hpp:180
Ipopt::RegisteredOption::string_entry
class to hold the valid string settings for a string option
Definition: IpRegOptions.hpp:37
Ipopt::RegisteredOption::SetUpperInteger
virtual void SetUpperInteger(const Index &upper)
set the Integer version of the upper bound - can be called for OT_Integer
Definition: IpRegOptions.hpp:240
Ipopt::RegisteredOption::lower_
Number lower_
Definition: IpRegOptions.hpp:365
Ipopt::RegisteredOptions::AddStringOption10
virtual void AddStringOption10(const std::string &name, const std::string &short_description, const std::string &default_value, const std::string &setting1, const std::string &description1, const std::string &setting2, const std::string &description2, const std::string &setting3, const std::string &description3, const std::string &setting4, const std::string &description4, const std::string &setting5, const std::string &description5, const std::string &setting6, const std::string &description6, const std::string &setting7, const std::string &description7, const std::string &setting8, const std::string &description8, const std::string &setting9, const std::string &description9, const std::string &setting10, const std::string &description10, const std::string &long_description="")
Ipopt::RegisteredOptionType
RegisteredOptionType
Definition: IpRegOptions.hpp:22
Ipopt::RegisteredOption::SetDefaultString
virtual void SetDefaultString(const std::string &default_value)
Set the default as a string - can be called for OT_String.
Definition: IpRegOptions.hpp:294
Ipopt::RegisteredOptions::AddStringOption
virtual void AddStringOption(const std::string &name, const std::string &short_description, const std::string &default_value, const std::vector< std::string > &settings, const std::vector< std::string > &descriptions, const std::string &long_description="")
Add a String option (with no restrictions)
Ipopt::RegisteredOptions::AddStringOption6
virtual void AddStringOption6(const std::string &name, const std::string &short_description, const std::string &default_value, const std::string &setting1, const std::string &description1, const std::string &setting2, const std::string &description2, const std::string &setting3, const std::string &description3, const std::string &setting4, const std::string &description4, const std::string &setting5, const std::string &description5, const std::string &setting6, const std::string &description6, const std::string &long_description="")
Ipopt::RegisteredOption::LowerStrict
virtual const bool & LowerStrict() const
check if the lower bound is strict - can be called for OT_Number
Definition: IpRegOptions.hpp:166
Ipopt::RegisteredOption::counter_
const Index counter_
Has the information as how many-th option this one was registered.
Definition: IpRegOptions.hpp:384
Ipopt::RegisteredOptions::AddStringOption4
virtual void AddStringOption4(const std::string &name, const std::string &short_description, const std::string &default_value, const std::string &setting1, const std::string &description1, const std::string &setting2, const std::string &description2, const std::string &setting3, const std::string &description3, const std::string &setting4, const std::string &description4, const std::string &long_description="")
Ipopt::OT_Unknown
Definition: IpRegOptions.hpp:27
Ipopt::RegisteredOption::MakeValidLatexNumber
std::string MakeValidLatexNumber(Number value) const
Ipopt::RegisteredOptions::AddLowerBoundedIntegerOption
virtual void AddLowerBoundedIntegerOption(const std::string &name, const std::string &short_description, Index lower, Index default_value, const std::string &long_description="")
Add a Integer option (with a lower bound)
Ipopt::RegisteredOptions::RegisteredOptions
RegisteredOptions()
Constructors / Destructors.
Definition: IpRegOptions.hpp:396
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::RegisteredOption::name_
std::string name_
Definition: IpRegOptions.hpp:357
Ipopt::RegisteredOption::IsValidNumberSetting
virtual bool IsValidNumberSetting(const Number &value) const
Check if the Number value is a valid setting - can be called for OT_Number.
Definition: IpRegOptions.hpp:307
Ipopt::RegisteredOption::IsValidStringSetting
virtual bool IsValidStringSetting(const std::string &value) const
Check if the String value is a valid setting - can be called for OT_String.
Ipopt::RegisteredOptions::AddStringOption7
virtual void AddStringOption7(const std::string &name, const std::string &short_description, const std::string &default_value, const std::string &setting1, const std::string &description1, const std::string &setting2, const std::string &description2, const std::string &setting3, const std::string &description3, const std::string &setting4, const std::string &description4, const std::string &setting5, const std::string &description5, const std::string &setting6, const std::string &description6, const std::string &setting7, const std::string &description7, const std::string &long_description="")
Ipopt::RegisteredOptions::AddIntegerOption
virtual void AddIntegerOption(const std::string &name, const std::string &short_description, Index default_value, const std::string &long_description="")
Add a Integer option (with no restrictions)
IpReferenced.hpp
DBG_ASSERT
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
Ipopt::RegisteredOption::Type
virtual const RegisteredOptionType & Type() const
Get the Option&#39;s type.
Definition: IpRegOptions.hpp:137
Ipopt::RegisteredOptions::AddStringOption2
virtual void AddStringOption2(const std::string &name, const std::string &short_description, const std::string &default_value, const std::string &setting1, const std::string &description1, const std::string &setting2, const std::string &description2, const std::string &long_description="")
Ipopt::RegisteredOptions::RegisteredOptionsList
virtual const RegOptionsList & RegisteredOptionsList() const
Giving access to iteratable representation of the registered options.
Definition: IpRegOptions.hpp:646
Ipopt::RegisteredOption::RegisteredOption
RegisteredOption(Index counter)
Constructors / Destructors.
Definition: IpRegOptions.hpp:49
Ipopt::RegisteredOptions::current_registering_category_
std::string current_registering_category_
Definition: IpRegOptions.hpp:653
Ipopt::RegisteredOption::LowerNumber
virtual Number LowerNumber() const
get the Number version of the lower bound - can be called for OT_Number
Definition: IpRegOptions.hpp:173
Ipopt::RegisteredOptions::RegOptionsList
std::map< std::string, SmartPtr< RegisteredOption > > RegOptionsList
Definition: IpRegOptions.hpp:642
Ipopt::RegisteredOption::HasLower
virtual const bool & HasLower() const
check if the option has a lower bound - can be called for OT_Number &amp; OT_Integer
Definition: IpRegOptions.hpp:159
Ipopt::RegisteredOption::long_description_
std::string long_description_
Definition: IpRegOptions.hpp:359
Ipopt::RegisteredOption::SetUpperNumber
virtual void SetUpperNumber(const Number &upper, const bool &strict)
set the Number version of the upper bound - can be called for OT_Number
Definition: IpRegOptions.hpp:224
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:134
Ipopt::RegisteredOptions::OutputOptionDocumentation
virtual void OutputOptionDocumentation(const Journalist &jnlst, std::list< std::string > &categories)
Output documentation for the options - gives a description, etc.
Ipopt::RegisteredOption::default_string_
std::string default_string_
Definition: IpRegOptions.hpp:380
Ipopt::RegisteredOption::LowerInteger
virtual Index LowerInteger() const
get the Integer version of the lower bound can be called for OT_Integer
Definition: IpRegOptions.hpp:188
Ipopt::RegisteredOption::MapStringSetting
virtual std::string MapStringSetting(const std::string &value) const
Map a user setting (allowing any case) to the case used when the setting was registered.
Ipopt::RegisteredOption::short_description_
std::string short_description_
Definition: IpRegOptions.hpp:358
Ipopt::RegisteredOptions::AddUpperBoundedIntegerOption
virtual void AddUpperBoundedIntegerOption(const std::string &name, const std::string &short_description, Index upper, Index default_value, const std::string &long_description="")
Add a Integer option (with a upper bound)
Ipopt::RegisteredOption::DECLARE_STD_EXCEPTION
DECLARE_STD_EXCEPTION(ERROR_CONVERTING_STRING_TO_ENUM)
Ipopt::RegisteredOption::AddValidStringSetting
virtual void AddValidStringSetting(const std::string value, const std::string description)
method to add valid string entries - can be called for OT_String
Definition: IpRegOptions.hpp:248
Ipopt::RegisteredOptions::registered_options_
std::map< std::string, SmartPtr< RegisteredOption > > registered_options_
Definition: IpRegOptions.hpp:654
Ipopt::RegisteredOption::string_equal_insensitive
bool string_equal_insensitive(const std::string &s1, const std::string &s2) const
Compare two strings and return true if they are equal (case insensitive comparison) ...
Ipopt::OT_String
Definition: IpRegOptions.hpp:26
Ipopt::RegisteredOptions::AddStringOption8
virtual void AddStringOption8(const std::string &name, const std::string &short_description, const std::string &default_value, const std::string &setting1, const std::string &description1, const std::string &setting2, const std::string &description2, const std::string &setting3, const std::string &description3, const std::string &setting4, const std::string &description4, const std::string &setting5, const std::string &description5, const std::string &setting6, const std::string &description6, const std::string &setting7, const std::string &description7, const std::string &setting8, const std::string &description8, const std::string &long_description="")
Ipopt::RegisteredOption::SetLongDescription
virtual void SetLongDescription(const std::string &long_description)
Set the long description.
Definition: IpRegOptions.hpp:122
Ipopt::RegisteredOptions::GetOption
virtual SmartPtr< const RegisteredOption > GetOption(const std::string &name)
Get a registered option - this will return NULL if the option does not exist.
Ipopt::RegisteredOptions::AddUpperBoundedNumberOption
virtual void AddUpperBoundedNumberOption(const std::string &name, const std::string &short_description, Number upper, bool strict, Number default_value, const std::string &long_description="")
Add a Number option (with a upper bound)
Ipopt::RegisteredOption::RegisteredOption
RegisteredOption(const RegisteredOption &copy)
Definition: IpRegOptions.hpp:73
Ipopt::RegisteredOptions::AddStringOption5
virtual void AddStringOption5(const std::string &name, const std::string &short_description, const std::string &default_value, const std::string &setting1, const std::string &description1, const std::string &setting2, const std::string &description2, const std::string &setting3, const std::string &description3, const std::string &setting4, const std::string &description4, const std::string &setting5, const std::string &description5, const std::string &long_description="")
Ipopt::RegisteredOptions::OutputLatexOptionDocumentation
virtual void OutputLatexOptionDocumentation(const Journalist &jnlst, std::list< std::string > &categories)
Output documentation in Latex format to include in a latex file.
Ipopt::RegisteredOption::UpperInteger
virtual Index UpperInteger() const
get the Integer version of the upper bound - can be called for OT_Integer
Definition: IpRegOptions.hpp:233
Ipopt::RegisteredOption::SetDefaultNumber
virtual void SetDefaultNumber(const Number &default_value)
Set the default as a Number - can be called for OT_Number.
Definition: IpRegOptions.hpp:261
IpException.hpp
Ipopt::RegisteredOption::OutputDescription
virtual void OutputDescription(const Journalist &jnlst) const
output a description of the option
Ipopt::RegisteredOption::SetShortDescription
virtual void SetShortDescription(const std::string &short_description)
Set the short description.
Definition: IpRegOptions.hpp:117
Ipopt::RegisteredOption::valid_strings_
std::vector< string_entry > valid_strings_
Definition: IpRegOptions.hpp:379
Ipopt::RegisteredOption::SetName
virtual void SetName(const std::string &name)
Set the option&#39;s name (tag in the input file)
Definition: IpRegOptions.hpp:102
Ipopt::RegisteredOption::HasUpper
virtual const bool & HasUpper() const
check if the option has an upper bound - can be called for OT_Number &amp; OT_Integer ...
Definition: IpRegOptions.hpp:203
Ipopt::RegisteredOptions::next_counter_
Index next_counter_
Definition: IpRegOptions.hpp:652
IpSmartPtr.hpp
Ipopt::RegisteredOption::~RegisteredOption
virtual ~RegisteredOption()
Definition: IpRegOptions.hpp:88
Ipopt::RegisteredOption::DefaultNumber
virtual Number DefaultNumber() const
get the default as a Number - can be called for OT_Number
Definition: IpRegOptions.hpp:255
Ipopt::RegisteredOptions
Class for storing registered options.
Definition: IpRegOptions.hpp:390
Ipopt::RegisteredOption::upper_strict_
bool upper_strict_
Definition: IpRegOptions.hpp:367
Ipopt::RegisteredOption::DefaultString
virtual std::string DefaultString() const
get the default as a string - can be called for OT_String
Definition: IpRegOptions.hpp:280