MCPcopy Create free account
hub / github.com/Axect/Peroxide / hash_matrix

Function hash_matrix

examples/clippy_verify.rs:40–50  ·  view source on GitHub ↗
(m: &Matrix)

Source from the content-addressed store, hash-verified

38}
39
40fn hash_matrix(m: &Matrix) -> String {
41 let mut h = DefaultHasher::new();
42 m.nrow().hash(&mut h);
43 m.ncol().hash(&mut h);
44 // the layout enum has no Hash impl; use Debug as a stable surrogate
45 format!("{:?}", m.layout()).hash(&mut h);
46 for x in m.as_slice() {
47 x.to_bits().hash(&mut h);
48 }
49 format!("{:016x}", h.finish())
50}
51
52fn print_kv<T: std::fmt::Display>(label: &str, value: T) {
53 println!("{:48} {}", label, value);

Callers 2

check_matrixFunction · 0.85
check_sparseFunction · 0.85

Calls 3

nrowMethod · 0.45
ncolMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected