Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Grützmacher <[email protected]>
  • Loading branch information
yhmtsai and Thomas Grützmacher committed May 17, 2024
1 parent 3b4ca2e commit 54c9690
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
21 changes: 11 additions & 10 deletions include/ginkgo/core/config/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,25 @@ class pnode;
* Cg solver. Note. the template type is given by the another entry or from
* the type_descriptor.
* 5. the data type uses fixed-width representation
* void, int32, int64, float32, float64, complex<float32>, complex<float64>
* 6. We use [real, imag] to represent complex value. If it only contains one
* value or without [], we will treat it as the complex number with imaginary
* int32, int64, float32, float64, complex<float32>, complex<float64>.
* note: we have also allow `void` additionally in type_descriptor to specify
* file must contain the value/index type config.
* 6. We use [real, imag] to represent complex values. If it only contains one
* value or none [], we will treat it as a complex number with an imaginary
* part = 0.
* 7. In many cases, the parameter allows vector input and we handle it by array
* of property tree. If the array only contains one object, users can
* directly provide the object without putting it into an array.
* 7. In many cases, the parameter allows array input. If the array only
* contains one object, users can directly provide the object without putting
* it into an array.
* `"criteria": [{...}]` and `"criteria": {...}` are the same.
*
* The configuration needs
* to specify the resulting type by the field:
* The configuration needs to specify the resulting type by the field:
* ```
* "type": "some_supported_ginkgo_type"
* ```
* The result will be a deferred_factory_parameter,
* which can be thought of as an intermediate step before a LinOpFactory.
* Providing the result an Executor through the function `.on(exec)` will then
* create the factory with the parameters as defined in the configuration.
* Providing an Executor through the function `.on(exec)` will then create the
* factory with the parameters as defined in the configuration.
*
* Given a configuration that is defined as
* ```
Expand Down
13 changes: 13 additions & 0 deletions include/ginkgo/core/solver/cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <ginkgo/core/base/types.hpp>
#include <ginkgo/core/config/config.hpp>
#include <ginkgo/core/config/registry.hpp>
#include <ginkgo/core/config/type_descriptor.hpp>
#include <ginkgo/core/log/logger.hpp>
#include <ginkgo/core/matrix/dense.hpp>
#include <ginkgo/core/matrix/identity.hpp>
Expand Down Expand Up @@ -75,6 +76,18 @@ class Cg : public EnableLinOp<Cg<ValueType>>,
GKO_ENABLE_LIN_OP_FACTORY(Cg, parameters, Factory);
GKO_ENABLE_BUILD_METHOD(Factory);

/**
* Create the parameters from the property_tree.
* Because this is directly tied to the specific type. The value/index type
* settings are ignored and type_descriptor is for children objects.
*
* @param config the property tree for setting
* @param context the registry
* @param td_for_child the type descriptor for children objects. The
* default will directly from the specific type.
*
* @return parameters
*/
static parameters_type parse(const config::pnode& config,
const config::registry& context,
const config::type_descriptor& td_for_child =
Expand Down

0 comments on commit 54c9690

Please sign in to comment.