Created
January 11, 2017 01:24
-
-
Save nrb/b4b91337c250a86efe8f554a678d6369 to your computer and use it in GitHub Desktop.
matrix testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[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