Skip to content

Commit

Permalink
Add utility functions
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Oct 4, 2023
1 parent da56d7a commit d417175
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/utility/multiline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

0 comments on commit d417175

Please sign in to comment.