Changeset 477


Ignore:
Timestamp:
Aug 23, 2005 1:54:58 PM (14 years ago)
Author:
claird
Message:

Reworked options:

  • Changed the order of options do they document better.
  • Changed SetValue? and GetValue? to SetStringValue? and GetStringValue?
  • Added an allow_clobber flag to options that defaults to true (set to false when options are read from PARAMS.DAT)
  • started the options documentation
  • Added options to the cpp example


Ran astyle to clean up the code.

Location:
branches/dev
Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/Algorithm/IpAlgBuilder.cpp

    r465 r477  
    5252  void AlgorithmBuilder::RegisterOptions(SmartPtr<RegisteredOptions> roptions)
    5353  {
     54    roptions->SetRegisteringCategory("Linear Solver");
    5455    roptions->AddStringOption3(
    5556      "linear_solver",
     
    7172      "Determines which method should be use to compute symmetric scaling "
    7273      "factors for the augmented system.");
     74
     75    roptions->SetRegisteringCategory("Mu Update");
    7376    roptions->AddStringOption2(
    7477      "mu_strategy",
     
    126129    SmartPtr<TSymScalingMethod> ScalingMethod;
    127130    std::string linear_system_scaling;
    128     options.GetValue("linear_system_scaling",
    129                      linear_system_scaling, prefix);
     131    options.GetStringValue("linear_system_scaling",
     132                           linear_system_scaling, prefix);
    130133    if (linear_system_scaling=="mc19") {
    131134#ifdef HAVE_MC19
     
    141144    SmartPtr<SparseSymLinearSolverInterface> SolverInterface;
    142145    std::string linear_solver;
    143     options.GetValue("linear_solver", linear_solver, prefix);
     146    options.GetStringValue("linear_solver", linear_solver, prefix);
    144147    if (linear_solver=="ma27") {
    145148#ifdef HAVE_MA27
     
    191194    bool warm_start_init_point;
    192195    std::string warm_start_option;
    193     options.GetValue("warm_start_init_point", warm_start_option, prefix);
     196    options.GetStringValue("warm_start_init_point", warm_start_option, prefix);
    194197    warm_start_init_point = (warm_start_option == "yes");
    195198
     
    224227    SmartPtr<MuUpdate> resto_MuUpdate;
    225228    std::string resto_smuupdate;
    226     options.GetValue("mu_strategy", resto_smuupdate, "resto."+prefix);
     229    options.GetStringValue("mu_strategy", resto_smuupdate, "resto."+prefix);
    227230
    228231    std::string resto_smuoracle;
    229232    std::string resto_sfixmuoracle;
    230233    if (resto_smuupdate=="adaptive" ) {
    231       options.GetValue("mu_oracle", resto_smuoracle, "resto."+prefix);
    232       options.GetValue("fixed_mu_oracle", resto_sfixmuoracle, "resto."+prefix);
     234      options.GetStringValue("mu_oracle", resto_smuoracle, "resto."+prefix);
     235      options.GetStringValue("fixed_mu_oracle", resto_sfixmuoracle, "resto."+prefix);
    233236    }
    234237
     
    304307    SmartPtr<MuUpdate> MuUpdate;
    305308    std::string smuupdate;
    306     options.GetValue("mu_strategy", smuupdate, prefix);
     309    options.GetStringValue("mu_strategy", smuupdate, prefix);
    307310    std::string smuoracle;
    308311    std::string sfixmuoracle;
    309312    if (smuupdate=="adaptive" ) {
    310       options.GetValue("mu_oracle", smuoracle, prefix);
    311       options.GetValue("fixed_mu_oracle", sfixmuoracle, prefix);
     313      options.GetStringValue("mu_oracle", smuoracle, prefix);
     314      options.GetStringValue("fixed_mu_oracle", sfixmuoracle, prefix);
    312315    }
    313316
  • branches/dev/Algorithm/IpAlgorithmRegOp.cpp

    r464 r477  
    3939    roptions->SetRegisteringCategory("Mu Update");
    4040    AdaptiveMuUpdate::RegisterOptions(roptions);
     41    roptions->SetRegisteringCategory("Initialization");
     42    DefaultIterateInitializer::RegisterOptions(roptions);
    4143    roptions->SetRegisteringCategory("Main Algorithm");
    4244    AlgorithmBuilder::RegisterOptions(roptions);
    43     roptions->SetRegisteringCategory("Initialization");
    44     DefaultIterateInitializer::RegisterOptions(roptions);
    4545    roptions->SetRegisteringCategory("Line Search");
    4646    FilterLineSearch::RegisterOptions(roptions);
    47     roptions->SetRegisteringCategory("Scaling");
     47    roptions->SetRegisteringCategory("NLP Scaling");
     48    StandardScalingBase::RegisterOptions(roptions);
     49    roptions->SetRegisteringCategory("NLP Scaling");
    4850    GradientScaling::RegisterOptions(roptions);
    4951    roptions->SetRegisteringCategory("Uncategorized");
    5052    IpoptAlgorithm::RegisterOptions(roptions);
    5153    roptions->SetRegisteringCategory("Uncategorized");
     54    IpoptData::RegisterOptions(roptions);
     55    roptions->SetRegisteringCategory("Uncategorized");
    5256    IpoptCalculatedQuantities::RegisterOptions(roptions);
    53     roptions->SetRegisteringCategory("Uncategorized");
    54     IpoptData::RegisterOptions(roptions);
    5557    roptions->SetRegisteringCategory("Mu Update");
    5658    MonotoneMuUpdate::RegisterOptions(roptions);
    57     roptions->SetRegisteringCategory("Scaling");
    58     StandardScalingBase::RegisterOptions(roptions);
    5959    roptions->SetRegisteringCategory("Convergence");
    6060    OptimalityErrorConvergenceCheck::RegisterOptions(roptions);
     
    6969    roptions->SetRegisteringCategory("Mu Update");
    7070    QualityFunctionMuOracle::RegisterOptions(roptions);
    71     roptions->SetRegisteringCategory("Convergence");
     71    roptions->SetRegisteringCategory("Restoration");
    7272    RestoFilterConvergenceCheck::RegisterOptions(roptions);
    7373    roptions->SetRegisteringCategory("Restoration");
    7474    RestoIpoptNLP::RegisterOptions(roptions);
    7575    roptions->SetRegisteringCategory("Uncategorized");
     76    roptions->SetRegisteringCategory("Restoration");
    7677    MinC_1NrmRestorationPhase::RegisterOptions(roptions);
    77     roptions->SetRegisteringCategory("Restoration");
     78    roptions->SetRegisteringCategory("Warm Start");
    7879    WarmStartIterateInitializer::RegisterOptions(roptions);
    79     roptions->SetRegisteringCategory("Initialization");
    8080  }
    8181
  • branches/dev/Algorithm/IpIpoptCalculatedQuantities.cpp

    r465 r477  
    142142  void IpoptCalculatedQuantities::RegisterOptions(SmartPtr<RegisteredOptions> roptions)
    143143  {
     144    roptions->SetRegisteringCategory("Convergence");
    144145    roptions->AddLowerBoundedNumberOption(
    145146      "s_max",
     
    147148      0.0, true, 100.0,
    148149      "(see paragraph after Eqn. (6) in the implementation paper)");
     150
     151    roptions->SetRegisteringCategory("NLP");
    149152    roptions->AddLowerBoundedNumberOption(
    150153      "kappa_d",
     
    152155      0.0, false, 1e-5,
    153156      "(see Section 3.7 in implementation paper)");
     157
     158    roptions->SetRegisteringCategory("Line Search");
    154159    roptions->AddLowerBoundedNumberOption(
    155160      "slack_move",
  • branches/dev/Algorithm/IpRestoMinC_1Nrm.cpp

    r465 r477  
    7676    // restoration phase is trigged by user option in first iteration
    7777    // of the restoration phase
    78     resto_options_->SetValue("resto.start_with_resto", "no");
     78    resto_options_->SetStringValue("resto.start_with_resto", "no");
    7979
    8080    count_restorations_ = 0;
  • branches/dev/Algorithm/LinearSolvers/IpLinearSolversRegOp.cpp

    r465 r477  
    1919  void RegisterOptions_LinearSolvers(const SmartPtr<RegisteredOptions>& roptions)
    2020  {
    21     roptions->SetRegisteringCategory("Linear Solver");
     21    roptions->SetRegisteringCategory("MA27 Linear Solver");
    2222#ifdef HAVE_MA27
    2323
  • branches/dev/Apps/AmplSolver/AmplTNLP.cpp

    r470 r477  
    679679      kw->info = (void*) pinfo;
    680680
    681       if (!pinfo->options->SetValue(kw->name, str_val)) {
     681      if (!pinfo->options->SetStringValue(kw->name, str_val)) {
    682682        pinfo->jnlst->Printf(J_ERROR, J_MAIN,
    683683                             "\nInvalid value for option %s.\n", kw->name);
  • branches/dev/Common/IpOptionsList.cpp

    r438 r477  
    3232{
    3333
    34   bool OptionsList::SetValue(const std::string& tag, const std::string& value)
     34  bool OptionsList::SetStringValue(const std::string& tag,
     35                                   const std::string& value,
     36                                   bool allow_clobber /* = true */)
    3537  {
    3638    if (IsValid(reg_options_)) {
     
    8284    }
    8385
    84     OptionsList::OptionValue optval(lowercase(value));
    85     options_[lowercase(tag)] = optval;
    86 
    87     return true;
    88   }
    89 
    90   bool OptionsList::SetNumericValue(const std::string& tag, Number value)
     86    if (will_allow_clobber(tag)) {
     87      OptionsList::OptionValue optval(lowercase(value), allow_clobber);
     88      options_[lowercase(tag)] = optval;
     89      return true;
     90    }
     91
     92    std::string msg = "Option: \"" + tag;
     93    msg += " ";
     94    msg += value;
     95    msg += "\" not taken because a value of \n\"" ;
     96    msg += options_[lowercase(tag)].GetValue();
     97    msg += "\" already exists and is set to disallow clobbering.\n\n";
     98    jnlst_->Printf(J_ERROR, J_MAIN, msg.c_str());
     99    return false;
     100  }
     101
     102  bool OptionsList::SetNumericValue(const std::string& tag, Number value,
     103                                    bool allow_clobber /* = true */)
    91104  {
    92105    char buffer[256];
     
    142155    }
    143156
    144     OptionsList::OptionValue optval(buffer);
    145     options_[lowercase(tag)] = optval;
    146 
    147     return true;
    148   }
    149 
    150   bool OptionsList::SetIntegerValue(const std::string& tag, Index value)
     157    if (will_allow_clobber(tag)) {
     158      OptionsList::OptionValue optval(buffer, allow_clobber);
     159      options_[lowercase(tag)] = optval;
     160      return true;
     161    }
     162
     163    std::string msg = "Option: \"" + tag;
     164    msg += " ";
     165    msg += buffer;
     166    msg += "\" not taken because a value of\n\"" ;
     167    msg += options_[lowercase(tag)].GetValue();
     168    msg += "\" already exists and is set to disallow clobbering.\n\n";
     169    jnlst_->Printf(J_ERROR, J_MAIN, msg.c_str());
     170    return false;
     171  }
     172
     173  bool OptionsList::SetIntegerValue(const std::string& tag, Index value,
     174                                    bool allow_clobber /* = true */)
    151175  {
    152176    char buffer[256];
     
    202226    }
    203227
    204     OptionsList::OptionValue optval(buffer);
    205     options_[lowercase(tag)] = optval;
    206 
    207     return true;
    208   }
    209 
    210   bool OptionsList::GetValue(const std::string& tag, std::string& value,
    211                              const std::string& prefix) const
     228    if (will_allow_clobber(tag)) {
     229      OptionsList::OptionValue optval(buffer, allow_clobber);
     230      options_[lowercase(tag)] = optval;
     231      return true;
     232    }
     233
     234    std::string msg = "Option: \"" + tag;
     235    msg += " ";
     236    msg += buffer;
     237    msg += "\" not taken because a value of \n\"" ;
     238    msg += options_[lowercase(tag)].GetValue();
     239    msg += "\" already exists and is set to disallow clobbering.\n\n";
     240    jnlst_->Printf(J_ERROR, J_MAIN, msg.c_str());
     241    return false;
     242  }
     243
     244  bool OptionsList::GetStringValue(const std::string& tag, std::string& value,
     245                                   const std::string& prefix) const
    212246  {
    213247    SmartPtr<const RegisteredOption> option = NULL;
     
    303337  {
    304338    std::string str;
    305     bool ret = GetValue(tag, str, prefix);
     339    bool ret = GetStringValue(tag, str, prefix);
    306340    if (str == "no" || str == "false" || str == "off") {
    307341      value = false;
     
    490524
    491525        if (option->Type() == OT_String) {
    492           ASSERT_EXCEPTION(SetValue(tag, value), OPTION_INVALID,
     526          bool result = SetStringValue(tag, value, false);
     527          ASSERT_EXCEPTION(result, OPTION_INVALID,
    493528                           "Error setting string value read from option file.");
    494529        }
     
    502537            THROW_EXCEPTION(OPTION_INVALID, msg);
    503538          }
    504           ASSERT_EXCEPTION(SetNumericValue(tag, retval), OPTION_INVALID,
     539          bool result = SetNumericValue(tag, retval, false);
     540          ASSERT_EXCEPTION(result, OPTION_INVALID,
    505541                           "Error setting numeric value read from file.");
    506542        }
     
    517553            THROW_EXCEPTION(OPTION_INVALID, msg);
    518554          }
    519           ASSERT_EXCEPTION(SetIntegerValue(tag, retval), OPTION_INVALID,
     555          bool result = SetIntegerValue(tag, retval, false);
     556          ASSERT_EXCEPTION(result, OPTION_INVALID,
    520557                           "Error setting integer value read from option file.");
    521558        }
     
    525562      }
    526563      else {
    527         ASSERT_EXCEPTION(SetValue(tag, value), OPTION_INVALID,
     564        bool result = SetStringValue(tag, value, false);
     565        ASSERT_EXCEPTION(result, OPTION_INVALID,
    528566                         "Error setting value read from option file.");
    529567      }
     
    557595
    558596    return found;
     597  }
     598
     599  bool OptionsList::will_allow_clobber(const std::string& tag) const
     600  {
     601    bool allow_clobber=true;
     602    std::map< std::string, OptionValue >::const_iterator p;
     603
     604    p = options_.find(lowercase(tag));
     605    if (p != options_.end()) {
     606      allow_clobber = p->second.AllowClobber();
     607    }
     608
     609    return allow_clobber;
    559610  }
    560611
  • branches/dev/Common/IpOptionsList.hpp

    r438 r477  
    4444
    4545      /** Constructor given the value */
    46       OptionValue(std::string value)
     46      OptionValue(std::string value, bool allow_clobber)
    4747          :
    4848          value_(value),
    4949          counter_(0),
    50           initialized_(true)
     50          initialized_(true),
     51          allow_clobber_(allow_clobber)
    5152      {}
    5253
     
    5657          value_(copy.value_),
    5758          counter_(copy.counter_),
    58           initialized_(copy.initialized_)
     59          initialized_(copy.initialized_),
     60          allow_clobber_(copy.allow_clobber_)
    5961      {}
    6062
     
    6567        counter_=copy.counter_;
    6668        initialized_=copy.initialized_;
     69        allow_clobber_=copy.allow_clobber_;
    6770      }
    6871
     
    9699      }
    97100
     101      /** True if the option can be overwritten */
     102      bool AllowClobber() const
     103      {
     104        DBG_ASSERT(initialized_);
     105        return allow_clobber_;
     106      }
     107
    98108    private:
    99109      /** Value for this option */
     
    105115      /** for debugging */
    106116      bool initialized_;
     117
     118      /** True if the option can be overwritten */
     119      bool allow_clobber_;
    107120    };
    108121
     
    150163    /** @name Methods for setting options */
    151164    //@{
    152     bool SetValue(const std::string& tag, const std::string& value);
    153     bool SetNumericValue(const std::string& tag, Number value);
    154     bool SetIntegerValue(const std::string& tag, Index value);
     165    bool SetStringValue(const std::string& tag, const std::string& value,
     166                        bool allow_clobber = true);
     167    bool SetNumericValue(const std::string& tag, Number value,
     168                         bool allow_clobber = true);
     169    bool SetIntegerValue(const std::string& tag, Index value,
     170                         bool allow_clobber = true);
    155171    //@}
    156172
     
    159175     *  to the default value defined in the registered options. */
    160176    //@{
    161     bool GetValue(const std::string& tag, std::string& value,
    162                   const std::string& prefix) const;
     177    bool GetStringValue(const std::string& tag, std::string& value,
     178                        const std::string& prefix) const;
    163179    bool GetEnumValue(const std::string& tag, Index& value,
    164180                      const std::string& prefix) const;
     
    214230                  std::string& value) const;
    215231
     232    /** tells whether or not we can clobber a particular option.
     233     *  returns true if the option does not already exist, or if
     234     *  the option exists but is set to allow_clobber
     235     */
     236    bool will_allow_clobber(const std::string& tag) const;
     237
    216238    /** read the next token from stream fp.  Returns false, if EOF was
    217239     *  reached before a tokens was ecountered. */
  • branches/dev/Docs/documentation.tex

    r470 r477  
    11141114\begin{verbatim}
    11151115#include "IpIpoptApplication.hpp"
    1116 #include "HS071_NLP.hpp"
     1116#include "hs071_nlp.hpp"
    11171117
    11181118using namespace Ipopt;
    11191119
    1120 int main()
     1120int main(int argv, char* argc[])
    11211121{
    1122         // use a SmartPtr to point the new HS071_NLP
    1123         SmartPtr<TNLP> mynlp = new HS071_NLP();
    1124        
    1125         // use a SmartPtr to point to new IpoptApplication
    1126         SmartPtr<IpoptApplication> app = new IpoptApplication();
    1127 
    1128         // Ask Ipopt to solve the problem
    1129         SolverReturn status = app->OptimizeTNLP(mynlp);
    1130         if (status == SUCCESSFUL) {
    1131                 std::cout << "SOLVED :)" << std::endl;
    1132                 return 0;
    1133         }
    1134         else {
    1135                 std::cout << "FAILED! :(" << std::endl;
    1136                 return -1;
    1137         }
    1138        
    1139         // As the SmartPtr's go out of scope, the reference counts will be decremented
    1140         // and the mynlp and app objects will automatically be deleted.
     1122  // Create a new instance of your nlp
     1123  //  (use a SmartPtr, not raw)
     1124  SmartPtr<TNLP> mynlp = new HS071_NLP();
     1125
     1126  // Create a new instance of IpoptApplication
     1127  //  (use a SmartPtr, not raw)
     1128  SmartPtr<IpoptApplication> app = new IpoptApplication();
     1129
     1130  // Change some options
     1131  app->Options()->SetNumericValue("tol", 1e-9);
     1132  app->Options()->SetStringValue("mu_strategy", "adaptive");
     1133
     1134  // Ask Ipopt to solve the problem
     1135  ApplicationReturnStatus status = app->OptimizeTNLP(mynlp);
     1136
     1137  if (status == Solve_Succeeded) {
     1138    printf("\n\n*** The problem solved!\n");
     1139  }
     1140  else {
     1141    printf("\n\n*** The problem FAILED!\n");
     1142  }
     1143
     1144  // As the SmartPtrs go out of scope, the reference count
     1145  // will be decremented and the objects will automatically
     1146  // be deleted.
     1147
     1148  return (int) status;
    11411149}
    11421150\end{verbatim}
     
    13901398successful. Finally, we free the memory and return from {\tt main}.
    13911399
     1400\section{Ipopt Options}
     1401Ipopt has many (maybe too many) options that can be adjusted for the
     1402algorithm.  Options are all identified by a string name and their
     1403values can be of one of three types, Number (real), Integer, or
     1404string. Number options are used for things like tolerances, integer
     1405options are used for things like maximum number of iterations, and
     1406string options are used for setting algorithm details, like the NLP
     1407scaling method. Options can be set through code, through the AMPL
     1408interface if you are using AMPL, or by creating a {\tt PARAMS.DAT}
     1409file in the directory you are executing Ipopt.
     1410
     1411The {\tt PARAMS.DAT} file is read line by line and each line should
     1412contain the option name, followed by whitespace, and then the
     1413value. Comments can be included with the {\tt \#} symbol. Don't forget
     1414to ensure you have a newline at the end of the file. For example,
     1415\begin{verbatim}
     1416# This is a comment
     1417
     1418# Turn off the NLP scaling
     1419nlp_scaling_method none
     1420
     1421# Change the initial barrier parameter
     1422mu_init 1e-2
     1423
     1424# Set the max number of iterations
     1425max_iter 500
     1426
     1427\end{verbatim}
     1428is a valid {\tt PARAMS.DAT} file.
     1429
     1430Options can also be set in code. Have a look at the examples to see
     1431how this is done. Note, the PARAMS.DAT file is given preference when
     1432setting options. This way, you can easily override any options set in
     1433a particular executable by creating PARAMS.DAT.
     1434
     1435For a short list of the valid options, see the Appendix
     1436\ref{app.options_ref}. You can print the documentation for all Ipopt
     1437options by adding the option, \\
     1438{\tt print\_options\_documentation yes} \\
     1439and running Ipopt (like the Ampl executable, for instance). This will
     1440output all of the options documentation to the console.
     1441
    13921442\section*{Acknowledgement}
    13931443The initial version of this document was created by Yoshiaki Kawajir
     
    14771527
    14781528
    1479 \section{The Smart Pointer Implementation: SmartPtr}
     1529\section{The Smart Pointer Implementation: SmartPtr} \label{app.smart_ptr}
    14801530
    14811531The SmartPtr class is described in {\tt IpSmartPtr.hpp}. It is a
     
    15061556when creating or passing an Ipopt object.
    15071557
     1558\section{Options Reference} \label{app.options_ref}
     1559\begin{verbatim}
     1560* print_options_documentation   ("no")
     1561   Switch to print list all algorithmic options
     1562     If selected, the algorithm will print the list of all available
     1563     algorithmic options with some documentation before solving the
     1564     optimization problem.
     1565   Possible values:
     1566    - no                      [don't print list]
     1567    - yes                     [print list]
     1568
     1569
     1570### Convergence ###
     1571
     1572*tol                                    0 <  (      1e-08) <  +inf     
     1573   Desired convergence tolerance (relative).
     1574     Determines the convergence tolerance for the algorthim.  The algorithm
     1575     terminates successfully, if the (scaled) NLP error becomes smaller than
     1576     this value, and if the (absolute) criteria according to "dual_inf_tol",
     1577     "primal_inf_tol", and "cmpl_inf_tol" are met.  (This is epsilon_tol in
     1578     Eqn. (6) in implementation paper).  [Some other algorithmic features also
     1579     use this quantity.]
     1580
     1581* max_iter                               0 <= (       3000) <  +inf     
     1582   Maximum number of iterations.
     1583     The algorithm terminates with an error message if the number of
     1584     iterations exceeded this number. [Also used in RestoFilterConvCheck]
     1585
     1586* dual_inf_tol                           0 <  (     0.0001) <  +inf     
     1587   Desired threshold for the dual infeasibility.
     1588     Absolute tolerance on the dual infesaibility. Successful termination
     1589     requires that the (unscaled) dual infeasibility is less than this
     1590     threshold.
     1591
     1592* constr_viol_tol                        0 <  (     0.0001) <  +inf     
     1593   Desired threshold for the constraint violation.
     1594     Absolute tolerance on the constraint violation. Successful termination
     1595     requires that the (unscaled) constraint violation is less than this
     1596     threshold.
     1597
     1598* compl_inf_tol                          0 <  (     0.0001) <  +inf     
     1599   Desired threshold for the complementarity conditions.
     1600     Absolute tolerance on the complementarity. Successful termination
     1601     requires that the (unscaled) complementarity is less than this threshold.
     1602
     1603* acceptable_tol                         0 <  (      1e-06) <  +inf     
     1604   Acceptable convergence tolerance (relative).
     1605     Determines which (scaled) overall optimality error is considered to be
     1606     acceptable. If the algorithm encounters "acceptable_iter" iterations in a
     1607     row that are considered "acceptable", it will terminate before the
     1608     desired convergence tolerance ("tol", "dual_inf_tol", etc) is met.
     1609
     1610* acceptable_dual_inf_tol                0 <  (       0.01) <  +inf     
     1611   Acceptance threshold for the dual infeasibility.
     1612     Absolute tolerance on the dual infesaibility. Acceptable termination
     1613     requires that the (unscaled) dual infeasibility is less than this
     1614     threshold.
     1615
     1616* acceptable_constr_viol_tol             0 <  (       0.01) <  +inf     
     1617   Acceptance threshold for the constraint violation.
     1618     Absolute tolerance on the constraint violation. Acceptable termination
     1619     requires that the (unscaled) constraint violation is less than this
     1620     threshold.
     1621
     1622* acceptable_compl_inf_tol               0 <  (       0.01) <  +inf     
     1623   Acceptance threshold for the complementarity conditions.
     1624     Absolute tolerance on the complementarity. Acceptable termination
     1625     requires that the (unscaled) complementarity is less than this threshold.
     1626
     1627### NLP Scaling ###
     1628
     1629* nlp_scaling_method            ("gradient_based")
     1630   Select the technique used for scaling the NLP
     1631     Selects the technique used for scaling the problem before it is solved.
     1632     For user-scaling, the parameters come from the NLP. If you are using
     1633     AMPL, they can be specified through suffixes (scaling_factor)
     1634   Possible values:
     1635    - none                    [no problem scaling will be performed]
     1636    - user_scaling            [scaling parameters will come from the user]
     1637    - gradient_based          [scale the problem so the maximum gradient at
     1638                               the starting point is scaling_max_gradient]
     1639
     1640* obj_scaling_factor                  -inf <  (          1) <  +inf     
     1641   Scaling factor for the objective function.
     1642     This option allows to set a scaling factor for the objective function
     1643     that is used to scale the problem that is seen internally by Ipopt. If
     1644     additional scaling parameters are computed (e.g. user-scaling or
     1645     gradient-based), this factor is multiplied in addition. If this value is
     1646     chosen to be negative, Ipopt will maximize the objective function.
     1647
     1648* nlp_scaling_max_gradient               0 <  (        100) <  +inf     
     1649   maximum gradient after scaling
     1650     This is the gradient scaling cut-off. If the maximum gradient is above
     1651     this value, then gradient based scaling will be performed. Scaling
     1652     parameters will scale the maximum gradient back to this value. Note: This
     1653     option is only used if "nlp_scaling_method" is chosen as "gradient_based".
     1654
     1655### Mu Update ###
     1656
     1657* mu_strategy                   ("monotone")
     1658   Update strategy for barrier parameter.
     1659     Determines which barrier parameter strategy is to be used.
     1660   Possible values:
     1661    - monotone                [use the monotone (Fiacco-McCormick) strategy]
     1662    - adaptive                [use the adaptive update strategy]
     1663
     1664* mu_oracle                     ("probing")
     1665   Oracle for a new barrier parameter in the adaptive strategy
     1666     Determines how a new barrier parameter is computed in each "free-mode"
     1667     iteration of the adaptive barrier parameter strategy. (Only considered if
     1668     "adaptive" is selected for option "mu_strategy".
     1669   Possible values:
     1670    - probing                 [Mehrotra's probing heuristic]
     1671    - loqo                    [LOQO's centrality rule]
     1672    - quality_function        [minimize a quality function]
     1673
     1674* mu_init                                0 <  (        0.1) <  +inf     
     1675   Initial value for the barrier parameter.
     1676     This option determines the initial value for the barrier parameter (mu).
     1677     It is only relevant in the monotone, Fiacco-McCormick version of the
     1678     algorithm., i.e., if "mu_strategy" is chosen as "monotone"
     1679
     1680### Line Search ###
     1681
     1682* max_soc                                0 <= (          4) <  +inf     
     1683   Maximal number of second order correction trial steps.
     1684     Determines the maximal number of second order correction trial steps that
     1685     should be performed.  Choosing 0 disables the second order corrections.
     1686     (This is p^{max} of Step A-5.9 of Algorithm A in implementation paper.)
     1687
     1688* corrector_type                ("none")
     1689   Type of corrector steps.
     1690     Determines what kind of corrector steps should be tried.
     1691   Possible values:
     1692    - none                    [no corrector]
     1693    - affine                  [corrector step towards mu=0]
     1694    - primal-dual             [corrector step towards current mu]
     1695
     1696* alpha_for_y                   ("primal")
     1697   Step size for constraint multipliers.
     1698     Determines which step size (alpha_y) should be used to update the
     1699     constraint multipliers.
     1700   Possible values:
     1701    - primal                  [use primal step size]
     1702    - bound_mult              [use step size for the bound multipliers]
     1703    - min                     [use the min of primal and bound multipliers]
     1704    - max                     [use the max of primal and bound multipliers]
     1705    - full                    [take a full step of size one]
     1706    - min_dual_infeas         [choose step size minimizing new dual
     1707                               infeasibility]
     1708    - safe_min_dual_infeas    [like "min_dual_infeas", but safeguarded by
     1709                               "min" and "max"]
     1710* expect_infeasible_problem     ("no")
     1711   Enable heuristics to quickly detect an infeasible problem.
     1712     This options is meant to activate heuristics that may speed up the
     1713     infeasibility determination if you expect the problem to be infeasible.
     1714     In the filter line search procedure, the restoration phase is called more
     1715     qucikly than usually, and more reduction in the constraint violation is
     1716     enforced. If the problem is square, this is enabled automatically.
     1717   Possible values:
     1718    - no                      [the problem probably be feasible]
     1719    - yes                     [the problem has a good chance to be infeasible]
     1720
     1721### Initialization ###
     1722
     1723* bound_push                             0 <  (       0.01) <  +inf     
     1724   Desired minimal absolute distance of initial point to bound
     1725     Determines (together with "bound_frac") by how much the initial point
     1726     might have to be modified in order to be sufficiently inside the bounds.
     1727
     1728* bound_frac                             0 <  (       0.01) <= 0.5       
     1729   Desired minimal relative distance of initial point to bound
     1730     Determines (together with "bound_push") by how much the initial point
     1731     might have to be modified in order to be sufficiently inside the bounds.
     1732
     1733* constr_mult_init_max                   0 <= (       1000) <  +inf     
     1734   Maximal allowed least-square guess of constraint multipliers.
     1735     Determines how large the initial least-square guesses of the contraint
     1736     multipliers (in max-norm) are allowed to be. If the guess is larger than
     1737     this value, it is discarded and all constraint multipliers are set to
     1738     zero.  This options is also used in the classes
     1739     "RestoIterateInitializer".  By default, "resto.constr_mult_init_max" (the
     1740     one used in RestoIterateInitializer) is set to zero.
     1741
     1742* bound_mult_init_val                    0 <  (          1) <  +inf     
     1743   Initial value for the bound multipliers
     1744     All dual variables corresponding to bound constraints are initialized to
     1745     this value.
     1746
     1747### Step Calculation ###
     1748
     1749* min_refinement_steps                   0 <= (          1) <  +inf     
     1750   Minimum number of iterative refinement steps per linear system solve.
     1751     Iterative refinement (on the unsymmetric full system) is performed for
     1752     each right hand side.  This option determines the minimal number of
     1753     iterative refinements, i.e., by setting it to 1 at least one iterative
     1754     refinement step per right hand side is enforce.
     1755
     1756* max_refinement_steps                   0 <= (         10) <  +inf     
     1757   Maximal number of iterative refinement steps per linear system solve.
     1758     Iterative refinement (on the unsymmetric full system) is performed for
     1759     each right hand side.  This option determines the maximal number of
     1760     iterative refinements.
     1761
     1762
     1763### NLP ###
     1764
     1765* bound_relax_factor                     0 <= (      1e-08) <  +inf     
     1766   Factor for initial relaxation of the bounds.
     1767     Before start of the optimization, the bounds given by the user are
     1768     relaxed.  This option determines the factor by how much.  If it is set to
     1769     zero, then this option is disabled.  (See Eqn.(35) in implmentation
     1770     paper.)
     1771
     1772
     1773### MA27 Linear Solver ###
     1774
     1775* pivtol                                 0 <  (      1e-08) <  1         
     1776   pivot tolerance for the linear solver. smaller number - pivot for sparsity,
     1777   larger number - pivot for stability
     1778
     1779* pivtolmax                              0 <  (     0.0001) <  1         
     1780   maximum pivot tolerance. IPOPT may increase pivtol as high as pivtolmax to
     1781   get a more accurate solution to the linear system
     1782\end{verbatim}
    15081783\end{document}
  • branches/dev/Examples/hs071_cpp/hs071_main.cpp

    r447 r477  
    1414int main(int argv, char* argc[])
    1515{
    16   // Create an instance of your nlp...
     16  // Create a new instance of your nlp
     17  //  (use a SmartPtr, not raw)
    1718  SmartPtr<TNLP> mynlp = new HS071_NLP();
    1819
    19   // Create an instance of the IpoptApplication
     20  // Create a new instance of IpoptApplication
     21  //  (use a SmartPtr, not raw)
    2022  SmartPtr<IpoptApplication> app = new IpoptApplication();
    2123
     24  // Change some options
     25  app->Options()->SetNumericValue("tol", 1e-9);
     26  app->Options()->SetStringValue("mu_strategy", "adaptive");
     27
     28  // Ask Ipopt to solve the problem
    2229  ApplicationReturnStatus status = app->OptimizeTNLP(mynlp);
    2330
     
    2936  }
    3037
     38  // As the SmartPtrs go out of scope, the reference count
     39  // will be decremented and the objects will automatically
     40  // be deleted.
     41
    3142  return (int) status;
    3243}
  • branches/dev/Interfaces/IpIpoptApplication.cpp

    r465 r477  
    9898      // Open an output file if required
    9999      std::string output_filename;
    100       options_->GetValue("output_file", output_filename, "");
     100      options_->GetStringValue("output_file", output_filename, "");
    101101      if (output_filename != "") {
    102102        EJournalLevel file_print_level;
     
    120120        categories.push_back("Main Algorithm");
    121121        categories.push_back("Convergence");
    122         categories.push_back("Scaling");
     122        categories.push_back("NLP Scaling");
    123123        categories.push_back("Mu Update");
    124124        categories.push_back("Line Search");
     
    128128        categories.push_back("Restoration");
    129129        categories.push_back("NLP");
     130        categories.push_back("Warm Start");
     131        categories.push_back("MA27 Linear Solver");
    130132        categories.push_back("Uncategorized");
    131133        reg_options->OutputOptionDocumentation(*jnlst_, categories);
     
    167169      "Sets the default verbosity level, in particular to screen.  The "
    168170      "larger this value the more detailed is the output.");
    169 
    170 #if IP_DEBUG
    171 
    172     roptions->AddBoundedIntegerOption(
    173       "debug_print_level",
    174       "Verbosity level for debug file.",
    175       0, J_LAST_LEVEL-1, J_SUMMARY,
    176       "This Ipopt library has been compiled in debug mode, and a file "
    177       "\"debug.out\" is produced for every run.  This option determines "
    178       "the verbosity level for this file.  By default it is the same as "
    179       "\"print_level\".");
    180 #endif
    181171
    182172    roptions->AddStringOption1(
     
    206196      "optimization problem.");
    207197
    208     roptions->SetRegisteringCategory("Scaling");
     198#if IP_DEBUG
     199
     200    roptions->AddBoundedIntegerOption(
     201      "debug_print_level",
     202      "Verbosity level for debug file.",
     203      0, J_LAST_LEVEL-1, J_SUMMARY,
     204      "This Ipopt library has been compiled in debug mode, and a file "
     205      "\"debug.out\" is produced for every run.  This option determines "
     206      "the verbosity level for this file.  By default it is the same as "
     207      "\"print_level\".");
     208
     209#endif
     210
     211    roptions->SetRegisteringCategory("NLP Scaling");
    209212    roptions->AddStringOption3(
    210213      "nlp_scaling_method",
     
    238241      SmartPtr<NLPScalingObject> nlp_scaling;
    239242      std::string nlp_scaling_method;
    240       options_->GetValue("nlp_scaling_method", nlp_scaling_method, "");
     243      options_->GetStringValue("nlp_scaling_method", nlp_scaling_method, "");
    241244      if (nlp_scaling_method == "user_scaling") {
    242245        nlp_scaling = new UserScaling(ConstPtr(nlp));
  • branches/dev/Interfaces/IpStdCInterface.cpp

    r448 r477  
    125125  std::string tag(keyword);
    126126  std::string value(val);
    127   return (Bool) ipopt_problem->app->Options()->SetValue(tag, value);
     127  return (Bool) ipopt_problem->app->Options()->SetStringValue(tag, value);
    128128}
    129129
  • branches/dev/configure

    r473 r477  
    20662066      icpc | */icpc) ;;
    20672067      *)
     2068# ToDo decide aboiut unroll-loops
    20682069        opt_cxxflags="-O3 -funroll-loops"
    20692070        case $build in
     
    24252426      cl | */cl)
    24262427             opt_cxxflags="-Ot1"
    2427              add_cxxflags="-nologo"
     2428             add_cxxflags="-nologo -EHsc -GR"
    24282429             dbg_cxxflags="-Yd";;
    24292430      esac;;
     
    40614062
    40624063# Provide some information about the compiler.
    4063 echo "$as_me:4063:" \
     4064echo "$as_me:4064:" \
    40644065     "checking for Fortran 77 compiler version" >&5
    40654066ac_compiler=`set X $ac_compile; echo $2`
     
    48084809ac_save_FFLAGS=$FFLAGS
    48094810FFLAGS="$FFLAGS $ac_verb"
    4810 (eval echo $as_me:4810: \"$ac_link\") >&5
     4811(eval echo $as_me:4811: \"$ac_link\") >&5
    48114812ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
    48124813echo "$ac_f77_v_output" >&5
     
    48864887ac_save_FFLAGS=$FFLAGS
    48874888FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
    4888 (eval echo $as_me:4888: \"$ac_link\") >&5
     4889(eval echo $as_me:4889: \"$ac_link\") >&5
    48894890ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
    48904891echo "$ac_f77_v_output" >&5
Note: See TracChangeset for help on using the changeset viewer.