]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/benchmark/fasta/fasta.factor
specialized-arrays: performed some cleanup.
[factor.git] / extra / benchmark / fasta / fasta.factor
index f1ebc2aa9fcd48c604533612abcad5455ea6aa92..a30e427e452e03732fc804969548f0352b817d9e 100644 (file)
@@ -1,7 +1,7 @@
 ! Based on http://shootout.alioth.debian.org/gp4/benchmark.php?test=fasta&lang=java&id=2
 USING: assocs benchmark.reverse-complement byte-arrays fry io
 io.encodings.ascii io.files locals kernel math sequences
-sequences.private specialized-arrays strings typed ;
+sequences.private specialized-arrays strings typed alien.data ;
 QUALIFIED-WITH: alien.c-types c
 SPECIALIZED-ARRAY: c:double
 IN: benchmark.fasta
@@ -47,7 +47,7 @@ CONSTANT: homo-sapiens
 
 TYPED: make-cumulative ( freq -- chars: byte-array floats: double-array )
     [ keys >byte-array ]
-    [ values >double-array unclip [ + ] accumulate swap suffix ] bi ;
+    [ values c:double >c-array unclip [ + ] accumulate swap suffix ] bi ;
 
 :: select-random ( seed chars floats -- seed elt )
     seed random floats [ <= ] with find drop chars nth-unsafe ; inline