5#ifndef GKO_PUBLIC_CORE_SOLVER_TRIANGULAR_HPP_
6#define GKO_PUBLIC_CORE_SOLVER_TRIANGULAR_HPP_
12#include <ginkgo/core/base/abstract_factory.hpp>
13#include <ginkgo/core/base/array.hpp>
14#include <ginkgo/core/base/dim.hpp>
15#include <ginkgo/core/base/exception_helpers.hpp>
16#include <ginkgo/core/base/lin_op.hpp>
17#include <ginkgo/core/base/polymorphic_object.hpp>
18#include <ginkgo/core/base/types.hpp>
19#include <ginkgo/core/base/utils.hpp>
20#include <ginkgo/core/config/config.hpp>
21#include <ginkgo/core/config/registry.hpp>
22#include <ginkgo/core/log/logger.hpp>
23#include <ginkgo/core/matrix/csr.hpp>
24#include <ginkgo/core/matrix/identity.hpp>
25#include <ginkgo/core/solver/solver_base.hpp>
43template <
typename ValueType,
typename IndexType>
63template <
typename ValueType = default_precision,
typename IndexType =
int32>
66 matrix::Csr<ValueType, IndexType>>,
70 friend class UpperTrs<ValueType, IndexType>;
73 using value_type = ValueType;
74 using index_type = IndexType;
104 algorithm, trisolve_algorithm::sparselib);
125 config::make_type_descriptor<ValueType, IndexType>());
159 void apply_impl(
const LinOp* b,
LinOp* x)
const override;
162 LinOp* x)
const override;
170 explicit LowerTrs(std::shared_ptr<const Executor> exec)
174 explicit LowerTrs(
const Factory* factory,
175 std::shared_ptr<const LinOp> system_matrix)
179 copy_and_convert_to<CsrMatrix>(factory->get_executor(),
181 parameters_{factory->get_parameters()}
187 std::shared_ptr<solver::SolveStruct> solve_struct_;
191template <
typename ValueType,
typename IndexType>
195 static int num_vectors(
const Solver&);
197 static int num_arrays(
const Solver&);
199 static std::vector<std::string> op_names(
const Solver&);
201 static std::vector<std::string> array_names(
const Solver&);
203 static std::vector<int> scalars(
const Solver&);
205 static std::vector<int> vectors(
const Solver&);
208 constexpr static int transposed_b = 0;
210 constexpr static int transposed_x = 1;
230template <
typename ValueType = default_precision,
typename IndexType =
int32>
233 matrix::Csr<ValueType, IndexType>>,
237 friend class LowerTrs<ValueType, IndexType>;
240 using value_type = ValueType;
241 using index_type = IndexType;
271 algorithm, trisolve_algorithm::sparselib);
292 config::make_type_descriptor<ValueType, IndexType>());
326 void apply_impl(
const LinOp* b,
LinOp* x)
const override;
329 LinOp* x)
const override;
337 explicit UpperTrs(std::shared_ptr<const Executor> exec)
341 explicit UpperTrs(
const Factory* factory,
342 std::shared_ptr<const LinOp> system_matrix)
346 copy_and_convert_to<CsrMatrix>(factory->get_executor(),
348 parameters_{factory->get_parameters()}
354 std::shared_ptr<solver::SolveStruct> solve_struct_;
358template <
typename ValueType,
typename IndexType>
362 static int num_vectors(
const Solver&);
364 static int num_arrays(
const Solver&);
366 static std::vector<std::string> op_names(
const Solver&);
368 static std::vector<std::string> array_names(
const Solver&);
370 static std::vector<int> scalars(
const Solver&);
372 static std::vector<int> vectors(
const Solver&);
375 constexpr static int transposed_b = 0;
377 constexpr static int transposed_x = 1;
Definition lin_op.hpp:878
Definition polymorphic_object.hpp:668
Definition lin_op.hpp:117
std::shared_ptr< const Executor > get_executor() const noexcept
Definition polymorphic_object.hpp:243
Definition lin_op.hpp:433
Definition property_tree.hpp:28
Definition registry.hpp:167
Definition type_descriptor.hpp:39
Definition solver_base.hpp:539
Definition triangular.hpp:106
Definition triangular.hpp:67
LowerTrs & operator=(LowerTrs &&)
static parameters_type parse(const config::pnode &config, const config::registry &context, const config::type_descriptor &td_for_child=config::make_type_descriptor< ValueType, IndexType >())
LowerTrs(const LowerTrs &)
std::unique_ptr< LinOp > transpose() const override
LowerTrs & operator=(const LowerTrs &)
std::unique_ptr< LinOp > conj_transpose() const override
Definition triangular.hpp:273
Definition triangular.hpp:234
UpperTrs(const UpperTrs &)
std::unique_ptr< LinOp > conj_transpose() const override
UpperTrs & operator=(UpperTrs &&)
std::unique_ptr< LinOp > transpose() const override
UpperTrs & operator=(const UpperTrs &)
static parameters_type parse(const config::pnode &config, const config::registry &context, const config::type_descriptor &td_for_child=config::make_type_descriptor< ValueType, IndexType >())
#define GKO_CREATE_FACTORY_PARAMETERS(_parameters_name, _factory_name)
Definition abstract_factory.hpp:280
#define GKO_FACTORY_PARAMETER_SCALAR(_name, _default)
Definition abstract_factory.hpp:445
#define GKO_ENABLE_BUILD_METHOD(_factory_name)
Definition abstract_factory.hpp:394
#define GKO_ENABLE_LIN_OP_FACTORY(_lin_op, _parameters_name, _factory_name)
Definition lin_op.hpp:1016
trisolve_algorithm
Definition triangular.hpp:40
The Ginkgo namespace.
Definition abstract_factory.hpp:20
std::size_t size_type
Definition types.hpp:89
Definition triangular.hpp:82
Definition triangular.hpp:249
Definition solver_base.hpp:238