Hi @andyferris - this project looks great, and is something I am considering extending / building on. I already have some hacky implementations of something similar, but not as nicely integrate and as general.
What are you thoughts on adding a family of getindex(A::AcceleratedVector, idx::AbstractVector{Int}) methods? I.e. indexing into AcceleratedVectors with integer StepRanges, integer Vectors, etc, and returning AcceleratedVectors of the same type.
For SortIndex, this would be quite easy. When indexing with StepRanges, we would have to check the step is positive. For indexing with arrays, we would have to check the array is sorted first. Since we would be constructing SortIndexes from known-sorted arrays, it would be good to have a SortIndex constructor that doesn't do any checks. This might also be useful generally.
For HashIndex, the hash table would have to be modified, but there are likely lots of optimisations / shortcuts to minimise the work. For example, when indexing with UnitRange{Int}s, we could add to a global integer offset that is subtracted from the values in the Dict when they are accessed. Similar to the above, we might want a more direct HashIndex constructor that accepts a pre-built dictionary & offset, etc.
I'd be happy to do some initial work on this after hearing your thoughts.
Hi @andyferris - this project looks great, and is something I am considering extending / building on. I already have some hacky implementations of something similar, but not as nicely integrate and as general.
What are you thoughts on adding a family of
getindex(A::AcceleratedVector, idx::AbstractVector{Int})methods? I.e. indexing intoAcceleratedVectors with integerStepRanges, integerVectors, etc, and returningAcceleratedVectors of the same type.For
SortIndex, this would be quite easy. When indexing withStepRanges, we would have to check the step is positive. For indexing with arrays, we would have to check the array is sorted first. Since we would be constructingSortIndexes from known-sorted arrays, it would be good to have aSortIndexconstructor that doesn't do any checks. This might also be useful generally.For
HashIndex, the hash table would have to be modified, but there are likely lots of optimisations / shortcuts to minimise the work. For example, when indexing withUnitRange{Int}s, we could add to a global integer offset that is subtracted from the values in theDictwhen they are accessed. Similar to the above, we might want a more directHashIndexconstructor that accepts a pre-built dictionary & offset, etc.I'd be happy to do some initial work on this after hearing your thoughts.