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/Numeric/Chain.hs | |
parent | a3d3e0bd63a1c8215d4138195d128201ffa424e8 (diff) |
[hlint] Remove redundant brackets and $'s
Diffstat (limited to 'lib/Numeric/Chain.hs')
-rw-r--r-- | lib/Numeric/Chain.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Numeric/Chain.hs b/lib/Numeric/Chain.hs index 03ca88d..e1ab7da 100644 --- a/lib/Numeric/Chain.hs +++ b/lib/Numeric/Chain.hs | |||
@@ -98,11 +98,11 @@ minimum_cost :: (Sizes,Cost,Indexes) -> (Int,Int) -> (Sizes,Cost,Indexes) | |||
98 | minimum_cost sci fu = foldl (smaller_cost fu) sci (fulcrum_order fu) | 98 | minimum_cost sci fu = foldl (smaller_cost fu) sci (fulcrum_order fu) |
99 | 99 | ||
100 | smaller_cost :: (Int,Int) -> (Sizes,Cost,Indexes) -> ((Int,Int),(Int,Int)) -> (Sizes,Cost,Indexes) | 100 | smaller_cost :: (Int,Int) -> (Sizes,Cost,Indexes) -> ((Int,Int),(Int,Int)) -> (Sizes,Cost,Indexes) |
101 | smaller_cost (r,c) (mz,cost,ixes) ix@((lr,lc),(rr,rc)) = let op_cost = (fromJust ((cost A.! lr) A.! lc)) | 101 | smaller_cost (r,c) (mz,cost,ixes) ix@((lr,lc),(rr,rc)) = let op_cost = fromJust ((cost A.! lr) A.! lc) |
102 | + (fromJust ((cost A.! rr) A.! rc)) | 102 | + fromJust ((cost A.! rr) A.! rc) |
103 | + ((fst $ mz A.! (lr-lc+1)) | 103 | + fst (mz A.! (lr-lc+1)) |
104 | *(snd $ mz A.! lc) | 104 | * snd (mz A.! lc) |
105 | *(snd $ mz A.! rr)) | 105 | * snd (mz A.! rr) |
106 | cost' = (cost A.! r) A.! c | 106 | cost' = (cost A.! r) A.! c |
107 | in case cost' of | 107 | in case cost' of |
108 | Nothing -> let cost'' = update cost (r,c) (Just op_cost) | 108 | Nothing -> let cost'' = update cost (r,c) (Just op_cost) |
@@ -118,10 +118,10 @@ smaller_cost (r,c) (mz,cost,ixes) ix@((lr,lc),(rr,rc)) = let op_cost = (fromJust | |||
118 | fulcrum_order (r,c) = let fs' = zip (repeat r) [1..(c-1)] | 118 | fulcrum_order (r,c) = let fs' = zip (repeat r) [1..(c-1)] |
119 | in map (partner (r,c)) fs' | 119 | in map (partner (r,c)) fs' |
120 | 120 | ||
121 | partner (r,c) (a,b) = (((r-b),(c-b)),(a,b)) | 121 | partner (r,c) (a,b) = ((r-b, c-b), (a,b)) |
122 | 122 | ||
123 | order 0 = [] | 123 | order 0 = [] |
124 | order n = (order (n-1)) ++ (zip (repeat n) [1..n]) | 124 | order n = order (n-1) ++ zip (repeat n) [1..n] |
125 | 125 | ||
126 | chain_paren :: Product a => (Int,Int) -> Indexes -> Matrices a -> Matrix a | 126 | chain_paren :: Product a => (Int,Int) -> Indexes -> Matrices a -> Matrix a |
127 | chain_paren (r,c) ixes ma = let ((lr,lc),(rr,rc)) = fromJust $ (ixes A.! r) A.! c | 127 | chain_paren (r,c) ixes ma = let ((lr,lc),(rr,rc)) = fromJust $ (ixes A.! r) A.! c |