Mercurial > hg > may
changeset 509:051c4644d063 sized_matrix
One more test
author | Chris Cannam |
---|---|
date | Wed, 20 Nov 2013 14:00:57 +0000 |
parents | 3420e5f61a1b |
children | f909771addc6 |
files | src/may/matrix/test/test_matrix.yeti src/may/stream/manipulate.yeti |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/may/matrix/test/test_matrix.yeti Wed Nov 20 13:57:32 2013 +0000 +++ b/src/may/matrix/test/test_matrix.yeti Wed Nov 20 14:00:57 2013 +0000 @@ -27,7 +27,9 @@ "constMatrixEmpty2-\(name)": \( compare (mat.size (constMatrix 2 { rows = 0, columns = 4 })) { columns = 4, rows = 0 } and compare (mat.size (constMatrix 2 { rows = 4, columns = 0 })) { columns = 0, rows = 4 } and - compare (vec.list (mat.getColumn 2 (constMatrix 2 { rows = 0, columns = 4 }))) [] + compare (vec.list (mat.getColumn 2 (constMatrix 2 { rows = 0, columns = 4 }))) [] and + compare (map vec.list (mat.asRows (constMatrix 2 { rows = 4, columns = 0 }))) [[],[],[],[]] and + compare (vec.list (mat.getRow 2 (constMatrix 2 { rows = 3, columns = 0 }))) [] ), "constMatrix-\(name)": \(
--- a/src/may/stream/manipulate.yeti Wed Nov 20 13:57:32 2013 +0000 +++ b/src/may/stream/manipulate.yeti Wed Nov 20 14:00:57 2013 +0000 @@ -333,6 +333,8 @@ (toRead = maths.ceil (n / mult); source = s.read toRead; targetWidth = min n (mult * mat.width source); + +//!!! here we need a better matrix construction api -- need to give it a size mat.newMatrix (ColumnMajor ()) (map do i: if i % mult == 0 then