Skip to content

Commit

Permalink
update documentation and remove stop::
Browse files Browse the repository at this point in the history
Co-authored-by: Marcel Koch <[email protected]>
Co-authored-by: Tobias Ribizel <[email protected]>
  • Loading branch information
3 people committed May 23, 2024
1 parent 1bf7def commit 2708df2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
3 changes: 1 addition & 2 deletions core/test/config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class Config : public ::testing::Test {
: exec(gko::ReferenceExecutor::create()),
mtx(gko::initialize<Mtx>(
{{2, -1.0, 0.0}, {-1.0, 2, -1.0}, {0.0, -1.0, 2}}, exec)),
stop_config(
{{"type", pnode{"stop::Iteration"}}, {"max_iters", pnode{1}}})
stop_config({{"type", pnode{"Iteration"}}, {"max_iters", pnode{1}}})
{}

std::shared_ptr<const gko::Executor> exec;
Expand Down
14 changes: 7 additions & 7 deletions include/ginkgo/core/config/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class pnode;
* that is not defined will fallback to the type_descriptor argument
* 2. The new `"type"` key determines which Ginkgo object to create. The value
* for this key is the desired class name with namespaces (except for
* `gko::`, `experimental::`). Any template parameters a class might have are
* left out. Only classes with a factory are supported. For example, the
* configuration `"type": "solver::Cg"` specifies that a Cg solver will be
* created. Note: template parameters can either be given in the
* configuration as separate key-value pairs, or in the type_descriptor.
* `gko::`, `experimental::`, `stop::`). Any template parameters a class
* might have are left out. Only classes with a factory are supported. For
* example, the configuration `"type": "solver::Cg"` specifies that a Cg
* solver will be created. Note: template parameters can either be given in
* the configuration as separate key-value pairs, or in the type_descriptor.
* 3. Factory and class template parameters can be defined with key-value pairs
* that are derived from the class they are referring to. When a factory has
* a parameter with the function `with_<key>(value)`, then the configuration
Expand Down Expand Up @@ -101,8 +101,8 @@ class pnode;
* "type": "solver::Gmres",
* "krylov_dim": 20,
* "criteria": [
* {"type": "stop::Iteration", "max_iters": 10},
* {"type": "stop::ResidualNorm", "reduction_factor": 1e-6}
* {"type": "Iteration", "max_iters": 10},
* {"type": "ResidualNorm", "reduction_factor": 1e-6}
* ]
* ```
* then passing it to this function like this:
Expand Down
8 changes: 6 additions & 2 deletions include/ginkgo/core/config/registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ class registry final {
*
* @param additional_map the additional map to dispatch the class base.
* Users can extend the map to fit their own
* LinOpFactory.
* LinOpFactory. We suggest using "usr::" as the
* prefix in the key to simply avoid conflict with
* ginkgo's map.
*/
registry(const configuration_map& additional_map = {});

Expand All @@ -194,7 +196,9 @@ class registry final {
* ```
* @param additional_map the additional map to dispatch the class base.
* Users can extend the map to fit their own
* LinOpFactory.
* LinOpFactory. We suggest using "usr::" as the
* prefix in the key to simply avoid conflict with
* ginkgo's map.
*/
registry(
const std::unordered_map<std::string, detail::allowed_ptr>& stored_map,
Expand Down

0 comments on commit 2708df2

Please sign in to comment.