Mercurial > hg > may
diff yetilab/matrix/test/test_matrix.yeti @ 238:0c86d9284f20 sparse
Implement sparse matrix construction, add tests for sparse matrices (currently failing)
author | Chris Cannam |
---|---|
date | Mon, 20 May 2013 14:18:14 +0100 |
parents | ac1373067054 |
children | f22ae9bfe49f |
line wrap: on
line diff
--- a/yetilab/matrix/test/test_matrix.yeti Sun May 19 22:21:47 2013 +0100 +++ b/yetilab/matrix/test/test_matrix.yeti Mon May 20 14:18:14 2013 +0100 @@ -373,12 +373,16 @@ ]); -colhash = makeTests "column-major" id; -rowhash = makeTests "row-major" mat.flipped; +colhash = makeTests "column-dense" id; +rowhash = makeTests "row-dense" mat.flipped; +sparsecolhash = makeTests "column-sparse" (mat.toSparse 0); +sparserowhash = makeTests "row-sparse" ((mat.toSparse 0) . (mat.flipped)); +//sparserowhash2 = makeTests "row-sparse2" ((mat.flipped) . (mat.toSparse 0)); all = [:]; -for (keys colhash) do k: all[k] := colhash[k] done; -for (keys rowhash) do k: all[k] := rowhash[k] done; +for [ colhash, rowhash, sparsecolhash, sparserowhash /*, sparserowhash2 */ ] do h: + for (keys h) do k: all[k] := h[k] done; +done; all is hash<string, () -> boolean>;