Skip to content

Instantly share code, notes, and snippets.

@nrb
Created January 11, 2017 01:24
Show Gist options
  • Save nrb/b4b91337c250a86efe8f554a678d6369 to your computer and use it in GitHub Desktop.
Save nrb/b4b91337c250a86efe8f554a678d6369 to your computer and use it in GitHub Desktop.
matrix testing
#[macro_use]
extern crate matrix;
use matrix::prelude::*;
fn main() {
let rows: usize = 2;
let cols: usize = 4;
let mut matrix = Compressed::zero((rows, cols));
/// I have no idea why, but the set command is necessary to help the compiler infer the type
/// for the variable.
matrix.set((0,0), 0);
for item in matrix.iter() {
println!("item: {:?}", item);
println!("item: {}", item.is_zero());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment