Skip to content

Commit 2234682

Browse files
committed
add chebyshev
1 parent c0bcaad commit 2234682

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

core/solver/chebyshev.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
#include "ginkgo/core/solver/chebyshev.hpp"
66

7+
#include <set>
8+
#include <string>
9+
710
#include <ginkgo/core/base/precision_dispatch.hpp>
811
#include <ginkgo/core/matrix/dense.hpp>
912
#include <ginkgo/core/solver/solver_base.hpp>
@@ -48,8 +51,9 @@ typename Chebyshev<ValueType>::parameters_type Chebyshev<ValueType>::parse(
4851
const config::type_descriptor& td_for_child)
4952
{
5053
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)) {
5357
auto arr = obj.get_array();
5458
if (arr.size() != 2) {
5559
GKO_INVALID_CONFIG_VALUE("foci", "must contain two elements");
@@ -58,10 +62,12 @@ typename Chebyshev<ValueType>::parameters_type Chebyshev<ValueType>::parse(
5862
gko::config::get_value<detail::coeff_type<ValueType>>(arr.at(0)),
5963
gko::config::get_value<detail::coeff_type<ValueType>>(arr.at(1)));
6064
}
61-
if (auto& obj = config.get("default_initial_guess")) {
65+
if (auto& obj = config::get_config_node(config, "default_initial_guess",
66+
allowed_keys)) {
6267
params.with_default_initial_guess(
6368
gko::config::get_value<solver::initial_guess_mode>(obj));
6469
}
70+
config::check_allowed_keys(config, allowed_keys);
6571
return params;
6672
}
6773

0 commit comments

Comments
 (0)