Skip to content

ArrayD example for 7 or higher dimension #1086

Closed

Description

@ungsik

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.

Activity

  1. jturner314 commented on Oct 22, 2021

    @jturner314
    Member

    See the docs for the Index implementation, which indicate that the index needs to implement NdIndex<D>. The NdIndex<D> provide a list of the implementations. The relevant ones for your case are:

    For example, you could use array[&[i, j, k, l, m, n, o, p][..]].

  2. emmatyping commented on Nov 16, 2021

    @emmatyping
    Contributor

    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 :)

  3. locked and limited conversation to collaborators on Oct 26, 2024
  4. converted this issue into a discussion #1451 on Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions