Skip to content

The great dimension migration to Dim<[Ix; N]> #225

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 107 commits into from
Nov 8, 2016

Conversation

bluss
Copy link
Member

@bluss bluss commented Nov 7, 2016

If you thought I was slacking, finally the rework of ndarray's dimension handling is ready (almost).

To have your code be compatible with ndarray 0.6.8 and with this and the future: Use the dimension type aliases. Use Array<X, Ix1> or Array1 for 1d arrays, Array<X, Ix2> or Array2 for 2d arrays and so on. Then transition will be very smooth.

  • Tuples are still used to describe shapes when creating arrays (Array::zeros((3, 4))).
  • The dimension values are represented using the new Dim struct. Dim<[usize; 2]> is a 2D dimension.
  • Dimensions/Indices now implement indexing and arithmetic

Requires Rust 1.12 (macro expansion of tt).

Fixes #6

@bluss bluss force-pushed the the-great-dimension-migration-to-arrays branch from 3c18c2c to 8a0cf80 Compare November 7, 2016 11:54
@bluss bluss force-pushed the the-great-dimension-migration-to-arrays branch from 8a0cf80 to 9832287 Compare November 7, 2016 12:02
@bluss
Copy link
Member Author

bluss commented Nov 7, 2016

@SuperFluffy Serialization changes, now serializes dimensions as arrays instead of tuples. I think the defacto format for json remains the same in both serialization libs, but it needs checking (test are still passing). Handling that properly feels like a project of its own.

@bluss bluss force-pushed the the-great-dimension-migration-to-arrays branch from f5bd373 to 6afabb0 Compare November 7, 2016 15:14
@bluss bluss mentioned this pull request Nov 7, 2016
6 tasks
@bluss bluss merged commit fa6fd9e into master Nov 8, 2016
@bluss bluss deleted the the-great-dimension-migration-to-arrays branch November 8, 2016 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant