The ndarray crate provides an n-dimensional container for general elements
and for numerics.
Please read the API documentation on docs.rs
- Generic 1, 2, ..., n-dimensional arrays
- Owned arrays and array views
- Slicing, also with arbitrary step size, and negative indices to mean elements from the end of the axis.
- Views and subviews of arrays; iterators that yield subviews.
- Still iterating on and evolving the crate
- The crate is continuously developing, and breaking changes are expected during evolution from version to version. We adopt the newest stable rust features if we need them.
- Performance:
- Prefer higher order methods and arithmetic operations on arrays first, then iteration, and as a last priority using indexed algorithms.
- Efficient floating point matrix multiplication even for very large matrices; can optionally use BLAS to improve it further.
The following crate feature flags are available. They are configured in your Cargo.toml.
serde-1- Optional, compatible with Rust stable
- Enables serialization support for serde 1.0
rayon- Optional, compatible with Rust stable
- Enables parallel iterators, parallelized methods and
par_azip!.
blas- Optional and experimental, compatible with Rust stable
- Enable transparent BLAS support for matrix multiplication.
Uses
blas-srcfor pluggable backend, which needs to be configured separately.
[dependencies] ndarray = "0.12.1"
How to enable blas integration. Depend on blas-src directly to pick a blas
provider. Depend on the same blas-src version as ndarray does, for the
selection to work. A proposed configuration using system openblas is shown
below. Note that only end-user projects (not libraries) should select
provider:
[dependencies]
ndarray = { version = "0.12.1", features = ["blas"] }
blas-src = { version = "0.2.0", default-features = false, features = ["openblas"] }
openblas-src = { version = "0.6.0", default-features = false, features = ["cblas", "system"] }
- 0.12.1
- Add
std_axismethod for computing standard deviation by @LukeMathWalker. - Add
productmethod for computing product of elements in an array by @sebasv. - Add
firstandfirst_mutmethods for getting the first element of an array. - Add
into_scalarmethod for converting anArray0into its element. - Add
insert_axis_inplaceandindex_axis_inplacemethods for inserting and removing axes in dynamic-dimensional (IxDyn) arrays without taking ownership. - Add
stride_ofmethod for getting the stride of an axis. - Add public
ndimandzerosmethods toDimensiontrait. - Rename
scalar_sumtosum,subviewtoindex_axis,subview_muttoindex_axis_mut,subview_inplacetocollapse_axis,into_subviewtoindex_axis_move, andslice_inplacetoslice_collapse(deprecating the old names, except forscalar_sumwhich will be in 0.13). - Deprecate
remove_axisand fix soundness hole when removing a zero-length axis. - Implement
CloneforLanesIter. - Implement
Debug,Copy, andCloneforFoldWhile. - Relax constraints on
sum_axis,mean_axis, andinto_owned. - Add number of dimensions (and whether it's const or dynamic) to array
Debugformat. - Allow merging axes with
merge_axeswhen either axis length is ≤ 1. - Clarify and check more precise safety requirements for constructing arrays. This fixes undefined behavior in some edge cases. (See #543.)
- Fix
is_standard_layoutin some edge cases. (See #543.) - Fix chunk sizes in
axis_chunks_iterandaxis_chunks_iter_mutwhen the stride is zero or the array element type is zero-sized by @bluss. - Improve documentation by @jturner314, @bluss, and @paulkernfeld.
- Improve element iterators with implementations of
Iterator::rfold. - Miscellaneous internal implementation improvements by @jturner314 and @bluss.
- Add
- 0.12.0
- Add
var_axismethod for computing variance by @LukeMathWalker. - Add
map_mutandmap_axis_mutmethods (mutable variants ofmapandmap_axis) by @LukeMathWalker. - Add support for 128-bit integer scalars (
i128andu128). - Add support for slicing with inclusive ranges (
start..=endand..=end). - Relax constraint on closure from
FntoFnMutformapv,mapv_into,map_inplaceandmapv_inplace. - Implement
TrustedIteratorforIterMut. - Bump
num-traitsandnum-complexto version0.2. - Bump
blas-srcto version0.2. - Bump minimum required Rust version to 1.27.
- Additional contributors to this release: @ExpHP, @jturner314, @alexbool, @messense, @danmack, @nbro
- Add
- 0.11.2
- New documentation; @jturner314 has written a large “ndarray for NumPy users” document, which we include in rustdoc. Read it here. It is a useful quick guide for any user, and in particular if you are familiar with numpy.
- Add
ArcArray.RcArrayhas becomeArcArray; it is now using thread safe reference counting just likeArc; this means that shared ownership arrays are nowSend/Syncif the corresponding element type isSend + Sync. - Add array method
.permute_axes()by @jturner314 - Add array constructor
Array::onesby @ehsanmok - Add the method
.reborrow()toArrayView/Mut, which can be used to shorten the lifetime of an array view; in a reference-like type this normally happens implicitly but for technical reasons the views have an invariant lifetime parameter. - Fix an issue with type inference, the dimensionality of an array should not infer correctly in more cases when using slicing. By @jturner314.
- 0.11.1
- Dimension types (
Ix1, Ix2, .., IxDyn) now implementHashby @jturner314 - Blas integration can now use gemv for matrix-vector multiplication also when the matrix is f-order by @maciejkula
- Encapsulated
unsafecode blocks in thes![]macro are now exempted from theunsafe_codelint by @jturner314
- Dimension types (
- 0.11.0 Release Announcement
- Allow combined slicing and subviews in a single operation by @jturner314 and
@bluss
- Add support for individual indices (to indicate subviews) to the
s![]macro, and change the return type to&SliceInfo<[SliceOrIndex; n], Do>. - Change the argument type of the slicing methods to correspond to the new
s![]macro. - Replace the
Sitype withSliceOrIndex. - Add a new
Slicetype that is similar to the oldSitype.
- Add support for individual indices (to indicate subviews) to the
- Add support for more index types (e.g.
usize) to thes![]macro by @jturner314 - Rename
.islice()to.slice_inplace()by @jturner314 - Rename
.isubview()to.subview_inplace()by @jturner314 - Add
.slice_move(),.slice_axis(),.slice_axis_mut(), and.slice_axis_inplace()methods by @jturner314 - Add
Dimension::NDIMassociated constant by @jturner314 - Change trait bounds for arithmetic ops between an array (by value) and
a reference to an array or array view (“array1 (op) &array2”); before,
an
ArrayViewMutwas supported on the left hand side, now, the left hand side must not be a view. (#380) by @jturner314 - Remove deprecated methods (
.whole_chunks(),.whole_chunks_mut(),.sum(), and.mean(); replaced by.exact_chunks(),.exact_chunks_mut(),.sum_axis(), and.mean_axis(), respectively) by @bluss - Updated to the latest blas (optional) dependencies. See instructions in the README.
- Minimum required Rust version is 1.22.
- Allow combined slicing and subviews in a single operation by @jturner314 and
@bluss
- 0.10.13
- Add an extension trait for longer-life indexing methods for array views
(
IndexLonger) by @termoshtt and @bluss - The
a.dot(b)method now supports a vector times matrix multiplication by @jturner314 - More general
.into_owned()method by @jturner314
- Add an extension trait for longer-life indexing methods for array views
(
- 0.10.12
- Implement serde serialization for
IxDyn, so that arrays and array views using it are serializable as well.
- Implement serde serialization for
- 0.10.11
- Add method
.uswap(a, b)for unchecked swap by @jturner314 - Bump private dependencies (itertools 0.7)
- Add method
- 0.10.10
- Fix crash with zero size arrays in the fallback matrix multiplication code (#365) by @jturner314
- 0.10.9
- Fix crash in
Array::from_shape_fnwhen creating an f-order array with zero elements (#361) by @jturner314
- Fix crash in
- 0.10.8
- Add method
.insert_axis()to arrays and array views by @jturner314
- Add method
- 0.10.7
- Add method
.is_empty()to arrays and array views by @iamed2 - Support optional trailing commas in the
array![]macro by Alex Burka - Added an example of permuting/sorting along an axis to the sources
- Add method
- 0.10.6
- Tweak the implementation for (bounds checked) indexing of arrays ([] operator). The new code will have the optimizer elide the bounds checks in more situations.
- 0.10.5
- Add method
.into_dimensionality::<D>()for dimensionality conversion (FromIxDynto fixed size and back). - New names
.sum_axisand.mean_axisfor sum and mean functions. Old names deprecated to make room for scalar-returning methods, making a proper convention. - Fix deserialization using ron (#345) by @Libbum
- Add method
- 0.10.4
- Fix unused mut warnings in
azip!()macro - Fix bug #340 by @lloydmeta; uses blas gemm for more memory layouts of column matrices. Only relevant if using blas.
- Fix unused mut warnings in
- 0.10.3
- Fix docs.rs doc build
- 0.10.2
- Support trailing commas in the
s![]macro - Some documentation improvements for the introduction, for
azip!()and other places. - Added two more examples in the source
- Support trailing commas in the
- 0.10.1
- Add method
.into_dyn()to convert to a dynamic dimensionality array or array view. By @bobogei81123 - Edit docs for the fact that type alias pages now show methods.
See the doc pages for
ArrayandArrayViewand the other aliases. - Edit docs for
Zip
- Add method
- 0.10.0
- Upgrade to Serde 1.0. Crate feature name is
serde-1. - Require Rust 1.18. The
pub(crate)feature is that important.
- Upgrade to Serde 1.0. Crate feature name is
- 0.9.1
- Fix
Array::from_shape_fnto give correct indices for f-order shapes - Fix
Array::from_shape_fnto panic correctly on shape size overflow
- Fix
- 0.9.0 Release Announcement
- Add
Zip::indexed - New methods
genrows/_mut, gencolumns/_mut, lanes/_mutthat return iterable producers (producer meansZipcompatibile). - New method
.windows()by @Robbepop, returns an iterable producer - New function
general_mat_vec_mul(with fast default and blas acceleration) Zip::applyandfold_whilenow takeselfas the first argumentindices/_ofnow return iterable producers (not iterator)- No allocation for short
IxDyn. - Remove
Ix, Ixsfrom the prelude - Remove deprecated
Axis::axismethod (use.index()) - Rename
.whole_chunksto.exact_chunks. - Remove
.inner_iterin favour of the new.genrows()method. - Iterators and similar structs are now scoped under
ndarray::iter IntoNdProducernow has theItemassociated type- Owned array storage types are now encapsulated in newtypes
FoldWhilegot the methodis_done.- Arrays now implement formatting trait
Binaryif elements do - Internal changes.
NdProducergeneralized.Dimensiongets theSmallertype parameter. Internal traits have the private marker now. #(alternate) in formatting does nothing now.- Require Rust 1.15
- Add
- 0.8.4
- Use
Zipin.all_close()(performance improvement) - Use
#[inline]on a function used for higher dimensional checked indexing (performance improvement for arrays of ndim >= 3) .subview()has a more elaborate panic message
- Use
- 0.8.3
- Fix a bug in
Zip/NdProducerif an array of at least 3 dimensions was contig but not c- nor f-contig. WholeChunksIter/Mutnow implSend/Syncas appropriate- Misc cleanup and using dimension-reducing versions of inner_iter
internally. Remove a special case in
zip_mut_withthat only made it slower (1D not-contig arrays).
- Fix a bug in
- 0.8.2
- Add more documentation and an example for dynamic dimensions: see
IxDyn.
IxDynwill have a representation change next incompatible version. Use it as a type alias for best forward compatibility. - Add iterable and producer
.whole_chunks_mut(size). - Fix a bug in
whole_chunks: it didn't check the dimensionality of the requested chunk size properly (anIxDyn-only bug). - Improve performance of
zip_mut_with(and thus all binary operators) for block slices of row major arrays. AxisChunksItercreation sped up and it implementsClone.- Dimension mismatch in
Ziphas a better panic message.
- Add more documentation and an example for dynamic dimensions: see
IxDyn.
- 0.8.1
- Add
Zipand macroazip!()which implement lock step function application across elements from one up to six arrays (or in general producers)- Apart from array views, axis iterators and the whole chunks iterable are also producers
- Add constructor
Array::uninitialized - Add iterable and producer
.whole_chunks(size) - Implement a prettier
DebugforSi. - Fix
Array::defaultso that it panics as documented if the size of the array would wrap around integer type limits. - Output more verbose panics for errors when slicing arrays (only in debug mode).
- Add
- 0.8.0
- Update serde dependency to 0.9
- Remove deprecated type alias
OwnedArray(useArray) - Remove deprecated
.assign_scalar()(usefill)
- 0.7.3
- Add macro array![] for creating one-, two-, or three-dimensional arrays (with ownership semantics like vec![])
- Array now implements Clone::clone_from() specifically, so that its allocation is (possibly) reused.
- Add .to_vec() for one-dimensional arrays
- Add RcArray::into_owned(self) -> Array.
- Add crate categories
- 0.7.2
- Add array methods
.remove_axis(),.merge_axes()and.invert_axis() - Rename
Axis’ accessoraxistoindex, old name is deprecated.
- Add array methods
- 0.7.1
- Fix two bugs in
Array::clone(); it did not support zero-size elements like(), and for some negatively strided arrays it did not update the first element offset correctly. - Add
.axes()which is an iterator over the axes of an array, yielding its index, length and stride. - Add method
.max_stride_axis().
- Fix two bugs in
- 0.6.10
- Fix two bugs in
Array::clone(); it did not support zero-size elements like(), and for some negatively strided arrays it did not update the first element offset correctly.
- Fix two bugs in
- 0.7.0
- Big overhaul of dimensions: Add type
Dimwith aliasesIx1, Ix2, Ix3, ...etc for specific dimensionalities. Instead ofIxfor dimension useIx1, instead of(Ix, Ix)useIx2, and so on. - The dimension type
Dimsupports indexing and arithmetic. SeeDimensiontrait for new methods and inherited traits. - Constructors and methods that take tuples for array sizes, like
Array::zeros,Array::from_shape_vec,.into_shape()and so on will continue to work with tuples. - The array method
.raw_dim()returns the shape descriptionDas it is..dim()continues to return the dimension as a tuple. - Renamed iterators for consistency (each iterator is named for the
method that creates it, for example
.iter()returnsIter). - The index iterator is now created with free functions
indicesorindices_of. - Expanded the
ndarray::preludemodule with the dimensionality-specific type aliases, and some other items LinalgScalarand related features no longer need to useAnyfor static type dispatch.- Serialization with
serdenow supports binary encoders like bincode and others. .assign_scalar()was deprecated and replaced by.fill(), which takes an element by value.- Require Rust 1.13
- Big overhaul of dimensions: Add type
- 0.6.9
- Implement
ExactSizeIteratorfor the indexed iterators
- Implement
- 0.6.8
- Fix a bug in a partially consumed elements iterator's
.fold(). (Note that users are recommended to not use the elements iterator, but the higher level functions which are the maps, folds and other methods of the array types themselves.)
- Fix a bug in a partially consumed elements iterator's
- 0.6.7
- Improve performance of a lot of basic operations for arrays where
the innermost dimension is not contiguous (
.fold(), .map(), .to_owned(), arithmetic operations with scalars). - Require Rust 1.11
- Improve performance of a lot of basic operations for arrays where
the innermost dimension is not contiguous (
- 0.6.6
- Add dimensionality specific type aliases:
Array0, Array1, Array2, ...and so on (there are many), alsoIx0, Ix1, Ix2, .... - Add constructor
Array::from_shape_fn(D, |D| -> A). - Improve performance of
Array::default, and.fold()for noncontiguous array iterators.
- Add dimensionality specific type aliases:
- 0.6.5
- Add method
.into_raw_vec()to turn anArrayinto the its underlying element storage vector, in whatever element order it is using.
- Add method
- 0.6.4
- Add method
.map_axis()which is used to flatten an array along one axis by mapping it to a scalar.
- Add method
- 0.6.3
- Work around compilation issues in nightly (issue #217)
- Add
Defaultimplementations for owned arrays
- 0.6.2
- Add serialization support for serde 0.8, under the crate feature name
serde
- Add serialization support for serde 0.8, under the crate feature name
- 0.6.1
- Add
unsafearray view constructorsArrayView::from_shape_ptrfor read-only and read-write array views. These make it easier to create views from raw pointers.
- Add
- 0.6.0
- Rename
OwnedArraytoArray. The old name is deprecated. - Remove deprecated constructor methods. Use zeros, from_elem, from_shape_vec or from_shape_vec_unchecked instead.
- Remove deprecated in place arithmetic methods like iadd et.c. Use += et.c. instead.
- Remove deprecated method mat_mul, use dot instead.
- Require Rust 1.9
- Rename
- 0.5.2
- Use num-traits, num-complex instead of num.
- 0.5.1
- Fix theoretical well-formedness issue with Data trait
- 0.5.0
- Require Rust 1.8 and enable +=, -=, and the other assign operators.
All
iadd, iadd_scalarand similar methods are now deprecated. - ndarray now has a prelude:
use ndarray::prelude::*;. - Constructors from_elem, zeros, from_shape_vec now all support passing a custom memory layout. A lot of specific constructors were deprecated.
- Add method
.select(Axis, &[Ix]) -> OwnedArray, to create an array from a non-contiguous pick of subviews along an axis. - Rename
.mat_mul()to just.dot()and add a functiongeneral_mat_mulfor matrix multiplication with scaling into an existing array. - Change .fold() to use arbitrary order.
- See below for more details
- Require Rust 1.8 and enable +=, -=, and the other assign operators.
All
- 0.5.0-alpha.2
- Fix a namespace bug in the stack![] macro.
- Add method .select() that can pick an arbitrary set of rows (for example) into a new array.
- 0.4.9
- Fix a namespace bug in the stack![] macro.
- Add deprecation messages to .iadd() and similar methods (use += instead).
- 0.5.0-alpha.1
- Add .swap(i, j) for swapping two elements
- Add a prelude module
use ndarray::prelude::*; - Add ndarray::linalg::general_mat_mul which computes C ← α A B + β C, i.e matrix multiplication into an existing array, with optional scaling.
- Add .fold_axis(Axis, folder)
- Implement .into_shape() for f-order arrays
- 0.5.0-alpha.0
- Requires Rust 1.8. Compound assignment operators are now enabled by default.
- Rename
.mat_mul()to.dot(). The same method name now handles dot product and matrix multiplication. - Remove deprecated items: raw_data, raw_data_mut, allclose, zeros, Array. Docs for 0.4. lists the replacements.
- Remove deprecated crate features: rblas, assign_ops
- A few consuming arithmetic ops with ArrayViewMut were removed (this was missed in the last version).
- Change .fold() to use arbitrary order. Its specification and implementation has changed, to pick the most appropriate element traversal order depending on memory layout.
- 0.4.8
- Fix an error in
.dot()when using BLAS and arrays with negative stride.
- Fix an error in
- 0.4.7
- Add dependency matrixmultiply to handle matrix multiplication for floating point elements. It supports matrices of general stride and is a great improvement for performance. See PR #175.
- 0.4.6
- Fix bug with crate feature blas; it would not compute matrix multiplication correctly for arrays with negative or zero stride.
- Update blas-sys version (optional dependency).
- 0.4.5
- Add
.all_close()which replaces the now deprecated.allclose(). The new method has a stricter protocol: it panics if the array shapes are not compatible. We don't want errors to pass silently. - Add a new illustration to the doc for
.axis_iter(). - Rename
OuterIter, OuterIterMuttoAxisIter, AxisIterMut. The old name is now deprecated.
- Add
- 0.4.4
- Add mapping methods
.mapv(), .mapv_into(), .map_inplace(),.mapv_inplace(), .visit(). Themapvversions have the transformation function receive the element by value (hence v). - Add method
.scaled_add()(a.k.a axpy) and constructorfrom_vec_dim_f. - Add 2d array methods
.rows(), .cols(). - Deprecate method
.fold()because it dictates a specific visit order.
- Add mapping methods
- 0.4.3
- Add array method
.t()as a shorthand to create a transposed view. - Fix
mat_mulso that it accepts arguments of different array kind - Fix a bug in
mat_mulwhen using BLAS and multiplying with a column matrix (#154)
- Add array method
- 0.4.2
- Add new BLAS integration used by matrix multiplication
(selected with crate feature
blas). Uses pluggable backend. - Deprecate module
ndarray::blasand crate featurerblas. This module was moved to the cratendarray-rblas. - Add array methods
as_slice_memory_order, as_slice_memory_order_mut, as_ptr, as_mut_ptr. - Deprecate
raw_data, raw_data_mut. - Add
Send + SynctoNdFloat. - Arrays now show shape & stride in their debug formatter.
- Fix a bug where
from_vec_dim_stridedid not accept arrays with unitary axes. - Performance improvements for contiguous arrays in non-c order when using
methods
to_owned, map, scalar_sum, assign_scalar, and arithmetic operations between array and scalar. - Some methods now return arrays in the same memory order of the input
if the input is contiguous:
to_owned, map, mat_mul(matrix multiplication only if both inputs are the same memory order), and arithmetic operations that allocate a new result. - Slight performance improvements in
dot, mat_muldue to more efficient glue code for calling BLAS. - Performance improvements in
.assign_scalar.
- Add new BLAS integration used by matrix multiplication
(selected with crate feature
- 0.4.1
- Mark iterators
Send + Syncwhen possible.
- Mark iterators
- 0.4.0 Release Announcement
- New array splitting via
.split_at(Axis, Ix)and.axis_chunks_iter() - Added traits
NdFloat,AsArrayandFrom for ArrayViewwhich improve generic programming. - Array constructors panic when attempting to create an array whose element
count overflows
usize. (Would be a debug assertion for overflow before.) - Performance improvements for
.map(). - Added
stackand macrostack![axis, arrays..]to concatenate arrays. - Added constructor
OwnedArray::range(start, end, step). - The type alias
Arraywas renamed toRcArray(and the old name deprecated). - Binary operators are not defined when consuming a mutable array view as the left hand side argument anymore.
- Remove methods and items deprecated since 0.3 or earlier; deprecated methods have notes about replacements in 0.3 docs.
- See below for full changelog through alphas.
- New array splitting via
- 0.4.0-alpha.8
- In debug mode, indexing an array out of bounds now has a detailed message about index and shape. (In release mode it does not.)
- Enable assign_ops feature automatically when it is supported (Rust 1.8 beta or later).
- Add trait
NdFloatwhich makes it easy to be generic overf32, f64. - Add
Fromimplementations that convert slices or references to arrays into array views. This replacesfrom_slicefrom a previous alpha. - Add
AsArraytrait, which is simply based on thoseFromimplementations. - Improve
.map()so that it can autovectorize. - Use
Axisargument inRemoveAxistoo. - Require
DataOwnedin the raw data methods. - Merged error types into a single
ShapeError, which uses no allocated data.
- 0.4.0-alpha.7
- Fix too strict lifetime bound in arithmetic operations like
&a @ &b. - Rename trait Scalar to ScalarOperand (and improve its docs).
- Implement <<= and >>= for arrays.
- Fix too strict lifetime bound in arithmetic operations like
- 0.4.0-alpha.6
- All axis arguments must now be wrapped in newtype
Axis. - Add method
.split_at(Axis, Ix)to read-only and read-write array views. - Add constructors
ArrayView{,Mut}::from_sliceand array view methods are now visible in the docs.
- All axis arguments must now be wrapped in newtype
- 0.4.0-alpha.5
- Use new trait
LinalgScalarfor operations where we want type-based specialization. This shrinks the set of types that allow dot product, matrix multiply, mean. - Use BLAS acceleration transparently in
.dot()(this is the first step). - Only OwnedArray and RcArray and not ArrayViewMut can now be used as consumed left hand operand for arithmetic operators. See arithmetic operations docs!
- Remove deprecated module
linalg(it was already mostly empty) - Deprecate free function
zerosin favour of static methodzeros.
- Use new trait
- 0.4.0-alpha.4
- Rename
ArraytoRcArray. Old name is deprecated. - Add methods
OuterIter::split_at,OuterIterMut::split_at - Change
arr0, arr1, arr2, arr3to returnOwnedArray. Addrcarr1, rcarr2, rcarr3that returnRcArray.
- Rename
- 0.4.0-alpha.3
- Improve arithmetic operations where the RHS is a broadcast 0-dimensional array.
- Add read-only and read-write array views to the
rblasintegration. Added methodsAsBlas::{blas_view_checked, blas_view_mut_checked, bv, bvm}. - Use hash_slice in
Hashimpl for arrays.
- 0.4.0-alpha.2
- Add
ArrayBase::reversed_axeswhich transposes an array.
- Add
- 0.4.0-alpha.1
- Add checked and unchecked constructor methods for creating arrays
from a vector and explicit dimension and stride, or with
fortran (column major) memory order (marked
f):ArrayBase::from_vec_dim,from_vec_dim_stride,from_vec_dim_stride_unchecked,from_vec_dim_unchecked_f,from_elem_f,zeros_f- View constructors
ArrayView::from_slice_dim_stride,ArrayViewMut::from_slice_dim_stride. - Rename old
ArrayBase::from_vec_dimtofrom_vec_dim_unchecked.
- Check better for wraparound when computing the number of elements in a shape;
this adds error cases that panic in
from_elem,zerosetc, however the new check will only ever panic in cases that would trigger debug assertions for overflow in the previous versions!. - Add an array chunks iterator
.axis_chunks_iter()and mutable version; it allows traversing the array in for example chunks of n rows at a time. - Remove methods and items deprecated since 0.3 or earlier; deprecated methods have notes about replacements in 0.3 docs.
- Add checked and unchecked constructor methods for creating arrays
from a vector and explicit dimension and stride, or with
fortran (column major) memory order (marked
- 0.3.1
- Add
.row_mut(),.column_mut() - Add
.axis_iter(),.axis_iter_mut()
- Add
- 0.3.0
- Second round of API & consistency update is done
- 0.3.0 highlight: Index type
Ixchanged tousize. - 0.3.0 highlight: Operator overloading for scalar and array arithmetic.
- 0.3.0 highlight: Indexing with
a[[i, j, k]]syntax. - Add
ArrayBase::eye(n) - See below for more info
- 0.3.0-alpha.4
- Shrink array view structs by removing their redundant slice field (see #45).
Changed the definition of the view
typealiases. .mat_mul()and.mat_mul_col()now returnOwnedArray. Use.into_shared()if you need anArray.- impl ExactSizeIterator where possible for iterators.
- impl DoubleEndedIterator for
.outer_iter()(and _mut).
- Shrink array view structs by removing their redundant slice field (see #45).
Changed the definition of the view
- 0.3.0-alpha.3
.subview()changed to return an array view, also addedinto_subview().- Add
.outer_iter()and.outer_iter_mut()for iteration along the greatest axis of the array. Views also implementinto_outer_iter()for “lifetime preserving” iterators.
- 0.3.0-alpha.2
- Improve the strided last dimension case in
zip_mut_withslightly (affects all binary operations). - Add
.row(i), .column(i)for 2D arrays. - Deprecate
.row_iter(), .col_iter(). - Add method
.dot()for computing the dot product between two 1D arrays.
- Improve the strided last dimension case in
- 0.3.0-alpha.1
- Index type
Ixchanged tousize(#9). Gives better iterator codegen and 64-bit size arrays. - Support scalar operands with arithmetic operators.
- Change
.slice()and.diag()to return array views, add.into_diag(). - Add ability to use fixed size arrays for array indexing, enabling syntax
like
a[[i, j]]for indexing. - Add
.ndim()
- Index type
- 0.2.0
- First chapter of API and performance evolution is done \o/
- 0.2.0 highlight: Vectorized (efficient) arithmetic operations
- 0.2.0 highlight: Easier slicing using s![]
- 0.2.0 highlight: Nicer API using views
- 0.2.0 highlight: Bridging to BLAS functions.
- See below for more info
- 0.2.0-alpha.9
- Support strided matrices in
rblasbridge, and fix a bug with non square matrices. - Deprecated all of module
linalg.
- Support strided matrices in
- 0.2.0-alpha.8
- Note: PACKAGE NAME CHANGED TO
ndarray. Having package != crate ran into many quirks of various tools. Changing the package name is easier for everyone involved! - Optimized
scalar_sum()so that it will vectorize for the floating point element case too.
- Note: PACKAGE NAME CHANGED TO
- 0.2.0-alpha.7
- Optimized arithmetic operations!
- For c-contiguous arrays or arrays with c-contiguous lowest dimension they optimize very well, and can vectorize!
- Add
.inner_iter(),.inner_iter_mut() - Add
.fold(),.zip_mut_with() - Add
.scalar_sum() - Add example
examples/life.rs
- Optimized arithmetic operations!
- 0.2.0-alpha.6
- Add
#[deprecated]attributes (enabled with new enough nightly) - Add
ArrayBase::linspace, deprecate constructorrange.
- Add
- 0.2.0-alpha.5
- Add
s![...], a slice argument macro. - Add
aview_mut1(),zeros() - Add
.diag_mut()and deprecate.diag_iter_mut(),.sub_iter_mut() - Add
.uget(),.uget_mut()for unchecked indexing and deprecate the old names. - Improve
ArrayBase::from_elem - Removed
SliceRange, replaced byFromimpls forSi.
- Add
- 0.2.0-alpha.4
- Slicing methods like
.slice()now take a fixed size array ofSias the slice description. This allows more type checking to verify that the number of axes is correct. - Add experimental
rblasintegration. - Add
into_shape()which allows reshaping any array or view kind.
- Slicing methods like
- 0.2.0-alpha.3
- Add and edit a lot of documentation
- 0.2.0-alpha.2
- Improve performance for iterators when the array data is in the default memory layout. The iterator then wraps the default slice iterator and loops will autovectorize.
- Remove method
.indexed()on iterators. ChangedIndexedand addedÌndexedMut. - Added
.as_slice(), .as_mut_slice() - Support rustc-serialize
- 0.2.0-alpha
- Alpha release!
- Introduce
ArrayBase,OwnedArray,ArrayView,ArrayViewMut - All arithmetic operations should accept any array type
Arraycontinues to refer to the default reference counted copy on write array- Add
.view(),.view_mut(),.to_owned(),.into_shared() - Add
.slice_mut(),.subview_mut() - Some operations now return
OwnedArray:.map().sum().mean()
- Add
get,get_mutto replace the now deprecatedat,at_mut. - Fix bug in assign_scalar
- 0.1.1
- Add Array::default
- Fix bug in raw_data_mut
- 0.1.0
- First release on crates.io
- Starting point for evolution to come
Dual-licensed to be compatible with the Rust project.
Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 or the MIT license http://opensource.org/licenses/MIT, at your option. This file may not be copied, modified, or distributed except according to those terms.