From ebd1b62a3083015c7cf598c51bf8bd8315f4eedd Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 28 Jan 2020 16:21:33 -0800 Subject: [PATCH] math: use sorted-histogram values in a few places. --- basis/math/matrices/matrices-tests.factor | 4 ++-- extra/benchmark/knucleotide/knucleotide.factor | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/basis/math/matrices/matrices-tests.factor b/basis/math/matrices/matrices-tests.factor index 02139fb856..6d34bb8f93 100644 --- a/basis/math/matrices/matrices-tests.factor +++ b/basis/math/matrices/matrices-tests.factor @@ -675,7 +675,7 @@ PRIVATE> { 0 1 2 } { 3 4 5 } { 6 7 8 } -} matrix-except-all dup flatten sorted-histogram [ second ] map +} matrix-except-all dup flatten sorted-histogram values { [ length 9 = ] [ [ 4 = ] all? ] } 1&& ] unit-test @@ -690,7 +690,7 @@ PRIVATE> { 4 5 6 7 } { 8 9 10 11 } { 12 13 14 15 } -} matrix-except-all flatten sorted-histogram [ second ] map +} matrix-except-all flatten sorted-histogram values { [ length 16 = ] [ [ 9 = ] all? ] } 1&& ] unit-test diff --git a/extra/benchmark/knucleotide/knucleotide.factor b/extra/benchmark/knucleotide/knucleotide.factor index 67f563849c..34d5010f5d 100644 --- a/extra/benchmark/knucleotide/knucleotide.factor +++ b/extra/benchmark/knucleotide/knucleotide.factor @@ -19,7 +19,7 @@ CONSTANT: knucleotide-in "vocab:benchmark/knucleotide/knucleotide-input.txt" : handle-table ( inputs n -- ) clump - [ histogram sort-values reverse ] [ length ] bi + [ sorted-histogram reverse ] [ length ] bi '[ [ first write bl ] [ second 100 * _ /f "%.3f" printf nl ] bi