Finally — ndarray 0.13! It has been a long time in the making, and many have contributed, so we have a big list of changes. The following are some highlights, see the full release note for the whole story.
Ndarray now supports
approx for more flexible (approximate) comparisons.
Abbreviated Formatting Output
Arrays now have a limit of how many elements are shown in formatting by default, and it will ellipsize the middle of each axis, if they get too long. Full output can be forced using the
# modifier (the alternate flag).
Rayon support moved into the crate itself as an optional feature. You can run parallel iterators from arrays and parallelize the
Zip primitive for lock-step iteration of several arrays or other NdProducers.
azip is a macro for writing lock-step loops over several arrays or NdProducers, and it now has a syntax that's more similar to the usual for loop: first the pattern and then the producer.
// Here A, B and C are arrays of matching shape. // // Example: Compute a simple ternary operation; // elementwise addition of B and C, stored in A azip!((a in &mut A, &b in &B, &c in &C) *a = b + c);
The parallel version is
ArrayViewMut is like a
&mut T, then the new
RawArrayViewMut is like a
*mut T but as an array view. This is a useful low level primitive for our internals, and will help us hone in on writing a Rust that's compatible with the developing unsafe code guidelines.
The raw array views are
NdProducers and support some of the ndarray API; like axes, dimensions, splitting and slicing (in place).
New constructors like
logspace, new method
.as_standard_layout() and a new array storage type
CowArray, new method
matrixmultiply with runtime-detected SIMD support, and more in the full release note.