Ginkgo Generated from develop branch based on develop. Ginkgo version 1.8.0
A numerical linear algebra library targeting many-core architectures
Loading...
Searching...
No Matches
cholesky.hpp
1// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#include <memory>
6
7
8#include <ginkgo/core/base/composition.hpp>
9#include <ginkgo/core/base/lin_op.hpp>
10#include <ginkgo/core/base/polymorphic_object.hpp>
11#include <ginkgo/core/factorization/factorization.hpp>
12#include <ginkgo/core/matrix/csr.hpp>
13#include <ginkgo/core/matrix/sparsity_csr.hpp>
14
15
16namespace gko {
17namespace experimental {
18namespace factorization {
19
20
31template <typename ValueType, typename IndexType>
33 : public EnablePolymorphicObject<Cholesky<ValueType, IndexType>,
34 LinOpFactory>,
35 public EnablePolymorphicAssignment<Cholesky<ValueType, IndexType>> {
36public:
37 struct parameters_type;
40
41 using value_type = ValueType;
42 using index_type = IndexType;
46
48 : public enable_parameters_type<parameters_type, Cholesky> {
55 std::shared_ptr<const sparsity_pattern_type>
57
69 };
70
76 const parameters_type& get_parameters() { return parameters_; }
77
85 std::unique_ptr<factorization_type> generate(
86 std::shared_ptr<const LinOp> system_matrix) const;
87
89 static parameters_type build() { return {}; }
90
91protected:
92 explicit Cholesky(std::shared_ptr<const Executor> exec,
93 const parameters_type& params = {});
94
95 std::unique_ptr<LinOp> generate_impl(
96 std::shared_ptr<const LinOp> system_matrix) const override;
97
98private:
99 parameters_type parameters_;
100};
101
102
103} // namespace factorization
104} // namespace experimental
105} // namespace gko
This mixin is used to enable a default PolymorphicObject::copy_from() implementation for objects that...
Definition polymorphic_object.hpp:724
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition polymorphic_object.hpp:663
A LinOpFactory represents a higher order mapping which transforms one linear operator into another.
Definition lin_op.hpp:386
The enable_parameters_type mixin is used to create a base implementation of the factory parameters st...
Definition abstract_factory.hpp:211
Computes a Cholesky factorization of a symmetric, positive-definite sparse matrix.
Definition cholesky.hpp:35
static parameters_type build()
Creates a new parameter_type to set up the factory.
Definition cholesky.hpp:89
const parameters_type & get_parameters()
Returns the parameters used to construct the factory.
Definition cholesky.hpp:76
std::unique_ptr< factorization_type > generate(std::shared_ptr< const LinOp > system_matrix) const
Represents a generic factorization consisting of two triangular factors (upper and lower) and an opti...
Definition factorization.hpp:76
CSR is a matrix format which stores only the nonzero coefficients by compressing each row of the matr...
Definition csr.hpp:117
SparsityCsr is a matrix format which stores only the sparsity pattern of a sparse matrix by compressi...
Definition sparsity_csr.hpp:57
#define GKO_FACTORY_PARAMETER_SCALAR(_name, _default)
Creates a scalar factory parameter in the factory parameters structure.
Definition abstract_factory.hpp:445
The Ginkgo namespace.
Definition abstract_factory.hpp:20
constexpr T one()
Returns the multiplicative identity for T.
Definition math.hpp:775
std::shared_ptr< const sparsity_pattern_type > symbolic_factorization
The combined sparsity pattern L + L^H of the factors L and L^H.
Definition cholesky.hpp:56
bool skip_sorting
The system_matrix, which will be given to this factory, must be sorted (first by row,...
Definition cholesky.hpp:68