ArrayRotations._copy!
— Method_copy!(dst::AbstractVector, dst_sp::Integer, src::AbstractVector, src_sp::Integer, n::Integer)
Copies n
contiguous elements from src
(starting at src_sp
) into dst
(starting at dst_sp
).
ArrayRotations._interchange_left_large!
— Method_interchange_left_large!(A::AbstractVector, buff::AbstractVector, tail::Integer)
Interchange and shift two subarrays
buffer
-----
4 5 6 7 8 9 1 2 3
----- |
head tail
must produce
prev head
-----
1 2 3 4 5 6 1 2 3
----- -----
prev tail untouched
and finally, the buffer should be copied-back
prev head
-----
1 2 3 4 5 6 7 8 9
----- -----
prev tail from buffer
ArrayRotations._interchange_right_large!
— Method_interchange_right_large!(A::AbstractVector, buff::AbstractVector, tail::Integer)
Interchange and shift two subarrays
head buffer
----- -----
7 8 9 1 2 3 4 5 6
|
tail
must produce
prev tail prev head
----- -----
1 2 3 1 2 3 7 8 9
-----
untouched
The centering block is then filled with the buffer.
ArrayRotations._left_shift!
— Method_left_shift!(A::AbstractVector, sp)
Shifts A[sp:end]
to the beggining of A
ArrayRotations._right_shift!
— Method_right_shift!(A::AbstractVector, ep)
Shifts A[1:ep]
to the end of A
ArrayRotations.rotate!
— Methodrotate!(::AuxRotation, A::AbstractVector, tailpos::Integer)
Rotates A
on tailpos
using at most n / 2
extra memory, 3n/2 copy-write ops.
ArrayRotations.rotate!
— Methodrotate!(bridge::BridgeRotation, A::AbstractVector, tailpos::Integer)
Rotates A
on tailpos
using a small extra memory. ≤ a third of A and ≤ than n+n/3 copy-write ops.
ArrayRotations.rotate!
— Methodrotate!(aux::GriesMillsRotation, A::AbstractVector, tailpos::Integer)
Rotates A
on tailpos
using a O(1) extra memory
ArrayRotations.rotate!
— Methodrotate!(::RevRotation, A::AbstractVector, tailpos::Integer)
Rotates A
on tailpos
using $O(1)$ extra memory, yet using several 2n copy-write ops (triple reversing)