diff options
-rw-r--r-- | lib/Numeric/Container.hs | 14 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Algorithms.hs | 2 | ||||
-rw-r--r-- | lib/Numeric/Matrix.hs | 7 | ||||
-rw-r--r-- | lib/Numeric/Vector.hs | 6 |
4 files changed, 12 insertions, 17 deletions
diff --git a/lib/Numeric/Container.hs b/lib/Numeric/Container.hs index 77c9902..44e2711 100644 --- a/lib/Numeric/Container.hs +++ b/lib/Numeric/Container.hs | |||
@@ -8,7 +8,7 @@ | |||
8 | ----------------------------------------------------------------------------- | 8 | ----------------------------------------------------------------------------- |
9 | -- | | 9 | -- | |
10 | -- Module : Numeric.Container | 10 | -- Module : Numeric.Container |
11 | -- Copyright : (c) Alberto Ruiz 2007 | 11 | -- Copyright : (c) Alberto Ruiz 2010 |
12 | -- License : GPL-style | 12 | -- License : GPL-style |
13 | -- | 13 | -- |
14 | -- Maintainer : Alberto Ruiz <aruiz@um.es> | 14 | -- Maintainer : Alberto Ruiz <aruiz@um.es> |
@@ -41,7 +41,6 @@ import Numeric.GSL.Vector | |||
41 | 41 | ||
42 | import Data.Complex | 42 | import Data.Complex |
43 | import Control.Monad(ap) | 43 | import Control.Monad(ap) |
44 | --import Control.Arrow((***)) | ||
45 | 44 | ||
46 | import Numeric.LinearAlgebra.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ) | 45 | import Numeric.LinearAlgebra.LAPACK(multiplyR,multiplyC,multiplyF,multiplyQ) |
47 | 46 | ||
@@ -78,15 +77,18 @@ class (Element e) => Container c e where | |||
78 | -- | 77 | -- |
79 | -- | indexing function | 78 | -- | indexing function |
80 | atIndex :: c e -> IndexOf c -> e | 79 | atIndex :: c e -> IndexOf c -> e |
81 | -- | index of min/max element | 80 | -- | index of min element |
82 | minIndex :: c e -> IndexOf c | 81 | minIndex :: c e -> IndexOf c |
82 | -- | index of max element | ||
83 | maxIndex :: c e -> IndexOf c | 83 | maxIndex :: c e -> IndexOf c |
84 | -- | value of min/max element | 84 | -- | value of min element |
85 | minElement :: c e -> e | 85 | minElement :: c e -> e |
86 | -- | value of max element | ||
86 | maxElement :: c e -> e | 87 | maxElement :: c e -> e |
87 | -- the C functions sumX/prodX are twice as fast as using foldVector | 88 | -- the C functions sumX/prodX are twice as fast as using foldVector |
88 | -- | the sum/product of elements (faster than using @fold@ | 89 | -- | the sum of elements (faster than using @fold@) |
89 | sumElements :: c e -> e | 90 | sumElements :: c e -> e |
91 | -- | the product of elements (faster than using @fold@) | ||
90 | prodElements :: c e -> e | 92 | prodElements :: c e -> e |
91 | 93 | ||
92 | -- -- | Basic element-by-element functions. | 94 | -- -- | Basic element-by-element functions. |
@@ -215,7 +217,7 @@ class Element e => Product e where | |||
215 | multiply :: Matrix e -> Matrix e -> Matrix e | 217 | multiply :: Matrix e -> Matrix e -> Matrix e |
216 | -- | dot (inner) product | 218 | -- | dot (inner) product |
217 | dot :: Vector e -> Vector e -> e | 219 | dot :: Vector e -> Vector e -> e |
218 | -- | sum of absolute value of elements (differs in complex case from @norm1@ | 220 | -- | sum of absolute value of elements (differs in complex case from @norm1@) |
219 | absSum :: Vector e -> RealOf e | 221 | absSum :: Vector e -> RealOf e |
220 | -- | sum of absolute value of elements | 222 | -- | sum of absolute value of elements |
221 | norm1 :: Vector e -> RealOf e | 223 | norm1 :: Vector e -> RealOf e |
diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs index cf86904..6e703fa 100644 --- a/lib/Numeric/LinearAlgebra/Algorithms.hs +++ b/lib/Numeric/LinearAlgebra/Algorithms.hs | |||
@@ -77,7 +77,7 @@ module Numeric.LinearAlgebra.Algorithms ( | |||
77 | import Data.Packed.Internal hiding ((//)) | 77 | import Data.Packed.Internal hiding ((//)) |
78 | import Data.Packed.Matrix | 78 | import Data.Packed.Matrix |
79 | import Data.Complex | 79 | import Data.Complex |
80 | --import Numeric.LinearAlgebra.Linear | 80 | |
81 | import Numeric.LinearAlgebra.LAPACK as LAPACK | 81 | import Numeric.LinearAlgebra.LAPACK as LAPACK |
82 | import Data.List(foldl1') | 82 | import Data.List(foldl1') |
83 | import Data.Array | 83 | import Data.Array |
diff --git a/lib/Numeric/Matrix.hs b/lib/Numeric/Matrix.hs index 6ba870f..f462e88 100644 --- a/lib/Numeric/Matrix.hs +++ b/lib/Numeric/Matrix.hs | |||
@@ -8,7 +8,7 @@ | |||
8 | ----------------------------------------------------------------------------- | 8 | ----------------------------------------------------------------------------- |
9 | -- | | 9 | -- | |
10 | -- Module : Numeric.Matrix | 10 | -- Module : Numeric.Matrix |
11 | -- Copyright : (c) Alberto Ruiz 2007 | 11 | -- Copyright : (c) Alberto Ruiz 2010 |
12 | -- License : GPL-style | 12 | -- License : GPL-style |
13 | -- | 13 | -- |
14 | -- Maintainer : Alberto Ruiz <aruiz@um.es> | 14 | -- Maintainer : Alberto Ruiz <aruiz@um.es> |
@@ -37,13 +37,10 @@ module Numeric.Matrix ( | |||
37 | 37 | ||
38 | import Data.Packed.Vector | 38 | import Data.Packed.Vector |
39 | import Data.Packed.Matrix | 39 | import Data.Packed.Matrix |
40 | |||
40 | import Numeric.Container | 41 | import Numeric.Container |
41 | --import Numeric.LinearAlgebra.Linear | ||
42 | import Numeric.Vector | 42 | import Numeric.Vector |
43 | import Numeric.LinearAlgebra.Algorithms | 43 | import Numeric.LinearAlgebra.Algorithms |
44 | --import Control.Monad(ap) | ||
45 | |||
46 | --import Control.Arrow((***)) | ||
47 | 44 | ||
48 | ------------------------------------------------------------------- | 45 | ------------------------------------------------------------------- |
49 | 46 | ||
diff --git a/lib/Numeric/Vector.hs b/lib/Numeric/Vector.hs index 7ecd0eb..1baa6f8 100644 --- a/lib/Numeric/Vector.hs +++ b/lib/Numeric/Vector.hs | |||
@@ -3,11 +3,10 @@ | |||
3 | {-# LANGUAGE FlexibleInstances #-} | 3 | {-# LANGUAGE FlexibleInstances #-} |
4 | {-# LANGUAGE UndecidableInstances #-} | 4 | {-# LANGUAGE UndecidableInstances #-} |
5 | {-# LANGUAGE MultiParamTypeClasses #-} | 5 | {-# LANGUAGE MultiParamTypeClasses #-} |
6 | --{-# LANGUAGE FunctionalDependencies #-} | ||
7 | ----------------------------------------------------------------------------- | 6 | ----------------------------------------------------------------------------- |
8 | -- | | 7 | -- | |
9 | -- Module : Numeric.Vector | 8 | -- Module : Numeric.Vector |
10 | -- Copyright : (c) Alberto Ruiz 2007 | 9 | -- Copyright : (c) Alberto Ruiz 2010 |
11 | -- License : GPL-style | 10 | -- License : GPL-style |
12 | -- | 11 | -- |
13 | -- Maintainer : Alberto Ruiz <aruiz@um.es> | 12 | -- Maintainer : Alberto Ruiz <aruiz@um.es> |
@@ -32,12 +31,9 @@ import Data.Complex | |||
32 | 31 | ||
33 | import Data.Packed.Vector | 32 | import Data.Packed.Vector |
34 | import Data.Packed.Internal.Matrix | 33 | import Data.Packed.Internal.Matrix |
35 | --import Data.Packed.Internal.Vector(asComplex,asReal) | ||
36 | --import Data.Packed.Matrix(toColumns,fromColumns,flatten,reshape) | ||
37 | import Numeric.GSL.Vector | 34 | import Numeric.GSL.Vector |
38 | 35 | ||
39 | import Numeric.Container | 36 | import Numeric.Container |
40 | --import Numeric.LinearAlgebra.Linear | ||
41 | 37 | ||
42 | ------------------------------------------------------------------- | 38 | ------------------------------------------------------------------- |
43 | 39 | ||