From d41717583c60874594a746db55b58ca92ba799fc Mon Sep 17 00:00:00 2001 From: lkdvos Date: Wed, 4 Oct 2023 12:28:35 +0200 Subject: [PATCH] Add utility functions --- src/utility/multiline.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/utility/multiline.jl b/src/utility/multiline.jl index 821d1275..93d51201 100644 --- a/src/utility/multiline.jl +++ b/src/utility/multiline.jl @@ -30,3 +30,12 @@ Base.setindex!(m::Multiline, v, i::Int) = (setindex!(parent(m), v, i); m) Base.copy(m::Multiline) = Multiline(map(copy, parent(m))) Base.iterate(m::Multiline, args...) = iterate(parent(m), args...) + +# Utility functions +# ----------------- +Base.circshift(A::Multiline, n::Int) = Multiline(circshift(parent(A), n)) +function Base.circshift(A::Multiline, shifts::Tuple{Int,Int}) + data′ = circshift.(parent(A), shifts[2]) + return Multiline(circshift!(data′, shifts[1])) +end +Base.reverse(A::Multiline) = Multiline(reverse(parent(A)))