#array #matrix #multidimensional


Multidimensional array for Rust

4 releases (breaking)

0.4.0 Nov 3, 2022
0.3.0 Jan 6, 2022
0.2.0 Sep 11, 2021
0.1.0 Aug 24, 2021

#325 in Math

34 downloads per month


3.5K SLoC

Multidimensional array for Rust


The mdarray crate provides a multidimensional array for Rust. Its main target is for numeric types, however generic types are supported as well. The purpose is to provide a generic container type that is simple and flexible to use, with interworking to other crates for e.g. BLAS/LAPACK functionality.

Here are the main features of mdarray:

  • Dense array type, where the rank and element order is known at compile time.
  • Column-major and row-major element order.
  • Subarrays (views) can be created with arbitrary shapes and strides.
  • Standard Rust mechanisms are used for e.g. slices, indexing and iteration.

The design is inspired from the Rust ndarray, nalgebra and bitvec crates, the proposed C++ mdarray and mdspan types, and multidimensional arrays in Julia and Matlab.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.