From 0e45006f1f5a5c0837aef19726a496394fff2436 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Tue, 17 Jan 2023 14:59:10 +1100 Subject: scale graph nodes to parent --- bin/cluster.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cluster.hs b/bin/cluster.hs index 8d1745d..4d67541 100644 --- a/bin/cluster.hs +++ b/bin/cluster.hs @@ -92,9 +92,9 @@ drawGraph path ps cl = writeFile path $ "digraph{" <> edges <> "}" fmtDbl = show . (/ 10) . fromIntegral . round . (* 1000) ps' = transpose $ map norm ps - -- Normalise to purity of first node + -- Normalise to frequency of parent norm :: [Double] -> [Double] - norm (x : xs) = x : map (/ x) xs + norm xxs@(x : xs) = x : zipWith (\i y -> y / xxs !! parent i) [1..] xs -- Command line args data Options = Options -- cgit v1.2.3