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

Function check_sparse

examples/clippy_verify.rs:216–229  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214}
215
216fn check_sparse() {
217 // SPMatrix transpose (sparse.rs:97, 102)
218 let m = ml_matrix("1 0 2 0; 0 3 0 4; 5 0 0 6; 0 7 8 0");
219 let sp: SPMatrix = SPMatrix::from_dense(&m);
220 let spt: SPMatrix = sp.transpose();
221 let recovered = spt.to_dense();
222 print_kv("sparse transpose hash", hash_matrix(&recovered));
223 // Also exercise a non-square shape and verify double-transpose
224 // returns the original.
225 let m2 = ml_matrix("1 0 0; 0 2 3; 4 0 5; 0 6 0");
226 let sp2: SPMatrix = SPMatrix::from_dense(&m2);
227 let sp2tt = sp2.transpose().transpose().to_dense();
228 print_kv("sparse round-trip hash", hash_matrix(&sp2tt));
229}
230
231fn check_useful() {
232 // useful::max / useful::min (useful.rs:82, 100)

Callers 1

mainFunction · 0.85

Calls 5

ml_matrixFunction · 0.85
print_kvFunction · 0.85
hash_matrixFunction · 0.85
to_denseMethod · 0.80
transposeMethod · 0.45

Tested by

no test coverage detected