Skip to content

Commit

Permalink
rename, update doc
Browse files Browse the repository at this point in the history
Co-authored-by: Marcel Koch <[email protected]>
Co-authored-by: Thomas Grützmacher <[email protected]>
  • Loading branch information
3 people committed May 28, 2024
1 parent ce5d3dc commit 435f87d
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 26 deletions.
2 changes: 1 addition & 1 deletion core/config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ deferred_factory_parameter<gko::LinOpFactory> parse(const pnode& config,
obj.get_string());
return func(config, context, td);
}
GKO_MISS_CONFIG_ENTRY("type");
GKO_MISSING_CONFIG_ENTRY("type");
}


Expand Down
4 changes: 2 additions & 2 deletions core/config/config_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace config {
"<"))


#define GKO_MISS_CONFIG_ENTRY(_entry) \
#define GKO_MISSING_CONFIG_ENTRY(_entry) \
GKO_INVALID_STATE(std::string("The entry >") + _entry + "< is missing")


Expand Down Expand Up @@ -294,7 +294,7 @@ inline std::shared_ptr<typename Csr::strategy_type> get_strategy(
} else {
GKO_INVALID_CONFIG_VALUE("strategy", str);
}
return std::move(strategy_ptr);
return strategy_ptr;
}


Expand Down
2 changes: 1 addition & 1 deletion core/config/preconditioner_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ deferred_factory_parameter<gko::LinOpFactory> parse<LinOpFactoryType::Isai>(
GKO_INVALID_CONFIG_VALUE("isai_type", str);
}
} else {
GKO_MISS_CONFIG_ENTRY("isai_type");
GKO_MISSING_CONFIG_ENTRY("isai_type");
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/preconditioner/ic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <ginkgo/core/config/config.hpp>
#include <ginkgo/core/config/registry.hpp>
#include <ginkgo/core/preconditioner/isai.hpp>
#include <ginkgo/core/preconditioner/parse_limit.hpp>
#include <ginkgo/core/preconditioner/utils.hpp>
#include <ginkgo/core/solver/gmres.hpp>
#include <ginkgo/core/solver/ir.hpp>

Expand Down
1 change: 1 addition & 0 deletions core/preconditioner/ilu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <ginkgo/core/config/registry.hpp>
#include <ginkgo/core/config/type_descriptor.hpp>
#include <ginkgo/core/preconditioner/isai.hpp>
#include <ginkgo/core/preconditioner/utils.hpp>
#include <ginkgo/core/solver/gmres.hpp>
#include <ginkgo/core/solver/ir.hpp>

Expand Down
7 changes: 5 additions & 2 deletions include/ginkgo/core/factorization/cholesky.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ class Cholesky
*/
const parameters_type& get_parameters() { return parameters_; }

/**
* @copydoc get_parameters
*/
const parameters_type& get_parameters() const { return parameters_; }

/**
* @copydoc LinOpFactory::generate
* @note This function overrides the default LinOpFactory::generate to
Expand All @@ -90,8 +95,6 @@ class Cholesky
/** Creates a new parameter_type to set up the factory. */
static parameters_type build() { return {}; }

const parameters_type& get_parameters() const { return parameters_; }

/**
* Create the parameters from the property_tree.
* Because this is directly tied to the specific type, the value/index type
Expand Down
7 changes: 5 additions & 2 deletions include/ginkgo/core/factorization/lu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ class Lu
*/
const parameters_type& get_parameters() { return parameters_; }

/**
* @copydoc get_parameters
*/
const parameters_type& get_parameters() const { return parameters_; }

/**
* @copydoc LinOpFactory::generate
* @note This function overrides the default LinOpFactory::generate to
Expand All @@ -120,8 +125,6 @@ class Lu
/** Creates a new parameter_type to set up the factory. */
static parameters_type build() { return {}; }

const parameters_type& get_parameters() const { return parameters_; }

/**
* Create the parameters from the property_tree.
* Because this is directly tied to the specific type, the value/index type
Expand Down
10 changes: 5 additions & 5 deletions include/ginkgo/core/preconditioner/ic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <ginkgo/core/factorization/par_ic.hpp>
#include <ginkgo/core/matrix/dense.hpp>
#include <ginkgo/core/preconditioner/isai.hpp>
#include <ginkgo/core/preconditioner/parse_limit.hpp>
#include <ginkgo/core/preconditioner/utils.hpp>
#include <ginkgo/core/solver/gmres.hpp>
#include <ginkgo/core/solver/ir.hpp>
#include <ginkgo/core/solver/solver_traits.hpp>
Expand All @@ -39,10 +39,10 @@ namespace detail {

template <typename Type>
constexpr bool support_ic_parse =
is_instance_of<Type, solver::LowerTrs>::value ||
is_instance_of<Type, solver::Ir>::value ||
is_instance_of<Type, solver::Gmres>::value ||
is_instance_of<Type, preconditioner::LowerIsai>::value;
is_instantiation_of<Type, solver::LowerTrs>::value ||
is_instantiation_of<Type, solver::Ir>::value ||
is_instantiation_of<Type, solver::Gmres>::value ||
is_instantiation_of<Type, preconditioner::LowerIsai>::value;


template <
Expand Down
10 changes: 5 additions & 5 deletions include/ginkgo/core/preconditioner/ilu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <ginkgo/core/factorization/par_ilu.hpp>
#include <ginkgo/core/matrix/dense.hpp>
#include <ginkgo/core/preconditioner/isai.hpp>
#include <ginkgo/core/preconditioner/parse_limit.hpp>
#include <ginkgo/core/preconditioner/utils.hpp>
#include <ginkgo/core/solver/gmres.hpp>
#include <ginkgo/core/solver/ir.hpp>
#include <ginkgo/core/solver/solver_traits.hpp>
Expand All @@ -40,10 +40,10 @@ namespace detail {
template <typename LSolverType, typename USolverType>
constexpr bool support_ilu_parse =
std::is_same<typename USolverType::transposed_type, LSolverType>::value &&
(is_instance_of<LSolverType, solver::LowerTrs>::value ||
is_instance_of<LSolverType, solver::Ir>::value ||
is_instance_of<LSolverType, solver::Gmres>::value ||
is_instance_of<LSolverType, preconditioner::LowerIsai>::value);
(is_instantiation_of<LSolverType, solver::LowerTrs>::value ||
is_instantiation_of<LSolverType, solver::Ir>::value ||
is_instantiation_of<LSolverType, solver::Gmres>::value ||
is_instantiation_of<LSolverType, preconditioner::LowerIsai>::value);


template <typename Ilu,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// SPDX-License-Identifier: BSD-3-Clause

#ifndef GKO_PUBLIC_CORE_PRECONDITIONER_PARSE_LIMIT_HPP_
#define GKO_PUBLIC_CORE_PRECONDITIONER_PARSE_LIMIT_HPP_
#ifndef GKO_PUBLIC_CORE_PRECONDITIONER_UTILS_HPP_
#define GKO_PUBLIC_CORE_PRECONDITIONER_UTILS_HPP_


#include <type_traits>
Expand All @@ -19,19 +19,19 @@ namespace detail {

// true_type if ExplicitType is an instantiation of TemplateType.
template <typename ExplicitType, template <typename...> class TemplateType>
struct is_instance_of : std::false_type {};
struct is_instantiation_of : std::false_type {};

template <template <typename...> class Type, typename... Param>
struct is_instance_of<Type<Param...>, Type> : std::true_type {};
struct is_instantiation_of<Type<Param...>, Type> : std::true_type {};

// LowerIsai will be treated as Isai<...> so it does not match LowerIsai<...>
template <typename ValueType, typename IndexType>
struct is_instance_of<LowerIsai<ValueType, IndexType>, LowerIsai>
struct is_instantiation_of<LowerIsai<ValueType, IndexType>, LowerIsai>
: std::true_type {};


} // namespace detail
} // namespace preconditioner
} // namespace gko

#endif // GKO_PUBLIC_CORE_PRECONDITIONER_PARSE_LIMIT_HPP_
#endif // GKO_PUBLIC_CORE_PRECONDITIONER_UTILS_HPP_
2 changes: 1 addition & 1 deletion include/ginkgo/ginkgo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
#include <ginkgo/core/preconditioner/ilu.hpp>
#include <ginkgo/core/preconditioner/isai.hpp>
#include <ginkgo/core/preconditioner/jacobi.hpp>
#include <ginkgo/core/preconditioner/parse_limit.hpp>
#include <ginkgo/core/preconditioner/utils.hpp>

#include <ginkgo/core/reorder/amd.hpp>
#include <ginkgo/core/reorder/mc64.hpp>
Expand Down

0 comments on commit 435f87d

Please sign in to comment.