diff options
Diffstat (limited to 'packages/base/src')
-rw-r--r-- | packages/base/src/Data/Packed/IO.hs | 1 | ||||
-rw-r--r-- | packages/base/src/Data/Packed/Internal/Numeric.hs | 1 | ||||
-rw-r--r-- | packages/base/src/Data/Packed/Internal/Vector.hs | 1 | ||||
-rw-r--r-- | packages/base/src/Data/Packed/Numeric.hs | 1 | ||||
-rw-r--r-- | packages/base/src/Numeric/Chain.hs | 2 | ||||
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Algorithms.hs | 5 | ||||
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Static.hs | 28 | ||||
-rw-r--r-- | packages/base/src/Numeric/LinearAlgebra/Util/CG.hs | 6 | ||||
-rw-r--r-- | packages/base/src/Numeric/Vectorized.hs | 1 |
9 files changed, 10 insertions, 36 deletions
diff --git a/packages/base/src/Data/Packed/IO.hs b/packages/base/src/Data/Packed/IO.hs index 85f1b37..b0999a8 100644 --- a/packages/base/src/Data/Packed/IO.hs +++ b/packages/base/src/Data/Packed/IO.hs | |||
@@ -22,7 +22,6 @@ import Text.Printf(printf) | |||
22 | import Data.List(intersperse) | 22 | import Data.List(intersperse) |
23 | import Data.Complex | 23 | import Data.Complex |
24 | import Numeric.Vectorized(vectorScan,saveMatrix) | 24 | import Numeric.Vectorized(vectorScan,saveMatrix) |
25 | import Control.Applicative((<$>)) | ||
26 | import Data.Packed.Internal | 25 | import Data.Packed.Internal |
27 | 26 | ||
28 | {- | Creates a string from a matrix given a separator and a function to show each entry. Using | 27 | {- | Creates a string from a matrix given a separator and a function to show each entry. Using |
diff --git a/packages/base/src/Data/Packed/Internal/Numeric.hs b/packages/base/src/Data/Packed/Internal/Numeric.hs index 257ad73..7a4dd29 100644 --- a/packages/base/src/Data/Packed/Internal/Numeric.hs +++ b/packages/base/src/Data/Packed/Internal/Numeric.hs | |||
@@ -48,7 +48,6 @@ import Numeric.Conversion | |||
48 | import Data.Packed.Development | 48 | import Data.Packed.Development |
49 | import Numeric.Vectorized | 49 | import Numeric.Vectorized |
50 | import Data.Complex | 50 | import Data.Complex |
51 | import Control.Applicative((<*>)) | ||
52 | 51 | ||
53 | import Numeric.LinearAlgebra.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ) | 52 | import Numeric.LinearAlgebra.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ) |
54 | import Data.Packed.Internal | 53 | import Data.Packed.Internal |
diff --git a/packages/base/src/Data/Packed/Internal/Vector.hs b/packages/base/src/Data/Packed/Internal/Vector.hs index d0bc143..b49f379 100644 --- a/packages/base/src/Data/Packed/Internal/Vector.hs +++ b/packages/base/src/Data/Packed/Internal/Vector.hs | |||
@@ -35,7 +35,6 @@ import Foreign.Ptr(Ptr) | |||
35 | import Foreign.Storable(Storable, peekElemOff, pokeElemOff, sizeOf) | 35 | import Foreign.Storable(Storable, peekElemOff, pokeElemOff, sizeOf) |
36 | import Foreign.C.Types | 36 | import Foreign.C.Types |
37 | import Data.Complex | 37 | import Data.Complex |
38 | import Control.Monad(when) | ||
39 | import System.IO.Unsafe(unsafePerformIO) | 38 | import System.IO.Unsafe(unsafePerformIO) |
40 | 39 | ||
41 | #if __GLASGOW_HASKELL__ >= 605 | 40 | #if __GLASGOW_HASKELL__ >= 605 |
diff --git a/packages/base/src/Data/Packed/Numeric.hs b/packages/base/src/Data/Packed/Numeric.hs index 6027f43..b2395f2 100644 --- a/packages/base/src/Data/Packed/Numeric.hs +++ b/packages/base/src/Data/Packed/Numeric.hs | |||
@@ -71,7 +71,6 @@ import Data.Packed | |||
71 | import Data.Packed.Internal.Numeric | 71 | import Data.Packed.Internal.Numeric |
72 | import Data.Complex | 72 | import Data.Complex |
73 | import Numeric.LinearAlgebra.Algorithms(Field,linearSolveSVD) | 73 | import Numeric.LinearAlgebra.Algorithms(Field,linearSolveSVD) |
74 | import Data.Monoid(Monoid(mconcat)) | ||
75 | import Data.Packed.IO | 74 | import Data.Packed.IO |
76 | import Numeric.LinearAlgebra.Random | 75 | import Numeric.LinearAlgebra.Random |
77 | 76 | ||
diff --git a/packages/base/src/Numeric/Chain.hs b/packages/base/src/Numeric/Chain.hs index 443bd28..64c09c0 100644 --- a/packages/base/src/Numeric/Chain.hs +++ b/packages/base/src/Numeric/Chain.hs | |||
@@ -1,3 +1,5 @@ | |||
1 | {-# LANGUAGE FlexibleContexts #-} | ||
2 | |||
1 | ----------------------------------------------------------------------------- | 3 | ----------------------------------------------------------------------------- |
2 | -- | | 4 | -- | |
3 | -- Module : Numeric.Chain | 5 | -- Module : Numeric.Chain |
diff --git a/packages/base/src/Numeric/LinearAlgebra/Algorithms.hs b/packages/base/src/Numeric/LinearAlgebra/Algorithms.hs index 02ac6a0..a113d48 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Algorithms.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Algorithms.hs | |||
@@ -935,10 +935,9 @@ relativeError' x y = dig (norm (x `sub` y) / norm x) | |||
935 | dig r = round $ -logBase 10 (realToFrac r :: Double) | 935 | dig r = round $ -logBase 10 (realToFrac r :: Double) |
936 | 936 | ||
937 | 937 | ||
938 | relativeError :: (Normed c t, Num (c t)) => NormType -> c t -> c t -> Double | 938 | relativeError :: Num a => (a -> Double) -> a -> a -> Double |
939 | relativeError t a b = realToFrac r | 939 | relativeError norm a b = r |
940 | where | 940 | where |
941 | norm = pnorm t | ||
942 | na = norm a | 941 | na = norm a |
943 | nb = norm b | 942 | nb = norm b |
944 | nab = norm (a-b) | 943 | nab = norm (a-b) |
diff --git a/packages/base/src/Numeric/LinearAlgebra/Static.hs b/packages/base/src/Numeric/LinearAlgebra/Static.hs index 3398e6a..4c3186f 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Static.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Static.hs | |||
@@ -1,5 +1,3 @@ | |||
1 | #if __GLASGOW_HASKELL__ >= 708 | ||
2 | |||
3 | {-# LANGUAGE DataKinds #-} | 1 | {-# LANGUAGE DataKinds #-} |
4 | {-# LANGUAGE KindSignatures #-} | 2 | {-# LANGUAGE KindSignatures #-} |
5 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} | 3 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} |
@@ -13,7 +11,6 @@ | |||
13 | {-# LANGUAGE TypeOperators #-} | 11 | {-# LANGUAGE TypeOperators #-} |
14 | {-# LANGUAGE ViewPatterns #-} | 12 | {-# LANGUAGE ViewPatterns #-} |
15 | {-# LANGUAGE GADTs #-} | 13 | {-# LANGUAGE GADTs #-} |
16 | {-# LANGUAGE OverlappingInstances #-} | ||
17 | {-# LANGUAGE TypeFamilies #-} | 14 | {-# LANGUAGE TypeFamilies #-} |
18 | 15 | ||
19 | 16 | ||
@@ -184,8 +181,9 @@ a ¦ b = tr (tr a —— tr b) | |||
184 | type Sq n = L n n | 181 | type Sq n = L n n |
185 | --type CSq n = CL n n | 182 | --type CSq n = CL n n |
186 | 183 | ||
187 | type GL = forall n m. (KnownNat n, KnownNat m) => L m n | 184 | |
188 | type GSq = forall n. KnownNat n => Sq n | 185 | type GL = forall n m . (KnownNat n, KnownNat m) => L m n |
186 | type GSq = forall n . KnownNat n => Sq n | ||
189 | 187 | ||
190 | isKonst :: forall m n . (KnownNat m, KnownNat n) => L m n -> Maybe (ℝ,(Int,Int)) | 188 | isKonst :: forall m n . (KnownNat m, KnownNat n) => L m n -> Maybe (ℝ,(Int,Int)) |
191 | isKonst s@(unwrap -> x) | 189 | isKonst s@(unwrap -> x) |
@@ -618,23 +616,3 @@ instance (KnownNat n', KnownNat m') => Testable (L n' m') | |||
618 | where | 616 | where |
619 | checkT _ = test | 617 | checkT _ = test |
620 | 618 | ||
621 | #else | ||
622 | |||
623 | {- | | ||
624 | Module : Numeric.LinearAlgebra.Static | ||
625 | Copyright : (c) Alberto Ruiz 2014 | ||
626 | License : BSD3 | ||
627 | Stability : experimental | ||
628 | |||
629 | Experimental interface with statically checked dimensions. | ||
630 | |||
631 | This module requires GHC >= 7.8 | ||
632 | |||
633 | -} | ||
634 | |||
635 | module Numeric.LinearAlgebra.Static | ||
636 | {-# WARNING "This module requires GHC >= 7.8" #-} | ||
637 | where | ||
638 | |||
639 | #endif | ||
640 | |||
diff --git a/packages/base/src/Numeric/LinearAlgebra/Util/CG.hs b/packages/base/src/Numeric/LinearAlgebra/Util/CG.hs index b82c74f..899a5bf 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Util/CG.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Util/CG.hs | |||
@@ -9,7 +9,7 @@ module Numeric.LinearAlgebra.Util.CG( | |||
9 | import Data.Packed.Numeric | 9 | import Data.Packed.Numeric |
10 | import Numeric.Sparse | 10 | import Numeric.Sparse |
11 | import Numeric.Vector() | 11 | import Numeric.Vector() |
12 | import Numeric.LinearAlgebra.Algorithms(linearSolveLS, relativeError, NormType(..)) | 12 | import Numeric.LinearAlgebra.Algorithms(linearSolveLS, relativeError, pnorm, NormType(..)) |
13 | import Control.Arrow((***)) | 13 | import Control.Arrow((***)) |
14 | 14 | ||
15 | {- | 15 | {- |
@@ -142,13 +142,13 @@ instance Testable GMatrix | |||
142 | print s3; print d3 | 142 | print s3; print d3 |
143 | print s4; print d4 | 143 | print s4; print d4 |
144 | print s5; print d5 | 144 | print s5; print d5 |
145 | print $ relativeError Infinity s5 d5 | 145 | print $ relativeError (pnorm Infinity) s5 d5 |
146 | 146 | ||
147 | ok = s1==d1 | 147 | ok = s1==d1 |
148 | && s2==d2 | 148 | && s2==d2 |
149 | && s3==d3 | 149 | && s3==d3 |
150 | && s4==d4 | 150 | && s4==d4 |
151 | && relativeError Infinity s5 d5 < 1E-10 | 151 | && relativeError (pnorm Infinity) s5 d5 < 1E-10 |
152 | 152 | ||
153 | disp = putStr . dispf 2 | 153 | disp = putStr . dispf 2 |
154 | 154 | ||
diff --git a/packages/base/src/Numeric/Vectorized.hs b/packages/base/src/Numeric/Vectorized.hs index 6f0d240..405ae01 100644 --- a/packages/base/src/Numeric/Vectorized.hs +++ b/packages/base/src/Numeric/Vectorized.hs | |||
@@ -37,7 +37,6 @@ import Foreign.C.String | |||
37 | import System.IO.Unsafe(unsafePerformIO) | 37 | import System.IO.Unsafe(unsafePerformIO) |
38 | 38 | ||
39 | import Control.Monad(when) | 39 | import Control.Monad(when) |
40 | import Control.Applicative((<$>)) | ||
41 | 40 | ||
42 | 41 | ||
43 | 42 | ||