12 #include <IpSmartPtr.hpp>
20 Ipopt::RegisteredOption *
b){
21 if(a->RegisteringCategory() == b->RegisteringCategory()){
22 return a->Name() < b->Name();
24 return a->RegisteringCategory() < b->RegisteringCategory();
31 std::string::const_iterator i = s.begin();
32 for(; i != s.end() ; i++){
46 std::string::const_iterator i = s.begin();
47 for(; i != s.end() ; i++){
62 static std::string
makeLatex(
double value){
63 std::string ret_val =
"$";
64 std::stringstream s_val;
67 unsigned int i = s_val.str().find_first_of(
'e');
68 if(i != s_val.str().size()){
69 ret_val += s_val.str().substr(0,i-1);
70 ret_val +=
" \\cdot 10^{";
71 ret_val += s_val.str().substr(i+1);
74 else ret_val += s_val.str();
84 else if(value <= - INT_MAX){
87 std::stringstream s_val;
89 ret_val = s_val.str();
98 else if(value <= - DBL_MAX){
101 std::stringstream s_val;
103 ret_val = s_val.str();
109 if(value ==
"DBL_MAX") {
110 std::stringstream s_val;
114 if(value ==
"-DBL_MAX") {
115 std::stringstream s_val;
119 if(value ==
"INT_MAX") {
120 std::stringstream s_val;
124 if(value ==
"-INT_MAX") {
125 std::stringstream s_val;
133 std::string ret_val =
"$";
134 std::stringstream s_val;
136 ret_val += s_val.str();
144 case Ipopt::OT_Number:
return 'F';
145 case Ipopt::OT_Integer:
return 'I';
146 case Ipopt::OT_String:
return 'S';
147 case Ipopt::OT_Unknown:
153 Ipopt::RegisteredOptionType T = opt->Type();
155 case Ipopt::OT_Number:
return makeString(opt->DefaultNumber());
156 case Ipopt::OT_Integer:
return makeString(opt->DefaultInteger());
157 case Ipopt::OT_String:
return (opt->DefaultString());
158 case Ipopt::OT_Unknown:
160 return "Unknown type of option";
166 std::map<std::string, Ipopt::SmartPtr<Ipopt::RegisteredOption> >
167 registered_options = RegisteredOptionsList();
171 of<<
"\\topcaption{\\label{tab:options} "<<std::endl
172 <<
"List of options and compatibility with the different algorithms."<<std::endl
174 of<<
"\\tablehead{\\hline "<<std::endl
175 <<
"Option & type & ";
177 of<<
"{\\tt B-BB} & {\\tt B-OA} & {\\tt B-QG} & {\\tt B-Hyb} & {\\tt B-Ecp} & {\\tt B-iFP} & {\\tt Cbc\\_Par} \\\\"<<std::endl
178 <<
"\\hline"<<std::endl
179 <<
"\\hline}"<<std::endl;
180 of<<
"\\tabletail{\\hline \\multicolumn{9}{|c|}{continued on next page}\\\\"
181 <<
"\\hline}"<<std::endl;
182 of<<
"\\tablelasttail{\\hline}"<<std::endl;
183 of<<
"{\\footnotesize"<<std::endl;
184 of<<
"\\begin{xtabular}{@{}|@{\\;}l@{\\;}|@{\\;}r@{\\;}|@{\\;}c@{\\;}|@{\\;}c@{\\;}|@{\\;}c@{\\;}|@{\\;}c@{\\;}|@{\\;}c@{\\;}|@{\\;}c@{\\;}|@{\\;}c@{\\;}|@{}}"<<std::endl;
187 std::list< Ipopt::RegisteredOption * > sortedOptions;
190 registered_options.begin(); i != registered_options.end() ; i++){
192 sortedOptions.push_back(
GetRawPtr(i->second));
196 std::string registeringCategory =
"";
197 for(std::list< Ipopt::RegisteredOption * >::iterator i = sortedOptions.begin();
198 i != sortedOptions.end() ; i++)
200 if((*i)->RegisteringCategory() != registeringCategory){
201 registeringCategory = (*i)->RegisteringCategory();
202 of<<
"\\hline"<<std::endl
203 <<
"\\multicolumn{1}{|c}{} & \\multicolumn{8}{l|}{"
204 <<registeringCategory<<
"}\\\\"<<std::endl
205 <<
"\\hline"<<std::endl;
220 of<<
"\\hline"<<std::endl
221 <<
"\\end{xtabular}"<<std::endl;
224 of<<
"\\begin{tablenotes}"<<std::endl
225 <<
"\\item $\\strut^*$ option is available"<<std::endl
226 <<
" for MILP subsolver (it is only passed if the {\\tt milp\\_subsolver} optio"<<std::endl
227 <<
" see Subsection \\ref{sec:milp_opt})."<<std::endl
228 <<
" \\item $\\strut^1$ disabled for stability reasons."<<std::endl
229 <<
"\\end{tablenotes}"<<std::endl
230 <<
"\\end{threeparttable} "<<std::endl;
237 std::list< Ipopt::RegisteredOption * >& sortedOptions)
239 std::map<std::string, Ipopt::SmartPtr<Ipopt::RegisteredOption> >
240 registered_options = RegisteredOptionsList();
243 registered_options.begin(); i != registered_options.end() ; i++){
245 sortedOptions.push_back(
GetRawPtr(i->second));
254 of<<
"<table border=\"1\">"<<std::endl;
256 std::list< Ipopt::RegisteredOption * > sortedOptions;
266 os<<
"<table border=\"1\">"<<std::endl;
267 os<<
"<tr>"<<std::endl;
268 os<<
"<td>Option </td>"<<std::endl;
269 os<<
"<td> type </td>"<<std::endl;
271 os<<
"<td> B-BB</td>"<<std::endl;
272 os<<
"<td> B-OA</td>"<<std::endl;
273 os<<
"<td> B-QG</td>"<<std::endl;
274 os<<
"<td> B-Hyb</td>"<<std::endl;
275 os<<
"</tr>"<<std::endl;
276 std::string registeringCategory =
"";
277 for(std::list< Ipopt::RegisteredOption * >::iterator i = options.begin();
278 i != options.end() ; i++)
280 if((*i)->RegisteringCategory() != registeringCategory){
281 registeringCategory = (*i)->RegisteringCategory();
284 <<
" <a href=\"#sec:"<<
makeSpaceLess(registeringCategory)<<
"\">"
285 <<registeringCategory<<
"</a> </th>"<<std::endl
286 <<
"</tr>"<<std::endl;
289 os<<
"<tr>"<<std::endl
290 <<
"<td>"<<((*i)->Name())<<
"</td>"<<std::endl
293 <<
"<td> "<<( (
isValidForBBB((*i)->Name()))?
'+' :
'-' )<<
"</td>"<<std::endl
294 <<
"<td>"<<( (
isValidForBOA((*i)->Name()))?
'+' :
'-' )<<
"</td>"<<std::endl
295 <<
"<td>"<<( (
isValidForBQG((*i)->Name()))?
'+' :
'-' )<<
"</td>"<<std::endl
296 <<
"<td>"<<( (
isValidForHybrid((*i)->Name()))?
'+' :
'-' )<<
"</td>"<<std::endl
297 <<
"</tr>"<<std::endl;
300 os<<
"</tr>"<<std::endl
301 <<
"</table>"<<std::endl;
307 std::list< Ipopt::RegisteredOption * > options;
309 os<<
"\\latexhtml{}{"<<std::endl;
310 os<<
"\\HCode{"<<std::endl;
312 os<<
"}\n}"<<std::endl;
315 Ipopt::Journalist jnlst;
317 J->SetOutputStream(&os);
318 J->SetPrintLevel(Ipopt::J_DOCUMENTATION, Ipopt::J_SUMMARY);
321 std::string registeringCategory =
"";
322 for(std::list< Ipopt::RegisteredOption * >::iterator i = options.begin();
323 i != options.end() ; i++)
325 if((*i)->RegisteringCategory() != registeringCategory){
326 registeringCategory = (*i)->RegisteringCategory();
327 os<<
"\\subsection{"<<registeringCategory<<
"}"<<std::endl;
328 os<<
"\\label{sec:"<<
makeSpaceLess(registeringCategory)<<
"}"<<std::endl;
329 os<<
"\\htmlanchor{sec:"<<
makeSpaceLess(registeringCategory)<<
"}"<<std::endl;
332 (*i)->OutputLatexDescription(jnlst);
339 std::list< Ipopt::RegisteredOption * > options;
343 Ipopt::Journalist jnlst;
345 J->SetOutputStream(&os);
346 J->SetPrintLevel(Ipopt::J_DOCUMENTATION, Ipopt::J_SUMMARY);
349 std::string registeringCategory =
"";
350 for(std::list< Ipopt::RegisteredOption * >::iterator i = options.begin();
351 i != options.end() ; i++)
353 if((*i)->RegisteringCategory() != registeringCategory){
354 registeringCategory = (*i)->RegisteringCategory();
355 os<<std::endl<<
"# registering category: "<<registeringCategory<<std::endl<<std::endl;
358 os.setf(std::ios::left);
360 os<<(*i)->Name()<<
" ";
363 os<<(*i)->ShortDescription();
static std::string makeString(int value)
void fint fint fint real * a
void writeHtmlOptionsTable(std::ostream &of, ExtraCategoriesInfo which)
Output html table of options.
static std::string makeSpaceLess(const std::string &s)
bool isValidForBBB(const std::string &option)
Say if option is valid for pure branch-and-bound.
bool isValidForHybrid(const std::string &option)
Say if option is valid for hybrid.
bool isValidForCbc(const std::string &option)
Say if option is valid for Cbc.
bool isValidForBiFP(const std::string &option)
Say if option is valid for B-iFP.
static char OptionType2Char(const Ipopt::RegisteredOptionType &T)
bool operator()(Ipopt::RegisteredOption *a, Ipopt::RegisteredOption *b)
void chooseOptions(ExtraCategoriesInfo which, std::list< Ipopt::RegisteredOption * > &options)
Output Latex table of options.
void fint fint fint fint fint fint fint fint fint fint real real real real real real real real * s
U * GetRawPtr(const OSSmartPtr< U > &smart_ptr)
bool isValidForBEcp(const std::string &option)
Say if option is valid for B-Ecp.
bool isValidForBQG(const std::string &option)
Say if option is valid for QuesadaGrossmann.
static std::string makeNumber(std::string value)
bool isValidForBOA(const std::string &option)
Say if option is valid for Outer approximation.
static std::string makeLatex(const std::string &s)
void writeLatexHtmlDoc(std::ostream &of, ExtraCategoriesInfo which)
Output Latex/Html ooptions documentation.
ExtraCategoriesInfo categoriesInfo(const std::string &s)
Get info about what a category is taking care of (e.g., Ipopt, Bonmin, FilterSQP,...) .
static std::string defaultAsString(Ipopt::SmartPtr< Ipopt::RegisteredOption > opt)
void writeBonminOpt(std::ostream &os, ExtraCategoriesInfo which)
Ouptut a bonmin.opt file with options default values and short descriptions.
void writeLatexOptionsTable(std::ostream &of, ExtraCategoriesInfo which)
Output Latex table of options.