Skip to content

Commit

Permalink
Add new if condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
breyerml authored Apr 26, 2024
1 parent af31a61 commit ef063f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/plssvm/parameter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ struct parameter {
}
if constexpr (parser.has(plssvm::gamma)) {
// get the value of the provided named parameter
if constexpr (std::is_same_v<detail::remove_cvref_t<decltype(parser(plssvm::gamma))>, gamma_coefficient_type>) {
gamma = detail::get_value_from_named_parameter<gamma_coefficient_type>(parser, plssvm::gamma);
if constexpr (std::is_same_v<detail::remove_cvref_t<decltype(parser(plssvm::gamma))>, gamma_type>) {
gamma = static_cast<gamma_type>(parser(plssvm::gamma));
} else if constexpr (std::is_same_v<detail::remove_cvref_t<decltype(parser(plssvm::gamma))>, gamma_coefficient_type>) {
gamma = static_cast<gamma_coefficient_type>(parser(plssvm::gamma));
} else {
gamma = detail::get_value_from_named_parameter<real_type>(parser, plssvm::gamma);
}
Expand Down

0 comments on commit ef063f1

Please sign in to comment.