Skip to content

Commit

Permalink
Remove unused line search names
Browse files Browse the repository at this point in the history
  • Loading branch information
zfergus committed Feb 8, 2024
1 parent 1d5566b commit 82038dd
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/polysolve/nonlinear/line_search/LineSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,19 @@ namespace polysolve::nonlinear::line_search
std::shared_ptr<LineSearch> LineSearch::create(const json &params, spdlog::logger &logger)
{
const std::string name = params["line_search"]["method"];
if (name == "armijo" || name == "Armijo")
if (name == "Armijo")
{
return std::make_shared<Armijo>(params, logger);
}
else if (name == "robust_armijo" || name == "RobustArmijo")
else if (name == "RobustArmijo")
{
return std::make_shared<RobustArmijo>(params, logger);
}
else if (name == "bisection" || name == "Bisection")
else if (name == "Backtracking")
{
logger.warn("{} linesearch was renamed to \"backtracking\"; using backtracking line-search", name);
return std::make_shared<Backtracking>(params, logger);
}
else if (name == "backtracking" || name == "Backtracking")
{
return std::make_shared<Backtracking>(params, logger);
}
else if (name == "none" || name == "None")
else if (name == "None")
{
return std::make_shared<NoLineSearch>(params, logger);
}
Expand All @@ -50,12 +45,7 @@ namespace polysolve::nonlinear::line_search

std::vector<std::string> LineSearch::available_methods()
{
return {{"Armijo",
"ArmijoAlt",
"RobustArmijo",
"Backtracking",
"MoreThuente",
"None"}};
return {{"Armijo", "RobustArmijo", "Backtracking", "None"}};
}

LineSearch::LineSearch(const json &params, spdlog::logger &logger)
Expand Down

0 comments on commit 82038dd

Please sign in to comment.