bitgrid
A fast, packed bit grid structure for managing N-Dim boolean matrices with:
- constant-time
get/set - efficient iteration over set bits,
- arbitrary word sizes (
u8,u16,u32,u64,u128), no_stdcompatible
Examples
use BitGrid2D;
// Create a 4x4 grid
let mut grid = new;
// Set some bits
grid.set;
grid.set;
// Check bit states
assert!;
assert!;
// Iterate over set bits
let set_bits: = grid.iter.collect;
assert_eq!;
For N-Dim grids:
use BitGrid;
// create a 10x10x10x10 grid
let mut space = new_n;
space.set_n;
assert!;