Esempio n. 1
0
  void AdaptiveMuUpdate::RegisterOptions(SmartPtr<RegisteredOptions> roptions)
  {
    roptions->AddLowerBoundedNumberOption(
      "mu_max_fact",
      "Factor for initialization of maximum value for barrier parameter.",
      0.0, true, 1e3,
      "This option determines the upper bound on the barrier parameter.  This "
      "upper bound is computed as the average complementarity at the initial "
      "point times the value of this option. (Only used if option "
      "\"mu_strategy\" is chosen as \"adaptive\".)");
    roptions->AddLowerBoundedNumberOption(
      "mu_max",
      "Maximum value for barrier parameter.",
      0.0, true, 1e5,
      "This option specifies an upper bound on the barrier parameter in the "
      "adaptive mu selection mode.  If this option is set, it overwrites the "
      "effect of mu_max_fact. (Only used if option "
      "\"mu_strategy\" is chosen as \"adaptive\".)");
    roptions->AddLowerBoundedNumberOption(
      "mu_min",
      "Minimum value for barrier parameter.",
      0.0, true, 1e-11,
      "This option specifies the lower bound on the barrier parameter in the "
      "adaptive mu selection mode. By default, it is set to the minimum of 1e-11 and "
      "min(\"tol\",\"compl_inf_tol\")/(\"barrier_tol_factor\"+1), which "
      "should be a reasonable value. (Only used if option "
      "\"mu_strategy\" is chosen as \"adaptive\".)");
    std::string prev_cat = roptions->RegisteringCategory();
    roptions->SetRegisteringCategory("Undocumented");
    roptions->AddLowerBoundedNumberOption(
      "adaptive_mu_safeguard_factor",
      "",
      0.0, false, 0.0);
    roptions->SetRegisteringCategory(prev_cat);

    roptions->AddStringOption3(
      "adaptive_mu_globalization",
      "Globalization strategy for the adaptive mu selection mode.",
      "obj-constr-filter",
      "kkt-error", "nonmonotone decrease of kkt-error",
      "obj-constr-filter", "2-dim filter for objective and constraint violation",
      "never-monotone-mode", "disables globalization",
      "To achieve global convergence of the adaptive version, the algorithm "
      "has to switch to the monotone mode (Fiacco-McCormick approach) when "
      "convergence does not seem to appear.  This option sets the "
      "criterion used to decide when to do this switch. (Only used if option "
      "\"mu_strategy\" is chosen as \"adaptive\".)");

    roptions->AddLowerBoundedIntegerOption(
      "adaptive_mu_kkterror_red_iters",
      "Maximum number of iterations requiring sufficient progress.",
      0, 4,
      "For the \"kkt-error\" based globalization strategy, sufficient "
      "progress must be made for \"adaptive_mu_kkterror_red_iters\" "
      "iterations. If this number of iterations is exceeded, the "
      "globalization strategy switches to the monotone mode.");

    roptions->AddBoundedNumberOption(
      "adaptive_mu_kkterror_red_fact",
      "Sufficient decrease factor for \"kkt-error\" globalization strategy.",
      0.0, true, 1.0, true,
      0.9999,
      "For the \"kkt-error\" based globalization strategy, the error "
      "must decrease by this factor to be deemed sufficient decrease.");

    roptions->AddBoundedNumberOption(
      "filter_margin_fact",
      "Factor determining width of margin for obj-constr-filter adaptive globalization strategy.",
      0.0, true, 1.0, true,
      1e-5,
      "When using the adaptive globalization strategy, \"obj-constr-filter\", "
      "sufficient progress for a filter entry is defined as "
      "follows: (new obj) < (filter obj) - filter_margin_fact*(new "
      "constr-viol) OR (new constr-viol) < (filter constr-viol) - "
      "filter_margin_fact*(new constr-viol).  For the description of "
      "the \"kkt-error-filter\" option see \"filter_max_margin\".");
    roptions->AddLowerBoundedNumberOption(
      "filter_max_margin",
      "Maximum width of margin in obj-constr-filter adaptive globalization strategy.",
      0.0, true,
      1.0,
      // ToDo Detailed description later
      "");
    roptions->AddStringOption2(
      "adaptive_mu_restore_previous_iterate",
      "Indicates if the previous iterate should be restored if the monotone mode is entered.",
      "no",
      "no", "don't restore accepted iterate",
      "yes", "restore accepted iterate",
      "When the globalization strategy for the adaptive barrier algorithm "
      "switches to the monotone mode, it can either start "
      "from the most recent iterate (no), or from the last "
      "iterate that was accepted (yes).");

    roptions->AddLowerBoundedNumberOption(
      "adaptive_mu_monotone_init_factor",
      "Determines the initial value of the barrier parameter when switching to the monotone mode.",
      0.0, true, 0.8,
      "When the globalization strategy for the adaptive barrier algorithm "
      "switches to the monotone mode and fixed_mu_oracle is chosen as "
      "\"average_compl\", the barrier parameter is set to the "
      "current average complementarity times the value of "
      "\"adaptive_mu_monotone_init_factor\".");

    roptions->AddStringOption4(
      "adaptive_mu_kkt_norm_type",
      "Norm used for the KKT error in the adaptive mu globalization strategies.",
      "2-norm-squared",
      "1-norm", "use the 1-norm (abs sum)",
      "2-norm-squared", "use the 2-norm squared (sum of squares)",
      "max-norm", "use the infinity norm (max)",
      "2-norm", "use 2-norm",
      "When computing the KKT error for the globalization strategies, the "
      "norm to be used is specified with this option. Note, this options is also used "
      "in the QualityFunctionMuOracle.");

  }
  void AlgorithmBuilder::RegisterOptions(SmartPtr<RegisteredOptions> roptions)
  {
    roptions->SetRegisteringCategory("Linear Solver");
    roptions->AddStringOption9(
      "linear_solver",
      "Linear solver used for step computations.",
#ifdef COINHSL_HAS_MA27
      "ma27",
#else
# ifdef COINHSL_HAS_MA57
      "ma57",
# else
# ifdef COINHSL_HAS_MA97
      "ma97",
#else
#   ifdef COINHSL_HAS_MA86
       "ma86",
#   else
#    ifdef HAVE_PARDISO
       "pardiso",
#    else
#     ifdef HAVE_WSMP
       "wsmp",
#     else
#      ifdef COIN_HAS_MUMPS
       "mumps",
#      else
#       ifdef COINHSL_HAS_MA77
        "ma77",
#       else
        "ma27",
#       endif
#      endif
#     endif
#    endif
#   endif
#  endif
# endif
#endif
      "ma27", "use the Harwell routine MA27",
      "ma57", "use the Harwell routine MA57",
      "ma77", "use the Harwell routine HSL_MA77",
      "ma86", "use the Harwell routine HSL_MA86",
      "ma97", "use the Harwell routine HSL_MA97",
      "pardiso", "use the Pardiso package",
      "wsmp", "use WSMP package",
      "mumps", "use MUMPS package",
      "custom", "use custom linear solver",
      "Determines which linear algebra package is to be used for the "
      "solution of the augmented linear system (for obtaining the search "
      "directions). "
      "Note, the code must have been compiled with the linear solver you want "
      "to choose. Depending on your Ipopt installation, not all options are "
      "available.");
    roptions->SetRegisteringCategory("Linear Solver");
    roptions->AddStringOption3(
      "linear_system_scaling",
      "Method for scaling the linear system.",
#ifdef COINHSL_HAS_MC19
      "mc19",
#else
      "none",
#endif
      "none", "no scaling will be performed",
      "mc19", "use the Harwell routine MC19",
      "slack-based", "use the slack values",
      "Determines the method used to compute symmetric scaling "
      "factors for the augmented system (see also the "
      "\"linear_scaling_on_demand\" option).  This scaling is independent "
      "of the NLP problem scaling.  By default, MC19 is only used if MA27 or "
      "MA57 are selected as linear solvers. This value is only available if "
      "Ipopt has been compiled with MC19.");

    roptions->SetRegisteringCategory("NLP Scaling");
    roptions->AddStringOption4(
      "nlp_scaling_method",
      "Select the technique used for scaling the NLP.",
      "gradient-based",
      "none", "no problem scaling will be performed",
      "user-scaling", "scaling parameters will come from the user",
      "gradient-based", "scale the problem so the maximum gradient at the starting point is scaling_max_gradient",
      "equilibration-based", "scale the problem so that first derivatives are of order 1 at random points (only available with MC19)",
      "Selects the technique used for scaling the problem internally before it is solved."
      " For user-scaling, the parameters come from the NLP. If you are using "
      "AMPL, they can be specified through suffixes (\"scaling_factor\")");

    roptions->SetRegisteringCategory("Barrier Parameter Update");
    roptions->AddStringOption2(
      "mu_strategy",
      "Update strategy for barrier parameter.",
      "monotone",
      "monotone", "use the monotone (Fiacco-McCormick) strategy",
      "adaptive", "use the adaptive update strategy",
      "Determines which barrier parameter update strategy is to be used.");
    roptions->AddStringOption3(
      "mu_oracle",
      "Oracle for a new barrier parameter in the adaptive strategy.",
      "quality-function",
      "probing", "Mehrotra's probing heuristic",
      "loqo", "LOQO's centrality rule",
      "quality-function", "minimize a quality function",
      "Determines how a new barrier parameter is computed in each "
      "\"free-mode\" iteration of the adaptive barrier parameter "
      "strategy. (Only considered if \"adaptive\" is selected for "
      "option \"mu_strategy\").");
    roptions->AddStringOption4(
      "fixed_mu_oracle",
      "Oracle for the barrier parameter when switching to fixed mode.",
      "average_compl",
      "probing", "Mehrotra's probing heuristic",
      "loqo", "LOQO's centrality rule",
      "quality-function", "minimize a quality function",
      "average_compl", "base on current average complementarity",
      "Determines how the first value of the barrier parameter should be "
      "computed when switching to the \"monotone mode\" in the adaptive "
      "strategy. (Only considered if \"adaptive\" is selected for option "
      "\"mu_strategy\".)");

    roptions->SetRegisteringCategory("Hessian Approximation");
    roptions->AddStringOption2(
      "limited_memory_aug_solver",
      "Strategy for solving the augmented system for low-rank Hessian.",
      "sherman-morrison",
      "sherman-morrison", "use Sherman-Morrison formula",
      "extended", "use an extended augmented system",
      "");

    roptions->SetRegisteringCategory("Line Search");
    roptions->AddStringOption3(
      "line_search_method",
      "Globalization method used in backtracking line search",
      "filter",
      "filter", "Filter method",
      "cg-penalty", "Chen-Goldfarb penalty function",
      "penalty", "Standard penalty function",
      "Only the \"filter\" choice is officially supported.  But sometimes, "
      "good results might be obtained with the other choices.");
    roptions->SetRegisteringCategory("Undocumented");
    roptions->AddStringOption2(
      "wsmp_iterative",
      "Switches to iterative solver in WSMP.",
      "no",
      "no", "use direct solver",
      "yes", "use iterative solver",
      "EXPERIMENTAL!");
  }
  void PardisoSolverInterface::RegisterOptions(SmartPtr<RegisteredOptions> roptions)
  {
    // Todo Use keywords instead of integer numbers
    roptions->AddStringOption3(
      "pardiso_matching_strategy",
      "Matching strategy to be used by Pardiso",
      "complete+2x2",
      "complete", "Match complete (IPAR(13)=1)",
      "complete+2x2", "Match complete+2x2 (IPAR(13)=2)",
      "constraints", "Match constraints (IPAR(13)=3)",
      "This is IPAR(13) in Pardiso manual.");
    roptions->AddStringOption2(
      "pardiso_redo_symbolic_fact_only_if_inertia_wrong",
      "Toggle for handling case when elements were perturbed by Pardiso.",
      "no",
      "no", "Always redo symbolic factorization when elements were perturbed",
      "yes", "Only redo symbolic factorization when elements were perturbed if also the inertia was wrong",
      "");
    roptions->AddStringOption2(
      "pardiso_repeated_perturbation_means_singular",
      "Interpretation of perturbed elements.",
      "no",
      "no", "Don't assume that matrix is singular if elements were perturbed after recent symbolic factorization",
      "yes", "Assume that matrix is singular if elements were perturbed after recent symbolic factorization",
      "");
    //roptions->AddLowerBoundedIntegerOption(
    //  "pardiso_out_of_core_power",
    //  "Enables out-of-core variant of Pardiso",
    //  0, 0,
    //  "Setting this option to a positive integer k makes Pardiso work in the "
    //  "out-of-core variant where the factor is split in 2^k subdomains.  This "
    //  "is IPARM(50) in the Pardiso manual.  This option is only available if "
    //  "Ipopt has been compiled with Pardiso.");
    roptions->AddLowerBoundedIntegerOption(
      "pardiso_msglvl",
      "Pardiso message level",
      0, 0,
      "This determines the amount of analysis output from the Pardiso solver. "
      "This is MSGLVL in the Pardiso manual.");
    roptions->AddStringOption2(
      "pardiso_skip_inertia_check",
      "Always pretend inertia is correct.",
      "no",
      "no", "check inertia",
      "yes", "skip inertia check",
      "Setting this option to \"yes\" essentially disables inertia check. "
      "This option makes the algorithm non-robust and easily fail, but it "
      "might give some insight into the necessity of inertia control.");
    roptions->AddIntegerOption(
      "pardiso_max_iterative_refinement_steps",
      "Limit on number of iterative refinement steps.",
      // ToDo: Decide how many iterative refinement steps in Pardiso.
      //       For now, we keep the default (0) for Basel Pardiso.
      //       For MKL Pardiso, it seems that setting it to 1 makes it more
      //       robust and just a little bit slower.
      //       Setting it to 1 should decrease the number of iterative refinement
      //       steps by 1 in case that perturbed pivots have been used, and increase
      //       it by 1 otherwise.
#ifdef HAVE_PARDISO_MKL
      1,
#else
      0,
#endif
      "The solver does not perform more than the absolute value of this value steps of iterative refinement and stops the process if a satisfactory level of accuracy of the solution in terms of backward error is achieved. "
      "If negative, the accumulation of the residue uses extended precision real and complex data types. Perturbed pivots result in iterative refinement. "
      "The solver automatically performs two steps of iterative refinements when perturbed pivots are obtained during the numerical factorization and this option is set to 0.");
#ifdef HAVE_PARDISO_MKL
    roptions->AddStringOption4(
      "pardiso_order",
      "Controls the fill-in reduction ordering algorithm for the input matrix.",
      "metis",
      "amd", "minimum degree algorithm",
      "one", "undocumented",
      "metis", "MeTiS nested dissection algorithm",
      "pmetis", "parallel (OpenMP) version of MeTiS nested dissection algorithm",
      "");
#else
    roptions->AddStringOption6(
      "pardiso_order",
      "Controls the fill-in reduction ordering algorithm for the input matrix.",
      "five",
      "amd", "minimum degree algorithm",
      "one", "undocumented",
      "metis", "MeTiS nested dissection algorithm",
      "pmetis", "parallel (OpenMP) version of MeTiS nested dissection algorithm",
      "four", "undocumented",
      "five", "undocumented"
      "");
#endif
#if !defined(HAVE_PARDISO_OLDINTERFACE) && !defined(HAVE_PARDISO_MKL)
    roptions->AddLowerBoundedIntegerOption(
      "pardiso_max_iter",
      "Maximum number of Krylov-Subspace Iteration",
      1, 500,
      "DPARM(1)");
    roptions->AddBoundedNumberOption(
      "pardiso_iter_relative_tol",
      "Relative Residual Convergence",
      0.0, true, 1.0, true, 1e-6,
      "DPARM(2)");
    roptions->AddLowerBoundedIntegerOption(
      "pardiso_iter_coarse_size",
      "Maximum Size of Coarse Grid Matrix",
      1, 5000,
      "DPARM(3)");
    roptions->AddLowerBoundedIntegerOption(
      "pardiso_iter_max_levels",
      "Maximum Size of Grid Levels",
      1, 10,
      "DPARM(4)");
    roptions->AddBoundedNumberOption(
      "pardiso_iter_dropping_factor",
      "dropping value for incomplete factor",
      0.0, true, 1.0, true, 0.5,
      "DPARM(5)");
    roptions->AddBoundedNumberOption(
      "pardiso_iter_dropping_schur",
      "dropping value for sparsify schur complement factor",
      0.0, true, 1.0, true, 1e-1,
      "DPARM(6)");
    roptions->AddLowerBoundedIntegerOption(
      "pardiso_iter_max_row_fill",
      "max fill for each row",
      1,10000000,
      "DPARM(7)");
    roptions->AddLowerBoundedNumberOption(
      "pardiso_iter_inverse_norm_factor",
      "",
      1, true, 5000000,
      "DPARM(8)");
    roptions->AddStringOption2(
      "pardiso_iterative",
      "Switch on iterative solver in Pardiso library",
      "no",
      "no", "",
      "yes", "",
      "This option is not available for Pardiso < 4.0 or MKL Pardiso");
    roptions->AddLowerBoundedIntegerOption(
      "pardiso_max_droptol_corrections",
      "Maximal number of decreases of drop tolerance during one solve.",
      1, 4,
      "This is relevant only for iterative Pardiso options.");
#endif
  }