![]() |
Ginkgo Generated from branch based on main. Ginkgo version 1.10.0
A numerical linear algebra library targeting many-core architectures
|
Linear operators which support permutation should implement the Permutable interface. More...
#include <ginkgo/core/base/lin_op.hpp>
Public Member Functions | |
virtual std::unique_ptr< LinOp > | permute (const array< IndexType > *permutation_indices) const |
Returns a LinOp representing the symmetric row and column permutation of the Permutable object. | |
virtual std::unique_ptr< LinOp > | inverse_permute (const array< IndexType > *permutation_indices) const |
Returns a LinOp representing the symmetric inverse row and column permutation of the Permutable object. | |
virtual std::unique_ptr< LinOp > | row_permute (const array< IndexType > *permutation_indices) const =0 |
Returns a LinOp representing the row permutation of the Permutable object. | |
virtual std::unique_ptr< LinOp > | column_permute (const array< IndexType > *permutation_indices) const =0 |
Returns a LinOp representing the column permutation of the Permutable object. | |
virtual std::unique_ptr< LinOp > | inverse_row_permute (const array< IndexType > *permutation_indices) const =0 |
Returns a LinOp representing the row permutation of the inverse permuted object. | |
virtual std::unique_ptr< LinOp > | inverse_column_permute (const array< IndexType > *permutation_indices) const =0 |
Returns a LinOp representing the row permutation of the inverse permuted object. |
Linear operators which support permutation should implement the Permutable interface.
It provides functions to permute the rows and columns of a LinOp, independently or symmetrically, and with a regular or inverted permutation.
After a regular row permutation with permutation array perm the row i in the output LinOp contains the row perm[i] from the input LinOp. After an inverse row permutation, the row perm[i] in the output LinOp contains the row i from the input LinOp. Equivalently, after a column permutation, the output stores in column i the column perm[i] from the input, and an inverse column permutation stores in column perm[i] the column i from the input. A symmetric permutation is functionally equivalent to calling as<Permutable>(A->row_permute(perm))->column_permute(perm), but the implementation can provide better performance due to kernel fusion.
|
pure virtual |
Returns a LinOp representing the column permutation of the Permutable object.
In the resulting LinOp, the column i contains the input column perm[i].
From the linear algebra perspective, with
permutation_indices | the array of indices containing the permutation order perm. |
Implemented in gko::matrix::Dense< ValueType >, gko::matrix::Dense< ValueType >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< value_type >, gko::matrix::Dense< value_type >, gko::matrix::Dense< ValueType >, and gko::matrix::Dense< ValueType >.
|
pure virtual |
Returns a LinOp representing the row permutation of the inverse permuted object.
In the resulting LinOp, the column perm[i] contains the input column i.
From the linear algebra perspective, with
permutation_indices | the array of indices containing the permutation order perm. |
Implemented in gko::matrix::Dense< ValueType >, gko::matrix::Dense< ValueType >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< value_type >, gko::matrix::Dense< value_type >, gko::matrix::Dense< ValueType >, and gko::matrix::Dense< ValueType >.
|
inlinevirtual |
Returns a LinOp representing the symmetric inverse row and column permutation of the Permutable object.
In the resulting LinOp, the entry at location (perm[i],perm[j]) contains the input value (i,j).
From the linear algebra perspective, with
permutation_indices | the array of indices containing the permutation order. |
Reimplemented in gko::matrix::Dense< ValueType >, gko::matrix::Dense< ValueType >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< value_type >, gko::matrix::Dense< value_type >, gko::matrix::Dense< ValueType >, and gko::matrix::Dense< ValueType >.
References gko::as(), and inverse_row_permute().
|
pure virtual |
Returns a LinOp representing the row permutation of the inverse permuted object.
In the resulting LinOp, the row perm[i] contains the input row i.
From the linear algebra perspective, with
permutation_indices | the array of indices containing the permutation order perm. |
Implemented in gko::matrix::Dense< ValueType >, gko::matrix::Dense< ValueType >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< value_type >, gko::matrix::Dense< value_type >, gko::matrix::Dense< ValueType >, and gko::matrix::Dense< ValueType >.
Referenced by inverse_permute().
|
inlinevirtual |
Returns a LinOp representing the symmetric row and column permutation of the Permutable object.
In the resulting LinOp, the entry at location (i,j) contains the input value (perm[i],perm[j]).
From the linear algebra perspective, with
permutation_indices | the array of indices containing the permutation order. |
Reimplemented in gko::matrix::Dense< ValueType >, gko::matrix::Dense< ValueType >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< value_type >, gko::matrix::Dense< value_type >, gko::matrix::Dense< ValueType >, and gko::matrix::Dense< ValueType >.
References gko::as(), and row_permute().
|
pure virtual |
Returns a LinOp representing the row permutation of the Permutable object.
In the resulting LinOp, the row i contains the input row perm[i].
From the linear algebra perspective, with
permutation_indices | the array of indices containing the permutation order. |
Implemented in gko::matrix::Dense< ValueType >, gko::matrix::Dense< ValueType >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< absolute_type >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< remove_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< to_complex< ValueType > >, gko::matrix::Dense< value_type >, gko::matrix::Dense< value_type >, gko::matrix::Dense< ValueType >, and gko::matrix::Dense< ValueType >.
Referenced by permute().