Skip to content

Add const vs. dynamic ndim to array Debug format #490

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

Merged
merged 1 commit into from
Oct 13, 2018

Conversation

jturner314
Copy link
Member

The difference between const-dimensional and dynamic-dimensional arrays is fairly significant, so it would be useful for the debug format to include this information. See also #489 for more motivation.

This implementation produces a debug format like this for a const-dimensional array:

[[0, 0, 0, 0],
 [0, 0, 0, 0],
 [0, 0, 0, 0]] shape=[3, 4], strides=[4, 1], layout=C (0x1), const ndim=2

and like this for a dynamic-dimensional array:

[[0, 0, 0, 0],
 [0, 0, 0, 0],
 [0, 0, 0, 0]] shape=[3, 4], strides=[4, 1], layout=C (0x1), dynamic ndim=2

(Note the addition of const ndim=2 or dynamic ndim=2.)

Is the term "fixed" better than "const"? I chose "const" because the number of dimensions is a compile-time constant, and Rust often uses the name "const" for this.

The difference between const-dimensional and dynamic-dimensional
arrays is fairly significant, so it is useful for the debug format to
include this information.
@jturner314 jturner314 merged commit d5224a2 into rust-ndarray:master Oct 13, 2018
@jturner314 jturner314 deleted the debug-dim branch October 13, 2018 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant