Mercurial > hg > may
changeset 218:a7f4eb1cdd72 matrix_opaque_immutable
More block -> vector
author | Chris Cannam |
---|---|
date | Sat, 11 May 2013 12:04:05 +0100 |
parents | 26111c11d8e4 |
children | ff97765b1d1b |
files | yetilab/block/test/test_complex.yeti yetilab/feature/features.yeti yetilab/matrix/test/test_matrix.yeti yetilab/stream/audiofile.yeti yetilab/stream/framer.yeti yetilab/stream/playback.yeti yetilab/stream/test/test_audiofile.yeti yetilab/stream/test/test_channels.yeti yetilab/stream/test/test_filter.yeti yetilab/stream/test/test_framer.yeti yetilab/stream/test/test_syntheticstream.yeti yetilab/transform/window.yeti yetilab/vamp/test/test_vamp.yeti yetilab/vamp/vamp.yeti yetilab/vamp/vamppost.yeti |
diffstat | 15 files changed, 129 insertions(+), 129 deletions(-) [+] |
line wrap: on
line diff
--- a/yetilab/block/test/test_complex.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/block/test/test_complex.yeti Sat May 11 12:04:05 2013 +0100 @@ -48,15 +48,15 @@ ), "magnitudes": \( - compare (block.list (magnitudes [ complex (-3) 4, complex 4 3, complex 0 0 ])) + compare (vec.list (magnitudes [ complex (-3) 4, complex 4 3, complex 0 0 ])) [ 5, 5, 0 ] and - compare (block.list (magnitudes (array []))) [] + compare (vec.list (magnitudes (array []))) [] ), "angles": \( - compare (block.list (angles [ complex 1 0, complex (-1) 0, complex 0 (-1) ])) + compare (vec.list (angles [ complex 1 0, complex (-1) 0, complex 0 (-1) ])) [ 0, pi, -pi/2 ] and - compare (block.list (angles (array []))) [] + compare (vec.list (angles (array []))) [] ),
--- a/yetilab/feature/features.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/feature/features.yeti Sat May 11 12:04:05 2013 +0100 @@ -6,12 +6,12 @@ fr = load yetilab.stream.framer; magdiff frame1 frame2 = - sum (map2 do a b: abs(a - b) done (block.data frame1) (block.data frame2)); + sum (map2 do a b: abs(a - b) done (vec.data frame1) (block.data frame2)); emptyFrameFor frames = - block.zeros + vec.zeros if empty? frames then 0 - else block.length (head frames) + else vec.length (head frames) fi; features featureFunc frames =
--- a/yetilab/matrix/test/test_matrix.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/matrix/test/test_matrix.yeti Sat May 11 12:04:05 2013 +0100 @@ -16,7 +16,7 @@ randomMatrix s = flipper (mat.randomMatrix s); identityMatrix s = flipper (mat.identityMatrix s); generate f s = flipper (mat.generate f s); - newMatrix t d = flipper (mat.newMatrix t (map block.fromList d)); + newMatrix t d = flipper (mat.newMatrix t (map vec.fromList d)); [ "constMatrixEmpty-\(name)": \( @@ -32,8 +32,8 @@ "constMatrix-\(name)": \( m = constMatrix 2 { rows = 3, columns = 4 }; compare (mat.size m) { columns = 4, rows = 3 } and - all id (map do row: compare (block.list (mat.getRow row m)) [2,2,2,2] done [0..2]) and - all id (map do col: compare (block.list (mat.getColumn col m)) [2,2,2] done [0..3]) + all id (map do row: compare (vec.list (mat.getRow row m)) [2,2,2,2] done [0..2]) and + all id (map do col: compare (vec.list (mat.getColumn col m)) [2,2,2] done [0..3]) ), "randomMatrixEmpty-\(name)": \( @@ -54,8 +54,8 @@ "zeroMatrix-\(name)": \( m = zeroMatrix { rows = 3, columns = 4 }; compare (mat.size m) { columns = 4, rows = 3 } and - all id (map do row: compare (block.list (mat.getRow row m)) [0,0,0,0] done [0..2]) and - all id (map do col: compare (block.list (mat.getColumn col m)) [0,0,0] done [0..3]) + all id (map do row: compare (vec.list (mat.getRow row m)) [0,0,0,0] done [0..2]) and + all id (map do col: compare (vec.list (mat.getColumn col m)) [0,0,0] done [0..3]) ), "identityMatrixEmpty-\(name)": \( @@ -66,8 +66,8 @@ "identityMatrix-\(name)": \( m = identityMatrix { rows = 3, columns = 4 }; compare (mat.size m) { columns = 4, rows = 3 } and - all id (map do row: compare (block.list (mat.getRow row m)) [1,1,1,1] done [0..2]) and - all id (map do col: compare (block.list (mat.getColumn col m)) [1,1,1] done [0..3]) + all id (map do row: compare (vec.list (mat.getRow row m)) [1,1,1,1] done [0..2]) and + all id (map do col: compare (vec.list (mat.getColumn col m)) [1,1,1] done [0..3]) ), "generateEmpty-\(name)": \( @@ -77,8 +77,8 @@ "generate-\(name)": \( m = generate do row col: row * 10 + col done { rows = 2, columns = 3 }; - compare (block.list (mat.getRow 0 m)) [0,1,2] and - compare (block.list (mat.getRow 1 m)) [10,11,12] + compare (vec.list (mat.getRow 0 m)) [0,1,2] and + compare (vec.list (mat.getRow 1 m)) [10,11,12] ), "widthAndHeight-\(name)": \( @@ -270,14 +270,14 @@ "asRows-\(name)": \( compare - (map block.list + (map vec.list (mat.asRows (newMatrix (ColumnMajor ()) [[1,4],[2,5],[3,6]]))) [[1,2,3],[4,5,6]]; ), "asColumns-\(name)": \( compare - (map block.list + (map vec.list (mat.asColumns (newMatrix (ColumnMajor ()) [[1,4],[2,5],[3,6]]))) [[1,4],[2,5],[3,6]]; ),
--- a/yetilab/stream/audiofile.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/stream/audiofile.yeti Sat May 11 12:04:05 2013 +0100 @@ -61,12 +61,12 @@ bytesPerSample = format#getSampleSizeInBits() / 8; bytes = new byte[nframes * channels * bytesPerSample]; bytesRead = aistream#read(bytes); - if bytesRead <= 0 then block.zeros 0; + if bytesRead <= 0 then vec.zeros 0; else n = int(bytesRead / bytesPerSample); doubles = new double[n]; decode { format } bytes doubles n; - block.block doubles; + vec.block doubles; fi; );
--- a/yetilab/stream/framer.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/stream/framer.yeti Sat May 11 12:04:05 2013 +0100 @@ -33,9 +33,9 @@ // (zero-padded if necessary) just read buffer = map2 do buf row: - block.concat - [block.rangeOf hop (size-hop) buf, - block.resizedTo hop (mat.getRow row m)]; + vec.concat + [vec.rangeOf hop (size-hop) buf, + vec.resizedTo hop (mat.getRow row m)]; done buffer [0..stream.channels-1]; // Number of "valid" elements (not tail-end zero-padding) left in buffer @@ -54,7 +54,7 @@ blockList framesize stream else overlappingBlockList framesize hop stream - framesize (map \(block.zeros framesize) [0..stream.channels-1]); + framesize (map \(vec.zeros framesize) [0..stream.channels-1]); fi; monoFrames params stream =
--- a/yetilab/stream/playback.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/stream/playback.yeti Sat May 11 12:04:05 2013 +0100 @@ -12,8 +12,8 @@ import java.nio: ByteBuffer, ByteOrder; playBlock line b is ~SourceDataLine -> 'a -> () = - (len = block.length b; - samples = block.data b; + (len = vec.length b; + samples = vec.data b; nb = len * 2; bytes = new byte[nb]; bb = ByteBuffer#wrap(bytes, 0, nb);
--- a/yetilab/stream/test/test_audiofile.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/stream/test/test_audiofile.yeti Sat May 11 12:04:05 2013 +0100 @@ -34,9 +34,9 @@ last5 = f.read 10; compare (mat.size first15) { rows = 1, columns = 15 } and compare (mat.size last5) { rows = 1, columns = 5 } and - compare (bl.list (mat.getRow 0 first15)) + compare (vec.list (mat.getRow 0 first15)) [ float (32767/32768),0,0,0,0,0,0,0,0,0,0,0,0,0,0 ] and - compare (bl.list (mat.getRow 0 last5)) [ 0,0,0,0,-1 ] and + compare (vec.list (mat.getRow 0 last5)) [ 0,0,0,0,-1 ] and ( f.close () ; true ) done [ af.open, af.openMono ]); ),
--- a/yetilab/stream/test/test_channels.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/stream/test/test_channels.yeti Sat May 11 12:04:05 2013 +0100 @@ -7,69 +7,69 @@ { compare, compareUsing } = load yetilab.test.test; -newMatrix data = mat.newMatrix (ColumnMajor ()) (map bl.fromList data); +newMatrix data = mat.newMatrix (ColumnMajor ()) (map vec.fromList data); compareBlocks b1 b2 = - compare (bl.list b1) (bl.list b2); + compare (vec.list b1) (bl.list b2); [ "interleaved": \( compareBlocks (ch.interleaved (newMatrix [[1,4],[2,5],[3,6]])) - (bl.fromList [1,4,2,5,3,6]) and + (vec.fromList [1,4,2,5,3,6]) and compareBlocks (ch.interleaved (newMatrix [[1],[2],[3]])) - (bl.fromList [1,2,3]) + (vec.fromList [1,2,3]) ), "deinterleaved": \( - compareUsing mat.equal (ch.deinterleaved 2 (bl.fromList [1,4,2,5,3,6])) + compareUsing mat.equal (ch.deinterleaved 2 (vec.fromList [1,4,2,5,3,6])) (newMatrix [[1,4],[2,5],[3,6]]) and - compareUsing mat.equal (ch.deinterleaved 1 (bl.fromList [1,2,3])) + compareUsing mat.equal (ch.deinterleaved 1 (vec.fromList [1,2,3])) (newMatrix [[1],[2],[3]]) ), "mixedDown": \( compareBlocks (ch.mixedDown (newMatrix [[1,4],[2,5],[3,6]])) - (bl.fromList [5,7,9]) and + (vec.fromList [5,7,9]) and compareBlocks (ch.mixedDown (newMatrix [])) - (bl.fromList []) + (vec.fromList []) ), "mixedDownFromInterleaved": \( - compareBlocks (ch.mixedDownFromInterleaved 2 (bl.fromList [1,4,2,5,3,6])) - (bl.fromList [5,7,9]) and - compareBlocks (ch.mixedDownFromInterleaved 1 (bl.fromList [1,2,3])) - (bl.fromList [1,2,3]) + compareBlocks (ch.mixedDownFromInterleaved 2 (vec.fromList [1,4,2,5,3,6])) + (vec.fromList [5,7,9]) and + compareBlocks (ch.mixedDownFromInterleaved 1 (vec.fromList [1,2,3])) + (vec.fromList [1,2,3]) ), "mixedFromInterleavedTo": \( - compareBlocks (ch.mixedFromInterleavedTo 1 2 (bl.fromList [1,4,2,5,3,6])) - (bl.fromList [5,7,9]) and - compareBlocks (ch.mixedFromInterleavedTo 2 2 (bl.fromList [1,4,2,5,3,6])) - (bl.fromList [1,4,2,5,3,6]) and - compareBlocks (ch.mixedFromInterleavedTo 3 2 (bl.fromList [1,4,2,5,3,6])) - (bl.fromList [1,4,0,2,5,0,3,6,0]) and - compareBlocks (ch.mixedFromInterleavedTo 1 1 (bl.fromList [1,2,3])) - (bl.fromList [1,2,3]) and - compareBlocks (ch.mixedFromInterleavedTo 2 1 (bl.fromList [1,2,3])) - (bl.fromList [1,1,2,2,3,3]) and - compareBlocks (ch.mixedFromInterleavedTo 3 1 (bl.fromList [1,2,3])) - (bl.fromList [1,1,0,2,2,0,3,3,0]) + compareBlocks (ch.mixedFromInterleavedTo 1 2 (vec.fromList [1,4,2,5,3,6])) + (vec.fromList [5,7,9]) and + compareBlocks (ch.mixedFromInterleavedTo 2 2 (vec.fromList [1,4,2,5,3,6])) + (vec.fromList [1,4,2,5,3,6]) and + compareBlocks (ch.mixedFromInterleavedTo 3 2 (vec.fromList [1,4,2,5,3,6])) + (vec.fromList [1,4,0,2,5,0,3,6,0]) and + compareBlocks (ch.mixedFromInterleavedTo 1 1 (vec.fromList [1,2,3])) + (vec.fromList [1,2,3]) and + compareBlocks (ch.mixedFromInterleavedTo 2 1 (vec.fromList [1,2,3])) + (vec.fromList [1,1,2,2,3,3]) and + compareBlocks (ch.mixedFromInterleavedTo 3 1 (vec.fromList [1,2,3])) + (vec.fromList [1,1,0,2,2,0,3,3,0]) ), "mixedAndInterleavedTo": \( compareBlocks (ch.mixedAndInterleavedTo 1 (newMatrix [[1,4],[2,5],[3,6]])) - (bl.fromList [5,7,9]) and + (vec.fromList [5,7,9]) and compareBlocks (ch.mixedAndInterleavedTo 2 (newMatrix [[1,4],[2,5],[3,6]])) - (bl.fromList [1,4,2,5,3,6]) and + (vec.fromList [1,4,2,5,3,6]) and compareBlocks (ch.mixedAndInterleavedTo 3 (newMatrix [[1,4],[2,5],[3,6]])) - (bl.fromList [1,4,0,2,5,0,3,6,0]) and + (vec.fromList [1,4,0,2,5,0,3,6,0]) and compareBlocks (ch.mixedAndInterleavedTo 1 (newMatrix [[1],[2],[3]])) - (bl.fromList [1,2,3]) and + (vec.fromList [1,2,3]) and compareBlocks (ch.mixedAndInterleavedTo 2 (newMatrix [[1],[2],[3]])) - (bl.fromList [1,1,2,2,3,3]) and + (vec.fromList [1,1,2,2,3,3]) and compareBlocks (ch.mixedAndInterleavedTo 3 (newMatrix [[1],[2],[3]])) - (bl.fromList [1,1,1,2,2,2,3,3,3]) + (vec.fromList [1,1,1,2,2,2,3,3,3]) ), ] is hash<string, () -> boolean>;
--- a/yetilab/stream/test/test_filter.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/stream/test/test_filter.yeti Sat May 11 12:04:05 2013 +0100 @@ -41,7 +41,7 @@ compare str.sampleRate 2 and compare str.available (Known 3) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 4))) [ 0,1,2 ] and + compare (vec.list (mat.getRow 0 (str.read 4))) [ 0,1,2 ] and compare str.position 3 and compare str.available (Known 0) and compare str.finished? true and @@ -52,11 +52,11 @@ // as above str = filt.withDuration 3 (syn.generated 2 id); compare str.position 0 and - compare (bl.list (mat.getRow 0 (str.read 2))) [ 0,1 ] and + compare (vec.list (mat.getRow 0 (str.read 2))) [ 0,1 ] and compare str.position 2 and compare str.available (Known 1) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 2))) [ 2 ] and + compare (vec.list (mat.getRow 0 (str.read 2))) [ 2 ] and compare str.position 3 and compare str.available (Known 0) and compare str.finished? true and @@ -74,11 +74,11 @@ compare str.sampleRate 2 and compare str.available (Known 5) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 4))) [ 0,1,2,0 ] and + compare (vec.list (mat.getRow 0 (str.read 4))) [ 0,1,2,0 ] and compare str.position 4 and compare str.available (Known 1) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 2))) [ 0 ] and + compare (vec.list (mat.getRow 0 (str.read 2))) [ 0 ] and compare str.position 5 and compare str.available (Known 0) and compare str.finished? true and @@ -92,7 +92,7 @@ compare str.sampleRate 2 and compare str.available (maybeKnown 3) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 4))) [ 0,1,2 ] and + compare (vec.list (mat.getRow 0 (str.read 4))) [ 0,1,2 ] and compare str.position 3 and compare str.available (Known 0) and compare str.finished? true and @@ -106,7 +106,7 @@ compare str.sampleRate 2 and compare str.available (Infinite ()) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 4))) [ 0,1,2,3 ] and + compare (vec.list (mat.getRow 0 (str.read 4))) [ 0,1,2,3 ] and compare str.position 4 and compare str.available (Infinite ()) and compare str.finished? false and @@ -120,11 +120,11 @@ compare str.sampleRate 2 and compare str.available (maybeKnown 5) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 4))) [ 0,0,0,1 ] and + compare (vec.list (mat.getRow 0 (str.read 4))) [ 0,0,0,1 ] and compare str.position 4 and compare str.available (maybeKnown 1) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 4))) [ 2 ] and + compare (vec.list (mat.getRow 0 (str.read 4))) [ 2 ] and compare str.position 5 and compare str.available (Known 0) and compare str.finished? true and @@ -138,11 +138,11 @@ compare str.sampleRate 2 and compare str.available (maybeKnown 5) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 1))) [ 0 ] and + compare (vec.list (mat.getRow 0 (str.read 1))) [ 0 ] and compare str.position 1 and compare str.available (maybeKnown 4) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 4))) [ 0,0,1,2 ] and + compare (vec.list (mat.getRow 0 (str.read 4))) [ 0,0,1,2 ] and compare str.position 5 and compare str.available (Known 0) and compare str.finished? true and @@ -156,7 +156,7 @@ compare str.sampleRate 2 and compare str.available (maybeKnown 5) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 7))) [ 0,0,0,1,2 ] and + compare (vec.list (mat.getRow 0 (str.read 7))) [ 0,0,0,1,2 ] and compare str.position 5 and compare str.available (Known 0) and compare str.finished? true and @@ -170,13 +170,13 @@ compare str.sampleRate 2 and compare str.available (Infinite ()) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 2))) [ 0,0 ] and + compare (vec.list (mat.getRow 0 (str.read 2))) [ 0,0 ] and compare str.position 2 and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 2))) [ 0,1 ] and + compare (vec.list (mat.getRow 0 (str.read 2))) [ 0,1 ] and compare str.position 4 and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 2))) [ 2,3 ] and + compare (vec.list (mat.getRow 0 (str.read 2))) [ 2,3 ] and compare str.position 6 and compare str.finished? false and ( str.close (); true ) @@ -189,7 +189,7 @@ compare str.sampleRate 2 and compare str.available (maybeKnown 3) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[0,1,2],[0,1,2]] and + compare (map vec.list (mat.asRows (str.read 4))) [[0,1,2],[0,1,2]] and compare str.position 3 and compare str.available (Known 0) and compare str.finished? true and @@ -206,7 +206,7 @@ compare str.sampleRate 2 and compare str.available (maybeKnown 3) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[0,2,4]] and + compare (map vec.list (mat.asRows (str.read 4))) [[0,2,4]] and compare str.position 3 and compare str.available (Known 0) and compare str.finished? true and @@ -223,7 +223,7 @@ compare str.sampleRate 2 and compare str.available (maybeKnown 3) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[0,1,2],[1,2,3],[0,0,0]] and + compare (map vec.list (mat.asRows (str.read 4))) [[0,1,2],[1,2,3],[0,0,0]] and compare str.position 3 and compare str.available (Known 0) and compare str.finished? true and @@ -237,7 +237,7 @@ compare str.sampleRate 2 and compare str.available (maybeKnown 3) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[0,1,2],[0,1,2],[0,1,2]] and + compare (map vec.list (mat.asRows (str.read 4))) [[0,1,2],[0,1,2],[0,1,2]] and compare str.position 3 and compare str.available (Known 0) and compare str.finished? true and @@ -251,7 +251,7 @@ compare str.sampleRate 2 and compare str.available (Infinite ()) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[0,1,2,3]] and + compare (map vec.list (mat.asRows (str.read 4))) [[0,1,2,3]] and compare str.available (Infinite ()) and compare str.position 4 and ( str.close (); true ) @@ -264,7 +264,7 @@ compare str.sampleRate 2 and compare str.available (maybeKnown 3) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[0,1,2]] and + compare (map vec.list (mat.asRows (str.read 4))) [[0,1,2]] and compare str.available (Known 0) and compare str.finished? true and compare str.position 3 and @@ -273,14 +273,14 @@ "mixed-precalc-trunc-\(name)": \( str = filt.mixed - [syn.precalculated 2 (bl.fromList [1,2]), + [syn.precalculated 2 (vec.fromList [1,2]), withDuration 3 (syn.generated 2 (0-))]; compare str.position 0 and compare str.channels 1 and compare str.sampleRate 2 and compare str.available (maybeKnown 2) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[1,1]] and + compare (map vec.list (mat.asRows (str.read 4))) [[1,1]] and compare str.available (Known 0) and compare str.finished? true and compare str.position 2 and @@ -289,15 +289,15 @@ "mixed-2-1-\(name)": \( str = filt.mixed - [syn.precalculated 2 (bl.fromList [1,2]), - filt.multiplexed [syn.precalculated 2 (bl.fromList [3,4]), + [syn.precalculated 2 (vec.fromList [1,2]), + filt.multiplexed [syn.precalculated 2 (vec.fromList [3,4]), withDuration 3 (syn.generated 2 (0-))]]; compare str.position 0 and compare str.channels 2 and compare str.sampleRate 2 and compare str.available (maybeKnown 2) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[4,6], [0,-1]] and + compare (map vec.list (mat.asRows (str.read 4))) [[4,6], [0,-1]] and compare str.available (Known 0) and compare str.finished? true and compare str.position 2 and @@ -306,15 +306,15 @@ "mixed-3-\(name)": \( str = filt.mixed - [syn.precalculated 2 (bl.fromList [1,2]), - syn.precalculated 2 (bl.fromList [3,4]), + [syn.precalculated 2 (vec.fromList [1,2]), + syn.precalculated 2 (vec.fromList [3,4]), withDuration 3 (syn.generated 2 (0-))]; compare str.position 0 and compare str.channels 1 and compare str.sampleRate 2 and compare str.available (maybeKnown 2) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[4,5]] and + compare (map vec.list (mat.asRows (str.read 4))) [[4,5]] and compare str.available (Known 0) and compare str.finished? true and compare str.position 2 and @@ -328,7 +328,7 @@ compare str.sampleRate 2 and compare str.available (Infinite ()) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) + compare (map vec.list (mat.asRows (str.read 4))) [[0,1,2,3], [0,-1,-2,-3]] and compare str.available (Infinite ()) and compare str.position 4 and @@ -342,7 +342,7 @@ compare str.sampleRate 2 and compare str.available (maybeKnown 3) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[0,1,2], [0,-1,-2]] and + compare (map vec.list (mat.asRows (str.read 4))) [[0,1,2], [0,-1,-2]] and compare str.available (Known 0) and compare str.finished? true and compare str.position 3 and @@ -351,14 +351,14 @@ "multiplexed-precalc-trunc-\(name)": \( str = filt.multiplexed - [syn.precalculated 2 (bl.fromList [1,2]), + [syn.precalculated 2 (vec.fromList [1,2]), withDuration 3 (syn.generated 2 (0-))]; compare str.position 0 and compare str.channels 2 and compare str.sampleRate 2 and compare str.available (maybeKnown 2) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[1,2], [0,-1]] and + compare (map vec.list (mat.asRows (str.read 4))) [[1,2], [0,-1]] and compare str.available (Known 0) and compare str.finished? true and compare str.position 2 and @@ -367,15 +367,15 @@ "multiplexed-2-1-\(name)": \( str = filt.multiplexed - [syn.precalculated 2 (bl.fromList [1,2]), - filt.multiplexed [syn.precalculated 2 (bl.fromList [3,4]), + [syn.precalculated 2 (vec.fromList [1,2]), + filt.multiplexed [syn.precalculated 2 (vec.fromList [3,4]), withDuration 3 (syn.generated 2 (0-))]]; compare str.position 0 and compare str.channels 3 and compare str.sampleRate 2 and compare str.available (maybeKnown 2) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[1,2], [3,4], [0,-1]] and + compare (map vec.list (mat.asRows (str.read 4))) [[1,2], [3,4], [0,-1]] and compare str.available (Known 0) and compare str.finished? true and compare str.position 2 and @@ -384,15 +384,15 @@ "multiplexed-2-1b-\(name)": \( str = filt.multiplexed - [syn.precalculated 2 (bl.fromList [1,2]), - syn.precalculated 2 (bl.fromList [3,4]), + [syn.precalculated 2 (vec.fromList [1,2]), + syn.precalculated 2 (vec.fromList [3,4]), withDuration 3 (syn.generated 2 (0-))]; compare str.position 0 and compare str.channels 3 and compare str.sampleRate 2 and compare str.available (maybeKnown 2) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 4))) [[1,2], [3,4], [0,-1]] and + compare (map vec.list (mat.asRows (str.read 4))) [[1,2], [3,4], [0,-1]] and compare str.available (Known 0) and compare str.finished? true and compare str.position 2 and @@ -401,21 +401,21 @@ "repeated-2-\(name)": \( str = filt.repeated - (syn.precalculated 2 (bl.fromList [1,2,3])); + (syn.precalculated 2 (vec.fromList [1,2,3])); compare str.position 0 and compare str.channels 1 and compare str.sampleRate 2 and compare str.available (Infinite ()) and compare str.finished? false and - compare (map bl.list (mat.asRows (str.read 1))) [[1]] and + compare (map vec.list (mat.asRows (str.read 1))) [[1]] and compare str.position 1 and - compare (map bl.list (mat.asRows (str.read 2))) [[2,3]] and + compare (map vec.list (mat.asRows (str.read 2))) [[2,3]] and compare str.position 3 and - compare (map bl.list (mat.asRows (str.read 3))) [[1,2,3]] and + compare (map vec.list (mat.asRows (str.read 3))) [[1,2,3]] and compare str.position 6 and - compare (map bl.list (mat.asRows (str.read 5))) [[1,2,3,1,2]] and - compare (map bl.list (mat.asRows (str.read 9))) [[3,1,2,3,1,2,3,1,2]] and - compare (map bl.list (mat.asRows (str.read 2))) [[3,1]] and + compare (map vec.list (mat.asRows (str.read 5))) [[1,2,3,1,2]] and + compare (map vec.list (mat.asRows (str.read 9))) [[3,1,2,3,1,2,3,1,2]] and + compare (map vec.list (mat.asRows (str.read 2))) [[3,1]] and compare str.available (Infinite ()) and compare str.finished? false and compare str.position 22 and
--- a/yetilab/stream/test/test_framer.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/stream/test/test_framer.yeti Sat May 11 12:04:05 2013 +0100 @@ -8,11 +8,11 @@ { compare, compareUsing } = load yetilab.test.test; -testStream n is number -> 'a = syn.precalculated 1000 (block.fromList [1..n]); +testStream n is number -> 'a = syn.precalculated 1000 (vec.fromList [1..n]); compareFrames frames1 frames2 = all id (map2 do f1 f2: compareUsing mat.equal f1 f2 done frames1 - (map (mat.newRowVector . block.fromList) frames2)); + (map (mat.newRowVector . vec.fromList) frames2)); [
--- a/yetilab/stream/test/test_syntheticstream.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/stream/test/test_syntheticstream.yeti Sat May 11 12:04:05 2013 +0100 @@ -21,7 +21,7 @@ compare str.sampleRate 2 and compare str.available (Infinite ()) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 4))) [ 0,1,2,3 ] and + compare (vec.list (mat.getRow 0 (str.read 4))) [ 0,1,2,3 ] and compare str.position 4 ), @@ -33,7 +33,7 @@ compare str.sampleRate 8 and compare str.available (Infinite ()) and compare str.finished? false and - compareApprox epsilon (bl.list (mat.getRow 0 (str.read 6))) [ 0, 1, 0, -1, 0, 1 ] and + compareApprox epsilon (vec.list (mat.getRow 0 (str.read 6))) [ 0, 1, 0, -1, 0, 1 ] and compare str.position 6 ), @@ -44,33 +44,33 @@ compare str.sampleRate 8 and compare str.available (Infinite ()) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 3))) [ 0, 0, 0 ] and + compare (vec.list (mat.getRow 0 (str.read 3))) [ 0, 0, 0 ] and compare str.position 3 ), "precalculated-empty": \( - str = syn.precalculated 2 (bl.fromList []); + str = syn.precalculated 2 (vec.fromList []); compare str.position 0 and compare str.channels 1 and compare str.sampleRate 2 and compare str.available (Known 0) and compare str.finished? true and - compare (bl.list (mat.getRow 0 (str.read 3))) [] and + compare (vec.list (mat.getRow 0 (str.read 3))) [] and compare str.position 0 ), "precalculated": \( - str = syn.precalculated 2 (bl.fromList [ 1, 2, 3, 4 ]); + str = syn.precalculated 2 (vec.fromList [ 1, 2, 3, 4 ]); compare str.position 0 and compare str.channels 1 and compare str.sampleRate 2 and compare str.available (Known 4) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 3))) [ 1, 2, 3 ] and + compare (vec.list (mat.getRow 0 (str.read 3))) [ 1, 2, 3 ] and compare str.position 3 and compare str.available (Known 1) and compare str.finished? false and - compare (bl.list (mat.getRow 0 (str.read 3))) [ 4 ] and + compare (vec.list (mat.getRow 0 (str.read 3))) [ 4 ] and compare str.position 4 and compare str.available (Known 0) and compare str.finished? true
--- a/yetilab/transform/window.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/transform/window.yeti Sat May 11 12:04:05 2013 +0100 @@ -5,7 +5,7 @@ bf = load yetilab.block.blockfuncs; cosinewin a0 a1 a2 a3 n = - b.fromList + vec.fromList (map do i: a0 - a1 * cos(2 * pi * i / n) @@ -18,10 +18,10 @@ blackman = cosinewin 0.42 0.50 0.08 0.0; nuttall = cosinewin 0.3635819 0.4891775 0.1365995 0.0106411; blackmanHarris = cosinewin 0.35875 0.48829 0.14128 0.01168; -boxcar = b.consts 0.5; +boxcar = vec.consts 0.5; bartlett n = - b.fromList + vec.fromList (m = n/2; concat [ map do i: @@ -36,7 +36,7 @@ case frames of []: frames; _: (first = head frames; - window = windowFunc (b.length first); + window = windowFunc (vec.length first); map (bf.multiply window) frames); esac;
--- a/yetilab/vamp/test/test_vamp.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/vamp/test/test_vamp.yeti Sat May 11 12:04:05 2013 +0100 @@ -92,7 +92,7 @@ compareUsing mat.equal g (mat.newMatrix (ColumnMajor ()) (map do x: - (block.fromList . floats) (map do y: + (vec.fromList . floats) (map do y: (x + y + 2) / 30 done [0..9]) done [0..19])); @@ -106,7 +106,7 @@ compareUsing mat.equal g (mat.newMatrix (ColumnMajor ()) (map do x: - (block.fromList . floats) (map do y: + (vec.fromList . floats) (map do y: (x + y + 2) / 20 done [0..9]) done [0..9]));
--- a/yetilab/vamp/vamp.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/vamp/vamp.yeti Sat May 11 12:04:05 2013 +0100 @@ -24,7 +24,7 @@ feature f is ~Feature -> 'a = { timestamp = if f#hasTimestamp then Time (realTime f#timestamp) else Untimed () fi, duration = if f#hasDuration then Time (realTime f#duration) else Untimed () fi, - values = bl.fromFloats f#values, + values = vec.fromFloats f#values, label = f#label, }; @@ -209,7 +209,7 @@ None (): map (outputDescriptor (None ())) p#getOutputDescriptors(); esac, process frame time is 'a -> ~RealTime -> 'b = - featureSet p#process((map bl.floats (mat.asRows frame)) as ~float[][], 0, time), + featureSet p#process((map vec.floats (mat.asRows frame)) as ~float[][], 0, time), getRemainingFeatures () = featureSet p#getRemainingFeatures(), dispose () = p#dispose(), });
--- a/yetilab/vamp/vamppost.yeti Sat May 11 12:01:34 2013 +0100 +++ b/yetilab/vamp/vamppost.yeti Sat May 11 12:04:05 2013 +0100 @@ -76,14 +76,14 @@ { start = t0, step = t1 - t0, - values = map do f: (bl.data f.values)[0] done features; + values = map do f: (vec.data f.values)[0] done features; } fi; structureCurve features = map do f: { time = timeOf f, - value = (bl.data f.values)[0], + value = (vec.data f.values)[0], label = f.label } done features; @@ -96,7 +96,7 @@ structureSegmentation features = map do f: { time = timeOf f, - type = (bl.data f.values)[0], + type = (vec.data f.values)[0], label = f.label } done features; @@ -104,8 +104,8 @@ map do f: { time = timeOf f, duration = f.duration, - pitch = (bl.data f.values)[0], //!!! no, might be empty - otherValues = array (tail (bl.list f.values)), //!!! no, might be empty + pitch = (vec.data f.values)[0], //!!! no, might be empty + otherValues = array (tail (vec.list f.values)), //!!! no, might be empty label = f.label } done features; @@ -113,14 +113,14 @@ map do f: { time = timeOf f, duration = f.duration, - values = array (bl.list f.values), + values = array (vec.list f.values), label = f.label } done features; structureWithoutDuration features = map do f: { time = timeOf f, - values = array (bl.list f.values), + values = array (vec.list f.values), label = f.label } done features;