5#ifndef GKO_PUBLIC_CORE_SOLVER_DIRECT_HPP_
6#define GKO_PUBLIC_CORE_SOLVER_DIRECT_HPP_
9#include <ginkgo/core/base/lin_op.hpp>
10#include <ginkgo/core/factorization/factorization.hpp>
11#include <ginkgo/core/solver/solver_base.hpp>
12#include <ginkgo/core/solver/triangular.hpp>
16namespace experimental {
30template <
typename ValueType,
typename IndexType>
33 Direct<ValueType, IndexType>,
34 factorization::Factorization<ValueType, IndexType>>,
39 using value_type = ValueType;
40 using index_type = IndexType;
62 std::shared_ptr<const LinOpFactory> GKO_DEFERRED_FACTORY_PARAMETER(
79 explicit Direct(std::shared_ptr<const Executor> exec);
81 Direct(
const Factory* factory, std::shared_ptr<const LinOp> system_matrix);
83 void apply_impl(
const LinOp* b,
LinOp* x)
const override;
86 LinOp* x)
const override;
92 std::unique_ptr<lower_type> lower_solver_;
93 std::unique_ptr<upper_type> upper_solver_;
104template <
typename ValueType,
typename IndexType>
109 static int num_vectors(
const Solver&);
111 static int num_arrays(
const Solver&);
113 static std::vector<std::string> op_names(
const Solver&);
115 static std::vector<std::string> array_names(
const Solver&);
117 static std::vector<int> scalars(
const Solver&);
119 static std::vector<int> vectors(
const Solver&);
122 constexpr static int intermediate = 0;
The EnableLinOp mixin can be used to provide sensible default implementations of the majority of the ...
Definition lin_op.hpp:880
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition polymorphic_object.hpp:663
Definition lin_op.hpp:118
Linear operators which support transposition should implement the Transposable interface.
Definition lin_op.hpp:434
The enable_parameters_type mixin is used to create a base implementation of the factory parameters st...
Definition abstract_factory.hpp:211
Represents a generic factorization consisting of two triangular factors (upper and lower) and an opti...
Definition factorization.hpp:76
A direct solver based on a factorization into lower and upper triangular factors (with an optional di...
Definition direct.hpp:35
Direct(const Direct &)
Creates a copy of the solver.
std::unique_ptr< LinOp > conj_transpose() const override
Returns a LinOp representing the conjugate transpose of the Transposable object.
std::unique_ptr< LinOp > transpose() const override
Returns a LinOp representing the transpose of the Transposable object.
Direct(Direct &&)
Moves from the given solver, leaving it empty.
A LinOp deriving from this CRTP class stores a system matrix.
Definition solver_base.hpp:542
LowerTrs is the triangular solver which solves the system L x = b, when L is a lower triangular matri...
Definition triangular.hpp:67
UpperTrs is the triangular solver which solves the system U x = b, when U is an upper triangular matr...
Definition triangular.hpp:217
#define GKO_FACTORY_PARAMETER_SCALAR(_name, _default)
Creates a scalar factory parameter in the factory parameters structure.
Definition abstract_factory.hpp:445
#define GKO_ENABLE_BUILD_METHOD(_factory_name)
Defines a build method for the factory, simplifying its construction by removing the repetitive typin...
Definition abstract_factory.hpp:394
#define GKO_ENABLE_LIN_OP_FACTORY(_lin_op, _parameters_name, _factory_name)
This macro will generate a default implementation of a LinOpFactory for the LinOp subclass it is defi...
Definition lin_op.hpp:1018
The Ginkgo namespace.
Definition abstract_factory.hpp:20
constexpr T one()
Returns the multiplicative identity for T.
Definition math.hpp:775
std::size_t size_type
Integral type used for allocation quantities.
Definition types.hpp:92
std::shared_ptr< const LinOpFactory > factorization
The factorization factory to use for generating the factors.
Definition direct.hpp:63
gko::size_type num_rhs
Number of right hand sides.
Definition direct.hpp:59
Traits class providing information on the type and location of workspace vectors inside a solver.
Definition solver_base.hpp:239