# Circular array in Julia

**URL:** <https://discourse.julialang.org/t/circular-array-in-julia/25588>\
**Category:** Geo\
**Created:** [June 24, 2019, 12:51am UTC](https://discourse.julialang.org/t/circular-array-in-julia/25588 "2019-06-24T00:51:59Z")\
**Posts on this page:** 1\
**Showing post:** 27

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [November 10, 2021, 1:23am UTC](https://discourse.julialang.org/t/circular-array-in-julia/25588/27 "2021-11-10T01:23:33Z")

</div>

Note that with this type of approach (as in CircularArrays.jl and CyclicArrays.jl), you pay a computational price for _every_ `getindex` operations (for a `mod` in CircularArrays and a much more expensive calculation in CyclicArrays).

In many circumstances, you don’t need to access the array at _arbitrary_ indices, but only at indices in the interior and _just_ outside the boundary, and in such cases you can get both greater efficiency and greater flexibility (in topology etcetera) [by using ghost cells](https://discourse.julialang.org/t/arrays-with-periodic-boundaries/4015/4).

---

_[View the full topic](https://discourse.julialang.org/t/circular-array-in-julia/25588)._
