4
4
5
5
#include " ginkgo/core/solver/chebyshev.hpp"
6
6
7
+ #include < set>
8
+ #include < string>
9
+
7
10
#include < ginkgo/core/base/precision_dispatch.hpp>
8
11
#include < ginkgo/core/matrix/dense.hpp>
9
12
#include < ginkgo/core/solver/solver_base.hpp>
@@ -48,8 +51,9 @@ typename Chebyshev<ValueType>::parameters_type Chebyshev<ValueType>::parse(
48
51
const config::type_descriptor& td_for_child)
49
52
{
50
53
auto params = solver::Chebyshev<ValueType>::build ();
51
- common_solver_parse (params, config, context, td_for_child);
52
- if (auto & obj = config.get (" foci" )) {
54
+ std::set<std::string> allowed_keys;
55
+ common_solver_parse (params, config, context, td_for_child, allowed_keys);
56
+ if (auto & obj = config::get_config_node (config, " foci" , allowed_keys)) {
53
57
auto arr = obj.get_array ();
54
58
if (arr.size () != 2 ) {
55
59
GKO_INVALID_CONFIG_VALUE (" foci" , " must contain two elements" );
@@ -58,10 +62,12 @@ typename Chebyshev<ValueType>::parameters_type Chebyshev<ValueType>::parse(
58
62
gko::config::get_value<detail::coeff_type<ValueType>>(arr.at (0 )),
59
63
gko::config::get_value<detail::coeff_type<ValueType>>(arr.at (1 )));
60
64
}
61
- if (auto & obj = config.get (" default_initial_guess" )) {
65
+ if (auto & obj = config::get_config_node (config, " default_initial_guess" ,
66
+ allowed_keys)) {
62
67
params.with_default_initial_guess (
63
68
gko::config::get_value<solver::initial_guess_mode>(obj));
64
69
}
70
+ config::check_allowed_keys (config, allowed_keys);
65
71
return params;
66
72
}
67
73
0 commit comments