gentrix 0.1.4

A library that adds the Matrix typed using generics that is basically a wrapper around a 2D Vector
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 0 items with examples
  • Size
  • Source code size: 5.68 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.38 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • local-interloper

gentrix

What is this?

gentrix is a library for creating matrixes of generics. You can declare a matrix of any type. Handy functions included.

Examples

let mut matrix = Matrix::<i32>::new((5, 5));

assert!(matrix.set(1, (1, 1)).is_ok());
assert!(matrix.set(6, (1, 2)).is_ok());

let a = matrix.get((1, 1)).unwrap();
let b = matrix.get((1, 2)).unwrap();

assert_eq!(a + b, 7);
let items = vec![vec![1, 2], vec![3, 4]];

let mut matrix = Matrix::from(items);

matrix.translate((0, 0), (1, 0)).unwrap();

println!("{:?}", matrix);

assert_eq!(matrix.get((0,0)), None);
assert_eq!(matrix.get((1,0)), Some(1));

Future plans

Refinement and proper documentation