https://github.com/chifisource/carouselarrays.jl
Repeating Arrays for Julia
https://github.com/chifisource/carouselarrays.jl
Last synced: over 1 year ago
JSON representation
Repeating Arrays for Julia
- Host: GitHub
- URL: https://github.com/chifisource/carouselarrays.jl
- Owner: ChifiSource
- License: mit
- Created: 2022-07-30T11:06:45.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-31T06:29:37.000Z (almost 4 years ago)
- Last Synced: 2025-02-25T18:52:25.944Z (over 1 year ago)
- Language: Julia
- Homepage:
- Size: 7.81 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Carousel Arrays
Carousel Arrays are Arrays that can be indexed repeatedly. Indexes below 1 will index starting with the end of the Vector, and indexes above the length of the Vector will index the beginning of the Vector.
```julia
julia> using CarouselArrays
julia> c = CarouselArray([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
CarouselArray{Int64}([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
julia> c[25]
5
julia> c[-8]
2
julia> c[-2]
8
julia> c[0]
10
```