# HG changeset patch # User Chris Cannam # Date 1410429658 -3600 # Node ID 02fba8dc2a92c2496ce1aeb800b5c26192922f8e # Parent 28871ec9e4a9bd980f59e997e5d2a57eaa4b8732 Fix size check in newMatrix so as to check all rows/cols diff -r 28871ec9e4a9 -r 02fba8dc2a92 src/may/matrix.yeti --- a/src/may/matrix.yeti Thu Sep 11 08:18:45 2014 +0100 +++ b/src/may/matrix.yeti Thu Sep 11 11:00:58 2014 +0100 @@ -214,8 +214,8 @@ Rows rr: if (length rr) != size.rows then failWith "Wrong number of rows in row-major newMatrix (\(length rr), size calls for \(size.rows))"; - elif not empty? rr and vec.length (head rr) != size.columns then - failWith "Wrong number of columns in row-major newMatrix (\(vec.length (head rr)), size calls for \(size.columns))"; + elif not (all do r: vec.length r == size.columns done rr) then + failWith "Wrong or inconsistent number of columns in rows in row-major newMatrix (\(map vec.length rr)), size calls for \(size.columns))"; else { size, @@ -225,8 +225,8 @@ Columns cc: if (length cc) != size.columns then failWith "Wrong number of columns in column-major newMatrix (\(length cc), size calls for \(size.columns))"; - elif not empty? cc and vec.length (head cc) != size.rows then - failWith "Wrong number of rows in column-major newMatrix (\(vec.length (head cc)), size calls for \(size.rows))"; + elif not (all do c: vec.length c == size.rows done cc) then + failWith "Wrong or inconsistent number of rows in in columns in column-major newMatrix (\(map vec.length cc)), size calls for \(size.rows))"; else { size,