diff yetilab/matrix/test/test_matrix.yeti @ 161:38938ca5db0c

Fix types in Vamp process call
author Chris Cannam
date Wed, 01 May 2013 13:40:03 +0100
parents a9d58d9c71ca
children 3fbaa25aad89
line wrap: on
line diff
--- a/yetilab/matrix/test/test_matrix.yeti	Wed May 01 12:43:12 2013 +0100
+++ b/yetilab/matrix/test/test_matrix.yeti	Wed May 01 13:40:03 2013 +0100
@@ -175,6 +175,24 @@
     compareMatrices (mat.flipped m) (mat.flipped (constMatrix 0 { rows = 0, columns = 0 }));
 ),
 
+"toRowMajor-\(name)": \(
+    m = newMatrix (ColumnMajor ()) [[1,4],[2,5],[3,6]];
+    m' = mat.toRowMajor m;
+    m'' = newMatrix (RowMajor ()) [[1,2,3],[4,5,6]];
+    m''' = mat.toRowMajor m'';
+    compareMatrices m m' and compareMatrices m m'' and compareMatrices m' m''
+        and compareMatrices m m''';
+),
+
+"toColumnMajor-\(name)": \(
+    m = newMatrix (RowMajor ()) [[1,4],[2,5],[3,6]];
+    m' = mat.toColumnMajor m;
+    m'' = newMatrix (ColumnMajor ()) [[1,2,3],[4,5,6]];
+    m''' = mat.toColumnMajor m'';
+    compareMatrices m m' and compareMatrices m m'' and compareMatrices m' m''
+        and compareMatrices m m''';
+),
+
 "scaled-\(name)": \(
     compareMatrices
        (mat.scaled 0.5 (constMatrix 2 { rows = 3, columns = 4 }))
@@ -246,6 +264,18 @@
        (newMatrix (ColumnMajor ()) [])
 ),
 
+"asRows-\(name)": \(
+    compare
+       (mat.asRows (newMatrix (ColumnMajor ()) [[1,4],[2,5],[3,6]]))
+        [[1,2,3],[4,5,6]];
+),
+
+"asColumns-\(name)": \(
+    compare
+       (mat.asColumns (newMatrix (ColumnMajor ()) [[1,4],[2,5],[3,6]]))
+        [[1,4],[2,5],[3,6]];
+),
+
 ]);
 
 colhash = makeTests "column-major" id;