]> gitweb.factorcode.org Git - factor.git/commitdiff
math: Revert clone on median algorithm, perhaps need to revisit this. Call clump...
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 24 Mar 2013 08:14:35 +0000 (01:14 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 24 Mar 2013 08:14:35 +0000 (01:14 -0700)
basis/math/statistics/statistics.factor
extra/math/extras/extras.factor

index 68800d95901f03d07e83464aea9df494d7f737bf..90a7fcadc5e179e2befb9f2aeda2310a2409e074 100644 (file)
@@ -151,7 +151,6 @@ PRIVATE>
     bi kth-smallests first2 ;
 
 : median ( seq -- x )
-    clone
     dup length odd? [ lower-median ] [ medians + 2 / ] if ;
 
 ! quantile can be any n-tile. quartile is n = 4, percentile is n = 100
index 577f348e17c542556ba2286b24a97731573c6f99..abe99e954319102a53ec98f3e2f050c62c040a82 100644 (file)
@@ -99,7 +99,7 @@ PRIVATE>
     [ 1 ] 2dip [ [ dupd swap - ] dip * + dup ] curry map nip ;
 
 : moving-median ( u n -- v )
-    <clumps> [ median ] map ;
+    clump [ median ] map ;
 
 : moving-supremum ( u n -- v )
     <clumps> [ supremum ] map ;