diff options
author | Khudyakov Alexey <alexey.skladnoy@gmail.com> | 2010-09-29 12:35:11 +0000 |
---|---|---|
committer | Khudyakov Alexey <alexey.skladnoy@gmail.com> | 2010-09-29 12:35:11 +0000 |
commit | 49df400d892d4f51cbe724f5677aec70753b0408 (patch) | |
tree | a49eaa7f4bb6301c4225aab8ec25718bc4870634 /lib/Data/Packed | |
parent | a3d3e0bd63a1c8215d4138195d128201ffa424e8 (diff) |
[hlint] Remove redundant brackets and $'s
Diffstat (limited to 'lib/Data/Packed')
-rw-r--r-- | lib/Data/Packed/Internal/Matrix.hs | 2 | ||||
-rw-r--r-- | lib/Data/Packed/Matrix.hs | 4 | ||||
-rw-r--r-- | lib/Data/Packed/Random.hs | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index c4491fb..29aba51 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs | |||
@@ -160,7 +160,7 @@ fromRows vs = case compatdim (map dim vs) of | |||
160 | -- | extracts the rows of a matrix as a list of vectors | 160 | -- | extracts the rows of a matrix as a list of vectors |
161 | toRows :: Element t => Matrix t -> [Vector t] | 161 | toRows :: Element t => Matrix t -> [Vector t] |
162 | toRows m = toRows' 0 where | 162 | toRows m = toRows' 0 where |
163 | v = flatten $ m | 163 | v = flatten m |
164 | r = rows m | 164 | r = rows m |
165 | c = cols m | 165 | c = cols m |
166 | toRows' k | k == r*c = [] | 166 | toRows' k | k == r*c = [] |
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs index 2efb08d..de2300a 100644 --- a/lib/Data/Packed/Matrix.hs +++ b/lib/Data/Packed/Matrix.hs | |||
@@ -269,7 +269,7 @@ Hilbert matrix of order N: | |||
269 | -} | 269 | -} |
270 | buildMatrix :: Element a => Int -> Int -> ((Int, Int) -> a) -> Matrix a | 270 | buildMatrix :: Element a => Int -> Int -> ((Int, Int) -> a) -> Matrix a |
271 | buildMatrix rc cc f = | 271 | buildMatrix rc cc f = |
272 | fromLists $ map (\x -> map f x) | 272 | fromLists $ map (map f) |
273 | $ map (\ ri -> map (\ ci -> (ri, ci)) [0 .. (cc - 1)]) [0 .. (rc - 1)] | 273 | $ map (\ ri -> map (\ ci -> (ri, ci)) [0 .. (cc - 1)]) [0 .. (rc - 1)] |
274 | 274 | ||
275 | ----------------------------------------------------- | 275 | ----------------------------------------------------- |
@@ -283,7 +283,7 @@ fromArray2D m = (r><c) (elems m) | |||
283 | 283 | ||
284 | -- | rearranges the rows of a matrix according to the order given in a list of integers. | 284 | -- | rearranges the rows of a matrix according to the order given in a list of integers. |
285 | extractRows :: Element t => [Int] -> Matrix t -> Matrix t | 285 | extractRows :: Element t => [Int] -> Matrix t -> Matrix t |
286 | extractRows l m = fromRows $ extract (toRows $ m) l | 286 | extractRows l m = fromRows $ extract (toRows m) l |
287 | where extract l' is = [l'!!i |i<-is] | 287 | where extract l' is = [l'!!i |i<-is] |
288 | 288 | ||
289 | {- | creates matrix by repetition of a matrix a given number of rows and columns | 289 | {- | creates matrix by repetition of a matrix a given number of rows and columns |
diff --git a/lib/Data/Packed/Random.hs b/lib/Data/Packed/Random.hs index 14d91ea..4b229f0 100644 --- a/lib/Data/Packed/Random.hs +++ b/lib/Data/Packed/Random.hs | |||
@@ -63,4 +63,4 @@ meanCov x = (med,cov) where | |||
63 | med = konst k r `vXm` x | 63 | med = konst k r `vXm` x |
64 | meds = konst 1 r `outer` med | 64 | meds = konst 1 r `outer` med |
65 | xc = x `sub` meds | 65 | xc = x `sub` meds |
66 | cov = flip scale (trans xc `mXm` xc) (recip (fromIntegral (r-1))) | 66 | cov = scale (recip (fromIntegral (r-1))) (trans xc `mXm` xc) |