N-dimensional arrays
NdArray<T> stores numeric or boolean elements compactly with a runtime shape and strides. Constructors validate dimensions and return Result; views such as slice, transpose, and broadcast can share storage.
Elementwise arithmetic broadcasts compatible shapes. Content comparison is explicit because ordinary equality tests ndarray identity.
use std.ndarray
fn matrix_size() -> Result<int, Error> {
let matrix = ndarray.from_array<f32>([1.0, 2.0, 3.0, 4.0], [2, 2])?
ok(matrix.len())
}
fn main() {}
Detailed reference →
Examples use the moon toolchain version shown beside each result.