|
Ginkgo
Generated from pipelines/1556235455 branch based on develop. Ginkgo version 1.9.0
A numerical linear algebra library targeting many-core architectures
|
5 #ifndef GKO_PUBLIC_CORE_MATRIX_SCALED_PERMUTATION_HPP_
6 #define GKO_PUBLIC_CORE_MATRIX_SCALED_PERMUTATION_HPP_
11 #include <ginkgo/core/base/array.hpp>
12 #include <ginkgo/core/base/executor.hpp>
13 #include <ginkgo/core/base/lin_op.hpp>
14 #include <ginkgo/core/base/types.hpp>
15 #include <ginkgo/core/base/utils.hpp>
16 #include <ginkgo/core/matrix/permutation.hpp>
35 template <
typename ValueType = default_precision,
typename IndexType =
int32>
37 :
public EnableLinOp<ScaledPermutation<ValueType, IndexType>>,
42 using value_type = ValueType;
43 using index_type = IndexType;
101 std::unique_ptr<ScaledPermutation>
compose(
114 static std::unique_ptr<ScaledPermutation>
create(
115 std::shared_ptr<const Executor> exec,
size_type size = 0);
125 static std::unique_ptr<ScaledPermutation>
create(
137 static std::unique_ptr<ScaledPermutation>
create(
152 static std::unique_ptr<const ScaledPermutation>
create_const(
153 std::shared_ptr<const Executor> exec,
154 gko::detail::const_array_view<value_type>&& scale,
155 gko::detail::const_array_view<index_type>&& perm_idxs);
164 void apply_impl(
const LinOp* in,
LinOp* out)
const override;
167 LinOp* out)
const override;
178 #endif // GKO_PUBLIC_CORE_MATRIX_SCALED_PERMUTATION_HPP_
void write(gko::matrix_data< value_type, index_type > &data) const override
Writes a matrix to a matrix_data structure.
Definition: lin_op.hpp:117
const value_type * get_const_scaling_factors() const noexcept
Returns a pointer to the scaling factors.
Definition: scaled_permutation.hpp:59
ScaledPermutation is a matrix combining a permutation with scaling factors.
Definition: scaled_permutation.hpp:36
std::size_t size_type
Integral type used for allocation quantities.
Definition: types.hpp:86
std::unique_ptr< ScaledPermutation > compose(ptr_param< const ScaledPermutation > other) const
Composes this scaled permutation with another scaled permutation.
Permutation is a matrix format that represents a permutation matrix, i.e.
Definition: permutation.hpp:111
The Ginkgo namespace.
Definition: abstract_factory.hpp:20
static std::unique_ptr< ScaledPermutation > create(std::shared_ptr< const Executor > exec, size_type size=0)
Creates an uninitialized ScaledPermutation matrix.
const index_type * get_const_permutation() const noexcept
Returns a pointer to the permutation indices.
Definition: scaled_permutation.hpp:78
std::unique_ptr< ScaledPermutation > compute_inverse() const
Returns the inverse of this operator as a scaled permutation.
This structure is used as an intermediate data type to store a sparse matrix.
Definition: matrix_data.hpp:126
index_type * get_permutation() noexcept
Returns a pointer to the permutation indices.
Definition: scaled_permutation.hpp:69
static std::unique_ptr< const ScaledPermutation > create_const(std::shared_ptr< const Executor > exec, gko::detail::const_array_view< value_type > &&scale, gko::detail::const_array_view< index_type > &&perm_idxs)
Creates a constant (immutable) ScaledPermutation matrix from constant arrays.
This class is used for function parameters in the place of raw pointers.
Definition: utils_helper.hpp:41
value_type * get_data() noexcept
Returns a pointer to the block of memory used to store the elements of the array.
Definition: array.hpp:673
A LinOp implementing this interface can write its data to a matrix_data structure.
Definition: lin_op.hpp:660
const value_type * get_const_data() const noexcept
Returns a constant pointer to the block of memory used to store the elements of the array.
Definition: array.hpp:682
The EnableLinOp mixin can be used to provide sensible default implementations of the majority of the ...
Definition: lin_op.hpp:877
value_type * get_scaling_factors() noexcept
Returns a pointer to the scaling factors.
Definition: scaled_permutation.hpp:50
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition: polymorphic_object.hpp:661