From 49df400d892d4f51cbe724f5677aec70753b0408 Mon Sep 17 00:00:00 2001 From: Khudyakov Alexey Date: Wed, 29 Sep 2010 12:35:11 +0000 Subject: [hlint] Remove redundant brackets and $'s --- lib/Numeric/Chain.hs | 14 +++++++------- lib/Numeric/Container.hs | 4 ++-- lib/Numeric/LinearAlgebra/Algorithms.hs | 5 ++--- lib/Numeric/LinearAlgebra/Tests/Instances.hs | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) (limited to 'lib/Numeric') 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) minimum_cost sci fu = foldl (smaller_cost fu) sci (fulcrum_order fu) smaller_cost :: (Int,Int) -> (Sizes,Cost,Indexes) -> ((Int,Int),(Int,Int)) -> (Sizes,Cost,Indexes) -smaller_cost (r,c) (mz,cost,ixes) ix@((lr,lc),(rr,rc)) = let op_cost = (fromJust ((cost A.! lr) A.! lc)) - + (fromJust ((cost A.! rr) A.! rc)) - + ((fst $ mz A.! (lr-lc+1)) - *(snd $ mz A.! lc) - *(snd $ mz A.! rr)) +smaller_cost (r,c) (mz,cost,ixes) ix@((lr,lc),(rr,rc)) = let op_cost = fromJust ((cost A.! lr) A.! lc) + + fromJust ((cost A.! rr) A.! rc) + + fst (mz A.! (lr-lc+1)) + * snd (mz A.! lc) + * snd (mz A.! rr) cost' = (cost A.! r) A.! c in case cost' of 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 fulcrum_order (r,c) = let fs' = zip (repeat r) [1..(c-1)] in map (partner (r,c)) fs' -partner (r,c) (a,b) = (((r-b),(c-b)),(a,b)) +partner (r,c) (a,b) = ((r-b, c-b), (a,b)) order 0 = [] -order n = (order (n-1)) ++ (zip (repeat n) [1..n]) +order n = order (n-1) ++ zip (repeat n) [1..n] chain_paren :: Product a => (Int,Int) -> Indexes -> Matrices a -> Matrix a chain_paren (r,c) ixes ma = let ((lr,lc),(rr,rc)) = fromJust $ (ixes A.! r) A.! c diff --git a/lib/Numeric/Container.hs b/lib/Numeric/Container.hs index 45b33e0..621574e 100644 --- a/lib/Numeric/Container.hs +++ b/lib/Numeric/Container.hs @@ -117,10 +117,10 @@ instance Mul Matrix Matrix Matrix where (<>) = mXm instance Mul Matrix Vector Vector where - (<>) m v = flatten $ m <> (asColumn v) + (<>) m v = flatten $ m <> asColumn v instance Mul Vector Matrix Vector where - (<>) v m = flatten $ (asRow v) <> m + (<>) v m = flatten $ asRow v <> m -------------------------------------------------------- diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs index f4f8bca..dd93db2 100644 --- a/lib/Numeric/LinearAlgebra/Algorithms.hs +++ b/lib/Numeric/LinearAlgebra/Algorithms.hs @@ -392,7 +392,7 @@ eps = 2.22044604925031e-16 -- | 1 + 0.5*peps == 1, 1 + 0.6*peps /= 1 peps :: RealFloat x => x -peps = x where x = 2.0**(fromIntegral $ 1-floatDigits x) +peps = x where x = 2.0 ** fromIntegral (1 - floatDigits x) -- | The imaginary unit: @i = 0.0 :+ 1.0@ @@ -553,8 +553,7 @@ epslist = [ (fromIntegral k, golubeps k k) | k <- [1..]] geps delta = head [ k | (k,g) <- epslist, g Arbitrary (Matrix a) where #if MIN_VERSION_QuickCheck(2,0,0) -- shrink any one of the components - shrink a = map ((rows a) >< (cols a)) + shrink a = map (rows a >< cols a) . shrinkListElementwise . concat . toLists $ a -- cgit v1.2.3