You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created an 8 dimension ArrayD.
I can not find how to index the ArrayD for 8 dim.
Compiler raises
the trait NdIndex<Dim<IxDynImpl>> is not implemented for [usize; 8] error when addressing
array[[i, j, k, l, m, n, o, p]].
When tuple form is tried,
the trait NdIndex<Dim<IxDynImpl>> is not implemented for (usize, usize, usize, usize, usize, usize, usize, usize) error is raised.
It looks like #980 will implement for [usize; T] using const generics, so in 0.16.x you should be able to use array[[i, j, k, l, m, n, o, p]], and the compiler error you got should go away :)
Activity
jturner314 commentedon Oct 22, 2021
See the docs for the
Indeximplementation, which indicate that the index needs to implementNdIndex<D>. TheNdIndex<D>provide a list of the implementations. The relevant ones for your case are:impl<'a> NdIndex<Dim<IxDynImpl>> for &'a [Ix]impl<'a> NdIndex<Dim<IxDynImpl>> for &'a IxDynimpl<D> NdIndex<D> for D where D: DimensionFor example, you could use
array[&[i, j, k, l, m, n, o, p][..]].emmatyping commentedon Nov 16, 2021
It looks like #980 will implement for
[usize; T]using const generics, so in 0.16.x you should be able to usearray[[i, j, k, l, m, n, o, p]], and the compiler error you got should go away :)