33#ifndef GKO_PUBLIC_CORE_FACTORIZATION_FACTORIZATION_HPP_
34#define GKO_PUBLIC_CORE_FACTORIZATION_FACTORIZATION_HPP_
37#include <ginkgo/core/base/composition.hpp>
38#include <ginkgo/core/base/lin_op.hpp>
39#include <ginkgo/core/base/types.hpp>
40#include <ginkgo/core/matrix/csr.hpp>
41#include <ginkgo/core/matrix/diagonal.hpp>
45namespace experimental {
46namespace factorization {
53enum class storage_type {
80 symm_combined_cholesky,
103template <
typename ValueType,
typename IndexType>
108 using value_type = ValueType;
109 using index_type = IndexType;
122 std::unique_ptr<Factorization>
unpack()
const;
171 std::unique_ptr<composition_type> composition);
184 std::unique_ptr<composition_type> composition);
198 std::unique_ptr<matrix_type> matrix);
200 static std::unique_ptr<Factorization> create_from_combined_ldu(
201 std::unique_ptr<matrix_type> matrix);
203 static std::unique_ptr<Factorization> create_from_combined_cholesky(
204 std::unique_ptr<matrix_type> matrix);
206 static std::unique_ptr<Factorization> create_from_combined_ldl(
207 std::unique_ptr<matrix_type> matrix);
210 explicit Factorization(std::shared_ptr<const Executor> exec);
215 void apply_impl(
const LinOp* b,
LinOp* x)
const override;
218 LinOp* x)
const override;
221 storage_type storage_type_;
222 std::unique_ptr<Composition<ValueType>> factors_;
The Composition class can be used to compose linear operators op1, op2, ..., opn and obtain the opera...
Definition composition.hpp:69
The EnableLinOp mixin can be used to provide sensible default implementations of the majority of the ...
Definition lin_op.hpp:908
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition polymorphic_object.hpp:691
Definition lin_op.hpp:146
Represents a generic factorization consisting of two triangular factors (upper and lower) and an opti...
Definition factorization.hpp:104
std::shared_ptr< const matrix_type > get_lower_factor() const
Returns the lower triangular factor of the factorization, if available, nullptr otherwise.
std::shared_ptr< const diag_type > get_diagonal() const
Returns the diagonal scaling matrix of the factorization, if available, nullptr otherwise.
static std::unique_ptr< Factorization > create_from_composition(std::unique_ptr< composition_type > composition)
Creates a Factorization from an existing composition.
std::shared_ptr< const matrix_type > get_upper_factor() const
Returns the upper triangular factor of the factorization, if available, nullptr otherwise.
storage_type get_storage_type() const
Returns the storage type used by this factorization.
Factorization(const Factorization &)
Creates a deep copy of the factorization.
static std::unique_ptr< Factorization > create_from_symm_composition(std::unique_ptr< composition_type > composition)
Creates a Factorization from an existing symmetric composition.
std::shared_ptr< const matrix_type > get_combined() const
Returns the matrix storing a compact representation of the factorization, if available,...
std::unique_ptr< Factorization > unpack() const
Transforms the factorization from a compact representation suitable only for triangular solves to a c...
static std::unique_ptr< Factorization > create_from_combined_lu(std::unique_ptr< matrix_type > matrix)
Creates a Factorization from an existing combined representation of an LU factorization.
Factorization(Factorization &&)
Moves from the given factorization, leaving it empty.
CSR is a matrix format which stores only the nonzero coefficients by compressing each row of the matr...
Definition csr.hpp:146
This class is a utility which efficiently implements the diagonal matrix (a linear operator which sca...
Definition diagonal.hpp:79
The Ginkgo namespace.
Definition abstract_factory.hpp:48
constexpr T one()
Returns the multiplicative identity for T.
Definition math.hpp:803