Home > manopt > tools > multitransp.m

multitransp

PURPOSE ^

Transpose the matrix slices of an N-D array (no complex conjugate)

SYNOPSIS ^

function B = multitransp(A, unused) %#ok

DESCRIPTION ^

 Transpose the matrix slices of an N-D array (no complex conjugate)

 function B = multitransp(A)

 If A is a 3-D array, then B is a 3-D array such that

     B(:, :, i) = A(:, :, i).'

 for each i. If A is an N-D array, then B is an N-D array with the slices
 A(:, :, i, j, k, ...) transposed.

 This function is just a wrapper for pagetranspose, with a fallback call
 to multitransp_legacy in case pagetranspose is not available.
 If pagetranspose is available, it is better to call it directly.
 Note that pagemtimes also allows to compute products with transposes
 without explicitly transposing arrays.

 See also: multiprod multihconj multiscale multiskew multiskewh multitrace

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function B = multitransp(A, unused) %#ok<INUSD>
0002 % Transpose the matrix slices of an N-D array (no complex conjugate)
0003 %
0004 % function B = multitransp(A)
0005 %
0006 % If A is a 3-D array, then B is a 3-D array such that
0007 %
0008 %     B(:, :, i) = A(:, :, i).'
0009 %
0010 % for each i. If A is an N-D array, then B is an N-D array with the slices
0011 % A(:, :, i, j, k, ...) transposed.
0012 %
0013 % This function is just a wrapper for pagetranspose, with a fallback call
0014 % to multitransp_legacy in case pagetranspose is not available.
0015 % If pagetranspose is available, it is better to call it directly.
0016 % Note that pagemtimes also allows to compute products with transposes
0017 % without explicitly transposing arrays.
0018 %
0019 % See also: multiprod multihconj multiscale multiskew multiskewh multitrace
0020 
0021 % This file is part of Manopt: www.manopt.org.
0022 % Original author: Nicolas Boumal, Aug. 12, 2021.
0023 % Contributors: Xiaowen Jiang
0024 % Change log:
0025 %
0026 %   Aug. 12, 2021 (NB):
0027 %       Matlab R2020b introduced a built-in function pagetranspose which
0028 %       does essentially everything we ever needed to do with multitransp
0029 %       in Manopt. Accordingly, multitransp became a wrapper for
0030 %       pagetranspose, and the old code for multitransp remains available
0031 %       as multitransp_legacy.
0032 
0033     assert(nargin == 1, ...
0034            'The new multitransp only takes one input. Check multitransp_legacy.');
0035 
0036     if exist('pagetranspose', 'file') % Added to Matlab R2020b
0037         B = pagetranspose(A);
0038     else
0039     %   warning('manopt:multi', ...
0040     %          ['Matlab R2020b introduced pagetranspose.\n' ...
0041     %           'Calling the old code multitransp_legacy instead.\n' ...
0042     %           'To disable this warning: warning(''off'', ''manopt:multi'')']);
0043         B = multitransp_legacy(A);
0044     end
0045 
0046 end

Generated on Fri 30-Sep-2022 13:18:25 by m2html © 2005