Open rafaqz opened 1 year ago
scalar indices that are supported by array A
This is exactly why the machinery passes A
itself so deeply into the call stack here. Simple fix would be something like:
KnownStaticFriendlyArrays = Union{StaticArray, Array, #= others? ... =#}
static_index(A::KnownStaticFriendlyArray, ind) = StaticIndexing(ind)
static_index(A, ind) = ind
# ...
return map(i->static_index(A, i), inds)
Probably duplicate of #878? See also #879.
@mbauman the docs still says AbstractArray
of scalar indices even for known friendly types ;)
But absolutely, limiting it as to_indices(A::StaticArray, ...
would fix the problem.
The
to_indices
docs state that:But
StaticIndexing
is not either:https://github.com/JuliaArrays/StaticArrays.jl/blob/217e6f10a01433b8a60b679622065bc8702da923/src/indexing.jl#L213-L221
See discourse: https://discourse.julialang.org/t/a-sparse-matrix-cannot-be-indexed-by-a-svector/104265/5