Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- comp :: (Float, Float) -> Float -> Int
- comp (l, u) h
- | h > l && h < u = 1
- | otherwise = 0
- counter :: [Float] -> [Float] -> [Int]
- counter hbs hs = (\m -> [sum( map f l) | (f, l) <- m]) zipfuncs
- where
- funcs = compfuncs hbs
- n = length funcs
- repheights = take n (repeat hs)
- zipfuncs = zip funcs repheights
- compfuncs :: [Float] -> [Float -> Int]
- compfuncs hbs = map comp (zhb hbs)
- --hb :: [Float]
- --hb = [143.74, 145, 155, 160.51]
- zhb :: [Float] -> [(Float, Float)]
- zhb hb = zip (init hb) (tail hb)
Advertisement
Add Comment
Please, Sign In to add comment