diff yetilab/matrix/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/matrix.yeti	Wed May 01 12:43:12 2013 +0100
+++ b/yetilab/matrix/matrix.yeti	Wed May 01 13:40:03 2013 +0100
@@ -98,6 +98,12 @@
             { rows = m.size.columns, columns = m.size.rows });
     fi;
 
+toRowMajor m =
+    if m.isRowMajor? then m else flipped m fi;
+
+toColumnMajor m =
+    if not m.isRowMajor? then m else flipped m fi;
+
 // Matrices with different storage order but the same contents are
 // equal (but comparing them is slow)
 equal m1 m2 =
@@ -161,6 +167,12 @@
         done { rows = m1.size.rows, columns = m2.size.columns }
     fi;
 
+asRows m =
+    map (block.list . m.getRow) [0 .. m.size.rows - 1];
+
+asColumns m =
+    map (block.list . m.getColumn) [0 .. m.size.columns - 1];
+
 {
 constMatrix, randomMatrix, zeroMatrix, identityMatrix, zeroSizeMatrix,
 generate,
@@ -168,9 +180,10 @@
 equal,
 copyOf,
 transposed,
-flipped,
+flipped, toRowMajor, toColumnMajor,
 scaled,
 resizedTo,
+asRows, asColumns,
 sum = sum', product,
 newMatrix, newRowVector, newColumnVector,
 }