Skip to content

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

Merged
bluss merged 107 commits into
masterfrom
the-great-dimension-migration-to-arrays
Nov 8, 2016
Merged

The great dimension migration to Dim<[Ix; N]>#225
bluss merged 107 commits into
masterfrom
the-great-dimension-migration-to-arrays

Conversation

@bluss

@blussbluss commented Nov 7, 2016

Copy link
Copy Markdown
Member

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
blussforce-pushed the the-great-dimension-migration-to-arrays branch from 3c18c2c to 8a0cf80CompareNovember 7, 2016 11:54
@bluss
blussforce-pushed the the-great-dimension-migration-to-arrays branch from 8a0cf80 to 9832287CompareNovember 7, 2016 12:02
@bluss

bluss commented Nov 7, 2016

Copy link
Copy Markdown
MemberAuthor

@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
blussforce-pushed the the-great-dimension-migration-to-arrays branch from f5bd373 to 6afabb0CompareNovember 7, 2016 15:14
@blussbluss mentioned this pull request Nov 7, 2016
6 tasks
@bluss
bluss merged commit fa6fd9e into masterNov 8, 2016
@bluss
bluss deleted the the-great-dimension-migration-to-arrays branch November 8, 2016 17:17
Sign up for freeto 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

@bluss