]> gitweb.factorcode.org Git - factor.git/commitdiff
math.vectors: changes so that some vocabs that can use math.vector words does it
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 13 Oct 2014 21:56:28 +0000 (23:56 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 18 Nov 2014 03:02:12 +0000 (19:02 -0800)
basis/checksums/hmac/hmac.factor
basis/core-text/core-text.factor
extra/benchmark/simd-1/simd-1.factor
extra/color-picker/color-picker.factor
extra/rosetta-code/equilibrium-index/equilibrium-index.factor
extra/rosetta-code/long-multiplication/long-multiplication.factor

index d6fc24d4b056913ef059e1876fc05099d2a059dd..86b724d49a533a05a7b954b9a6955b21c3433fe7 100644 (file)
@@ -7,8 +7,6 @@ IN: checksums.hmac
 
 <PRIVATE
 
-: seq-bitxor ( seq seq -- seq ) [ bitxor ] 2map ;
-
 : opad ( checksum-state -- seq ) block-size>> 0x5c <array> ;
 
 : ipad ( checksum-state -- seq ) block-size>> 0x36 <array> ;
@@ -16,9 +14,9 @@ IN: checksums.hmac
 :: init-key ( checksum key checksum-state -- o i )
     checksum-state block-size>> key length <
     [ key checksum checksum-bytes ] [ key ] if
-    checksum-state block-size>> 0 pad-tail 
-    [ checksum-state opad seq-bitxor ]
-    [ checksum-state ipad seq-bitxor ] bi ;
+    checksum-state block-size>> 0 pad-tail
+    [ checksum-state opad vbitxor ]
+    [ checksum-state ipad vbitxor ] bi ;
 
 PRIVATE>
 
index 356f2d9f83904117311d207affd3e80f43c21fdf..04b37caf3f86de38eebe00fc7b37a512b570ba47 100644 (file)
@@ -136,8 +136,8 @@ render-loc render-dim ;
         ctline line-rect :> rect
         rect origin>> CGPoint>loc :> (loc)
         rect size>> CGSize>dim :> (dim)
-        (loc) [ floor ] map :> loc
-        (loc) (dim) [ + ceiling ] 2map :> ext
+        (loc) vfloor :> loc
+        (loc) (dim) v+ vceiling :> ext
         ext loc [ - >integer 1 max ] 2map :> dim
 
         loc line render-loc<<
index 5257e5529a9058f4e5bc11199e00e93544dee96a..41e26ed7711d5975a855cf9496385883fdb5cb9b 100644 (file)
@@ -16,14 +16,11 @@ IN: benchmark.simd-1
 : normalize-points ( points -- )
     [ normalize ] map! drop ; inline
 
-: max-points ( points -- point )
-    [ ] [ vmax ] map-reduce ; inline
-
 : print-point ( point -- )
     [ number>string ] { } map-as ", " join print ; inline
 
 : simd-benchmark ( len -- )
-    >fixnum make-points [ normalize-points ] [ max-points ] bi print-point ;
+    >fixnum make-points [ normalize-points ] [ vsupremum ] bi print-point ;
 
 : simd-1-benchmark ( -- )
     10 [ 500000 simd-benchmark ] times ;
index 285e9ffad1394b9d3b5562951c020b77d95258e5..038134b30915b39deb5b874de2baf8aa126cea47 100644 (file)
@@ -39,7 +39,7 @@ M: color-preview model-changed
             [ <color-model> <color-preview> 1 track-add ]
             [
                 [
-                    [ truncate ] map v>integer
+                    vtruncate v>integer
                     first3 3dup "%d %d %d #%02x%02x%02x" sprintf
                 ] <arrow> <label-control>
                 f track-add
index 9511b27652c0690df9a1a68aa56c467e539ca02d..d5f1cb6200f380ce886ce00fffa71769f9b9528d 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (c) 2012 Anonymous
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel math sequences ;
+USING: kernel math math.vectors sequences ;
 IN: rosetta-code.equilibrium-index
 
 ! http://rosettacode.org/wiki/Equilibrium_index
@@ -35,5 +35,5 @@ IN: rosetta-code.equilibrium-index
     [ <reversed> ] 2dip accum-left <reversed> ; inline
 
 : equilibrium-indices ( seq -- inds )
-    0 [ + ] [ accum-left ] [ accum-right ] 3bi [ = ] 2map
+    0 [ + ] [ accum-left ] [ accum-right ] 3bi v=
     V{ } swap dup length iota [ [ suffix ] curry [ ] if ] 2each ;
index 4eafc22abe4b3de1f9c8fda3695d17d6fda11660..2b3c752f54bd152cf60aaa3cbd2e2c8801e10932 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (c) 2012 Anonymous
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel math sequences ;
+USING: kernel math math.vectors sequences ;
 IN: rosetta-code.long-multiplication
 
 ! http://rosettacode.org/wiki/Long_multiplication
@@ -21,7 +21,7 @@ IN: rosetta-code.long-multiplication
     [ * ] cartesian-map
     dup length iota [ 0 <repetition> ] map
     [ prepend ] 2map
-    [ ] [ [ 0 suffix ] dip [ + ] 2map ] map-reduce ;
+    [ ] [ [ 0 suffix ] dip v+ ] map-reduce ;
 
 : integer->digits ( x -- xs )
     { } swap  [ dup 0 > ] [ 10 /mod swap [ prefix ] dip ] while  drop ;