Expression template for reordering tensor dimensions according to a specified permutation.
More...
template<Expression Source, Integral ... Indexes>
class tannic::expression::Permutation< Source, Indexes >
Expression template for reordering tensor dimensions according to a specified permutation.
- Template Parameters
-
Source | The expression or tensor type being permuted. |
Indexes | A parameter pack of integral indices defining the permutation order. |
The Permutation
view reorders the dimensions of a tensor according to a user-specified sequence of indices. This changes how elements are accessed along each axis, but does not move the underlying data in memory.
Example:
A multidimensional, strided tensor data structure.
Definition: tensor.hpp:105
constexpr auto permute(Source &&source, Indexes... indexes)
Creates a permuted view of a tensor or expression.
Definition: views.hpp:880
- Note
- The number of indices in the permutation must match the rank of the tensor. Otherwise, an exception is thrown.