Permalink
Browse files

Fixed "freq" - it was not normalized to 1. Bump to 1.0.8.

  • Loading branch information...
1 parent 20910fe commit 91115cbf71a5c8a1bcc814d43f863857ddd373f3 @jkff committed May 1, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 Tools/TimePlot/Plots.hs
  2. +1 −1 timeplot.cabal
@@ -32,7 +32,8 @@ initGen (KindACount bs) = genActivity (\sns n -> n) bs
initGen (KindAPercent bs b) = genActivity (\sns n -> 100*n/b) bs
initGen (KindAFreq bs) = genActivity (\sns n -> if n == 0 then 0 else (n / sum (M.elems sns))) bs
initGen (KindFreq bs k) = genAtoms atoms2freqs bs k
- where atoms2freqs as m = let n = length as in 0:[fromIntegral (M.findWithDefault 0 a m)/fromIntegral n | a <- as]
+ where atoms2freqs as m = let s = sum [c | (a,c) <- M.toList m]
+ in if s==0 then [0] else 0:[fromIntegral (M.findWithDefault 0 a m)/fromIntegral s | a <- as]
initGen (KindHistogram bs k) = genAtoms atoms2hist bs k
where atoms2hist as m = 0:[fromIntegral (M.findWithDefault 0 a m) | a <- as]
initGen KindEvent = genEvent
View
@@ -1,5 +1,5 @@
name: timeplot
-version: 1.0.7
+version: 1.0.8
cabal-version: >=1.6
build-type: Simple
license: BSD3

0 comments on commit 91115cb

Please sign in to comment.