diff yetilab/matrix/matrix.yeti @ 159:a9d58d9c71ca

Fix matrix.equal (did not check matrix size, could return true if one was a subset of the other) and add test for it; fix resizedTo test
author Chris Cannam
date Wed, 01 May 2013 12:32:08 +0100
parents b6db07468ed1
children 38938ca5db0c
line wrap: on
line diff
--- a/yetilab/matrix/matrix.yeti	Wed May 01 12:03:45 2013 +0100
+++ b/yetilab/matrix/matrix.yeti	Wed May 01 12:32:08 2013 +0100
@@ -101,8 +101,8 @@
 // Matrices with different storage order but the same contents are
 // equal (but comparing them is slow)
 equal m1 m2 =
-    if m1.isRowMajor? != m2.isRowMajor?
-    then equal (flipped m1) m2;
+    if m1.size != m2.size then false
+    elif m1.isRowMajor? != m2.isRowMajor? then equal (flipped m1) m2;
     else
         compare d1 d2 = all id (map2 vec.equal d1 d2);
         case m1.data of