Skip to content

Commit

Permalink
add support for view (although redudant, useful)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Sep 12, 2023
1 parent 18cf3b3 commit 75c363d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/datastructures/Positions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ import Base: ==, ≈
==(x::FramePositions, y::FramePositions) = ==(x.positions, y.positions)
(x::FramePositions, y::FramePositions; kargs...) = (x.positions, y.positions; kargs...)

import Base: view
view(positions::FramePositions, r::AbstractUnitRange) = FramePositions(@view(positions.positions[:,r]))


@testitem "FramePositions" begin
m = rand(3,10)
Expand Down

0 comments on commit 75c363d

Please sign in to comment.