Transpose a matrix. More...
Functions | |
AFAPI array | transpose (const array &in, const bool conjugate=false) |
C++ Interface to transpose a matrix. More... | |
AFAPI void | transposeInPlace (array &in, const bool conjugate=false) |
C++ Interface to transpose a matrix in-place. More... | |
AFAPI af_err | af_transpose (af_array *out, af_array in, const bool conjugate) |
C Interface to transpose a matrix. More... | |
AFAPI af_err | af_transpose_inplace (af_array in, const bool conjugate) |
C Interface to transpose a matrix in-place. More... | |
Transpose a matrix.
Reverse or permute the dimensions of an array; returns the modified array. For an array a with two dimensions, transpose(a)
gives the matrix transpose. For an array with more than two dimensions, the first two dimensions are transposed across higher dimensions.
Set conjugate=true
to perform the complex conjugate transpose of a matrix which interchanges the row and column index for each element, reflecting the elements across the main diagonal and negating the imaginary part of any complex numbers. For example, if b = transpose(a, true)
and element a(2, 1)
is (1, 2)
, then element b(1, 2)
is (1, -2)
.
In-place versions perform matrix transposition by reordering the input, reducing memory footprint.
Examples:
C Interface to transpose a matrix.
[out] | out | transpose |
[in] | in | input array |
[in] | conjugate | if true, conjugate transposition is performed |
C Interface to transpose a matrix in-place.
[in,out] | in | input array to be transposed in-place |
[in] | conjugate | if true, conjugate transposition is performed |
C++ Interface to transpose a matrix.
[in] | in | input array |
[in] | conjugate | if true, conjugate transposition is performed |