|
Ginkgo
Generated from pipelines/1561425956 branch based on develop. Ginkgo version 1.9.0
A numerical linear algebra library targeting many-core architectures
|
5 #ifndef GKO_PUBLIC_CORE_MATRIX_PERMUTATION_HPP_
6 #define GKO_PUBLIC_CORE_MATRIX_PERMUTATION_HPP_
14 #include <ginkgo/core/base/array.hpp>
15 #include <ginkgo/core/base/exception.hpp>
16 #include <ginkgo/core/base/exception_helpers.hpp>
17 #include <ginkgo/core/base/executor.hpp>
18 #include <ginkgo/core/base/lin_op.hpp>
19 #include <ginkgo/core/base/types.hpp>
20 #include <ginkgo/core/base/utils.hpp>
92 static constexpr mask_type row_permute = mask_type{1};
93 GKO_DEPRECATED(
"permute mask is no longer supported")
94 static constexpr mask_type column_permute = mask_type{1 << 2};
95 GKO_DEPRECATED(
"permute mask is no longer supported")
96 static constexpr mask_type inverse_permute = mask_type{1 << 3};
110 template <
typename IndexType =
int32>
118 using index_type = IndexType;
146 GKO_DEPRECATED(
"use get_size()[0] instead")
149 GKO_DEPRECATED("permute mask is no longer supported")
150 mask_type get_permute_mask() const;
152 GKO_DEPRECATED("permute mask is no longer supported")
153 void set_permute_mask(mask_type permute_mask);
205 std::shared_ptr<const
Executor> exec,
206 array<IndexType> permutation_indices);
209 "
dim<2> is no longer supported
as a dimension parameter, use
size_type "
212 std::shared_ptr<const
Executor> exec, const
dim<2>& size);
214 GKO_DEPRECATED("permute mask is no longer supported")
216 std::shared_ptr<const
Executor> exec, const
dim<2>& size,
217 const mask_type& enabled_permute);
219 GKO_DEPRECATED("use the overload without dimensions")
221 std::shared_ptr<const
Executor> exec, const
dim<2>& size,
222 array<IndexType> permutation_indices);
224 GKO_DEPRECATED("permute mask is no longer supported")
226 std::shared_ptr<const
Executor> exec, const
dim<2>& size,
227 array<index_type> permutation_indices,
228 const mask_type& enabled_permute);
241 GKO_DEPRECATED("use
create_const without size and permute mask")
244 gko::detail::const_array_view<IndexType>&& perm_idxs,
245 mask_type enabled_permute = row_permute);
258 std::shared_ptr<const
Executor> exec,
259 gko::detail::const_array_view<IndexType>&& perm_idxs);
265 array<IndexType> permutation_indices);
267 void apply_impl(const
LinOp* in,
LinOp* out) const override;
270 LinOp* out) const override;
273 array<index_type> permutation_;
281 #endif // GKO_PUBLIC_CORE_MATRIX_PERMUTATION_HPP_
void write(gko::matrix_data< value_type, index_type > &data) const override
Writes a matrix to a matrix_data structure.
index_type * get_permutation() noexcept
Returns a pointer to the array of permutation.
Definition: permutation.hpp:125
The rows will be permuted.
Definition: lin_op.hpp:117
The columns will be permuted.
std::ostream & operator<<(std::ostream &stream, permute_mode mode)
Prints a permutation mode.
permute_mode operator^(permute_mode a, permute_mode b)
Computes the symmetric difference of two permutation modes.
The columns will be permuted using the inverse permutation.
std::size_t size_type
Integral type used for allocation quantities.
Definition: types.hpp:86
Permutation is a matrix format that represents a permutation matrix, i.e.
Definition: permutation.hpp:111
Neither rows nor columns will be permuted.
const index_type * get_const_permutation() const noexcept
Returns a pointer to the array of permutation.
Definition: permutation.hpp:134
The Ginkgo namespace.
Definition: abstract_factory.hpp:20
permute_mode operator|(permute_mode a, permute_mode b)
Combines two permutation modes.
An array is a container which encapsulates fixed-sized arrays, stored on the Executor tied to the arr...
Definition: array.hpp:26
A type representing the dimensions of a multidimensional object.
Definition: dim.hpp:26
This structure is used as an intermediate data type to store a sparse matrix.
Definition: matrix_data.hpp:126
std::decay_t< T > * as(U *obj)
Performs polymorphic type conversion.
Definition: utils_helper.hpp:307
The rows and columns will be permuted using the inverse permutation.
This class is used for function parameters in the place of raw pointers.
Definition: utils_helper.hpp:41
permute_mode operator&(permute_mode a, permute_mode b)
Computes the intersection of two permutation modes.
The permutation will be inverted before being applied.
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
static std::unique_ptr< const Permutation > create_const(std::shared_ptr< const Executor > exec, size_type size, gko::detail::const_array_view< IndexType > &&perm_idxs, mask_type enabled_permute=row_permute)
Creates a constant (immutable) Permutation matrix from a constant array.
A LinOp implementing this interface can write its data to a matrix_data structure.
Definition: lin_op.hpp:660
The rows and columns will be permuted.
std::unique_ptr< Permutation > compute_inverse() const
Returns the inverse permutation.
static std::unique_ptr< Permutation > create(std::shared_ptr< const Executor > exec, size_type size=0)
Creates an uninitialized Permutation arrays on the specified executor.
mode
The mode for the residual norm criterion.
Definition: residual_norm.hpp:36
size_type get_permutation_size() const noexcept
Returns the number of elements explicitly stored in the permutation array.
double default_precision
Precision used if no precision is explicitly specified.
Definition: types.hpp:171
std::unique_ptr< Permutation > compose(ptr_param< const Permutation > other) const
Composes this permutation with another permutation.
The first step in using the Ginkgo library consists of creating an executor.
Definition: executor.hpp:615
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
permute_mode
Specifies how a permutation will be applied to a matrix.
Definition: permutation.hpp:42
std::uint64_t uint64
64-bit unsigned integral type.
Definition: types.hpp:132
The EnableLinOp mixin can be used to provide sensible default implementations of the majority of the ...
Definition: lin_op.hpp:877
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition: polymorphic_object.hpp:661
The rows will be permuted using the inverse permutation.