5#ifndef GKO_PUBLIC_CORE_FACTORIZATION_FACTORIZATION_HPP_
6#define GKO_PUBLIC_CORE_FACTORIZATION_FACTORIZATION_HPP_
9#include <ginkgo/core/base/composition.hpp>
10#include <ginkgo/core/base/lin_op.hpp>
11#include <ginkgo/core/base/types.hpp>
12#include <ginkgo/core/matrix/csr.hpp>
13#include <ginkgo/core/matrix/diagonal.hpp>
17namespace experimental {
18namespace factorization {
25enum class storage_type {
52 symm_combined_cholesky,
75template <
typename ValueType,
typename IndexType>
80 using value_type = ValueType;
81 using index_type = IndexType;
94 std::unique_ptr<Factorization>
unpack()
const;
143 std::unique_ptr<composition_type> composition);
156 std::unique_ptr<composition_type> composition);
170 std::unique_ptr<matrix_type>
matrix);
172 static std::unique_ptr<Factorization> create_from_combined_ldu(
173 std::unique_ptr<matrix_type>
matrix);
175 static std::unique_ptr<Factorization> create_from_combined_cholesky(
176 std::unique_ptr<matrix_type>
matrix);
178 static std::unique_ptr<Factorization> create_from_combined_ldl(
179 std::unique_ptr<matrix_type>
matrix);
182 explicit Factorization(std::shared_ptr<const Executor> exec);
187 void apply_impl(
const LinOp* b,
LinOp* x)
const override;
190 LinOp* x)
const override;
193 storage_type storage_type_;
194 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:41
The EnableLinOp mixin can be used to provide sensible default implementations of the majority of the ...
Definition lin_op.hpp:879
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition polymorphic_object.hpp:668
LinOp(const LinOp &)=default
Copy-constructs a LinOp.
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:126
This class is a utility which efficiently implements the diagonal matrix (a linear operator which sca...
Definition diagonal.hpp:56
The matrix namespace.
Definition dense_cache.hpp:24
The Ginkgo namespace.
Definition abstract_factory.hpp:20