diff options
Diffstat (limited to 'lib/Numeric/LinearAlgebra')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Algorithms.hs | 5 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests/Instances.hs | 2 |
2 files changed, 3 insertions, 4 deletions
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 | |||
392 | 392 | ||
393 | -- | 1 + 0.5*peps == 1, 1 + 0.6*peps /= 1 | 393 | -- | 1 + 0.5*peps == 1, 1 + 0.6*peps /= 1 |
394 | peps :: RealFloat x => x | 394 | peps :: RealFloat x => x |
395 | peps = x where x = 2.0**(fromIntegral $ 1-floatDigits x) | 395 | peps = x where x = 2.0 ** fromIntegral (1 - floatDigits x) |
396 | 396 | ||
397 | 397 | ||
398 | -- | The imaginary unit: @i = 0.0 :+ 1.0@ | 398 | -- | The imaginary unit: @i = 0.0 :+ 1.0@ |
@@ -553,8 +553,7 @@ epslist = [ (fromIntegral k, golubeps k k) | k <- [1..]] | |||
553 | geps delta = head [ k | (k,g) <- epslist, g<delta] | 553 | geps delta = head [ k | (k,g) <- epslist, g<delta] |
554 | 554 | ||
555 | expGolub m = iterate msq f !! j | 555 | expGolub m = iterate msq f !! j |
556 | where j = max 0 $ floor $ log2 $ pnorm Infinity m | 556 | where j = max 0 $ floor $ logBase 2 $ pnorm Infinity m |
557 | log2 x = log x / log 2 | ||
558 | a = m */ fromIntegral ((2::Int)^j) | 557 | a = m */ fromIntegral ((2::Int)^j) |
559 | q = geps eps -- 7 steps | 558 | q = geps eps -- 7 steps |
560 | eye = ident (rows m) | 559 | eye = ident (rows m) |
diff --git a/lib/Numeric/LinearAlgebra/Tests/Instances.hs b/lib/Numeric/LinearAlgebra/Tests/Instances.hs index 771739a..6dd9cfe 100644 --- a/lib/Numeric/LinearAlgebra/Tests/Instances.hs +++ b/lib/Numeric/LinearAlgebra/Tests/Instances.hs | |||
@@ -84,7 +84,7 @@ instance (Element a, Arbitrary a) => Arbitrary (Matrix a) where | |||
84 | 84 | ||
85 | #if MIN_VERSION_QuickCheck(2,0,0) | 85 | #if MIN_VERSION_QuickCheck(2,0,0) |
86 | -- shrink any one of the components | 86 | -- shrink any one of the components |
87 | shrink a = map ((rows a) >< (cols a)) | 87 | shrink a = map (rows a >< cols a) |
88 | . shrinkListElementwise | 88 | . shrinkListElementwise |
89 | . concat . toLists | 89 | . concat . toLists |
90 | $ a | 90 | $ a |