Rearrangement algorithm for all modes
All_rearrange(ten, except = "NA", key = "NA")A list of two objects, a rearranged tensor and a list of indices rearranged (ordered by the rearranged modes)
A multi-dimensional array
A vector of integers implying the modes not to rearrange, set as 'NA' by default
The value to which rearrange is according, set as 'NA' by default
A rearrangement algorithm on higher order tensor to rearrange all missing entries to a corner block. The case of mode-2 tensor returns to the work of Bai and Ng in 2021.