If swap
is not Boolean, it is equivalent to 1:n %in%
swap
(where n
is the number of dimensions). Thus multiple
entries are ignored, as are entries greater than n
.
If a
is a vector, rev(a)
is returned.
Function arev()
handles zero-extent dimensions as expected.
Function arev()
does not treat singleton dimensions specially,
and is thus different from Octave's flipdim()
, which (if
supplied with no second argument) flips the first nonsingleton
dimension. To reproduce this, use arev(a,fnsd(a))
.