7 releases (breaking)

0.5.1 Sep 1, 2023
0.5.0 Sep 1, 2023
0.4.0 Jul 24, 2023
0.3.0 May 31, 2023
0.0.0 Feb 24, 2023

#365 in Algorithms

Download history 2/week @ 2023-06-09 9/week @ 2023-06-16 6/week @ 2023-06-23 3/week @ 2023-06-30 9/week @ 2023-07-07 5/week @ 2023-07-14 26/week @ 2023-07-21 5/week @ 2023-07-28 12/week @ 2023-08-04 1/week @ 2023-08-11 7/week @ 2023-08-18 14/week @ 2023-08-25 54/week @ 2023-09-01 3/week @ 2023-09-08 5/week @ 2023-09-22

62 downloads per month

MIT/Apache

365KB
5.5K SLoC

arr-rs

crates.io downloads Documentation MIT or Apache 2.0 licensed
CI Dependency Status

Crate

Implementation of numpy-inspired multidimensional, generic arrays.
Documentation of the crate is available here

How to use

[dependencies]
arr-rs = "0.5.1"

Examples

// import the crate
use arr_rs::prelude::*;

// create an array: (4 elements, 2 dimensions)
let arr = Array::<i32>::new(vec![1, 2, 3, 4], vec![2, 2]);
  
// create same array using macro:
let arr: Array::<i32> = array!([[1, 2], [3, 4]]);
  
// create random array with the same shape:
let arr = Array::<i32>::rand(vec![2, 2]);

// array supports display and pretty display
let arr: Array<f64> = array!([[1, 2, 3], [4, 5, 6], [7, 8, 9]]);
println!("{array}");
println!("{array:#}");

// perform some chained operations on array:
let res = arr
    .map(|item| item * 2)
    .filter(|item| item % 3 == 0)
    .ravel()
    .slice(0 .. 2);

Benchmark

Benchmark results can be found here

License

This project is licensed under either of the following licenses, at your option:

Dependencies

~305KB