For something somewhat related, there is AxisArrays, a relatively new
package that isn't registered in METADATA, yet:
https://github.com/mbauman/AxisArrays.jl
It's different in that axes of an array can be indexed into with strings or
symbols. There is a plan to add something like IndexedArray as an axis type
for faster lookups:
https://github.com/mbauman/AxisArrays.jl/issues/7
Also related is some work in Base that may make something like this
possible with the default Dict:
https://github.com/JuliaLang/julia/pull/10116
On Thu, Feb 26, 2015 at 11:43 PM, Jim Garrison <[email protected]> wrote:
> I made an `IndexedArrays` package with an `IndexedArray` data structure.
> This acts like a `Vector` of unique elements, but also maintains the
> reverse mapping in a dictionary that is updated in sync with the vector,
> allowing for quick lookup of the index of any element. A simple example is
> probably more useful:
>
> julia> using IndexedArrays
>
> julia> ia = IndexedArray(["cat", "dog", "mouse"])
> 3-element IndexedArray{ASCIIString}:
> "cat"
> "dog"
> "mouse"
>
> julia> ia[1]
> "cat"
>
> julia> findfirst(ia, "dog") # executes quickly via a
> dictionary lookup, not sequential search
> 2
>
> More details at https://github.com/garrison/IndexedArrays.jl
>
> In particular, I am looking for
>
> - A link if something similar already exists
> - Obligatory bikeshedding on the chosen package name
> - Any thoughts/comments/suggestions!
>
> Jim
>