Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayD example for 7 or higher dimension #1086

Closed
ungsik opened this issue Oct 22, 2021 · 2 comments
Closed

ArrayD example for 7 or higher dimension #1086

ungsik opened this issue Oct 22, 2021 · 2 comments
Labels

Comments

@ungsik
Copy link

ungsik commented Oct 22, 2021

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.

@jturner314
Copy link
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][..]].

@emmatyping
Copy link
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 :)

@rust-ndarray rust-ndarray locked and limited conversation to collaborators Oct 26, 2024
@akern40 akern40 converted this issue into discussion #1451 Oct 26, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

3 participants