# CartesianIndex and linear index

**URL:** <https://discourse.julialang.org/t/cartesianindex-and-linear-index/7255>\
**Category:** Internals & Design\
**Tags:** proposal\
**Created:** [November 22, 2017, 7:59pm UTC](https://discourse.julialang.org/t/cartesianindex-and-linear-index/7255 "2017-11-22T19:59:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [November 22, 2017, 7:59pm UTC](https://discourse.julialang.org/t/cartesianindex-and-linear-index/7255/1 "2017-11-22T19:59:32Z")

</div>

In light of the `CartesianIndex` type, has anyone considered a `LinearIndex` type? Could be cool to convert between the two. They would need to contain a reference to the size of the container they index into. We could have methods for changing/reshaping the container’s size. I see some methods that specialize on `CartesianIndex` popping up, but we could have them specialize on an abstract `Index` type… Since they are indices, we could change their type to an `UInt`…?

Anyways, just rambling…

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [November 23, 2017, 9:13am UTC](https://discourse.julialang.org/t/cartesianindex-and-linear-index/7255/2 "2017-11-23T09:13:50Z")

</div>

After reading [this post](https://julialang.org/blog/2016/02/iteration) and some posts here on Discourse, I realized a few things.
