diff options
Diffstat (limited to 'lib/Numeric')
-rw-r--r-- | lib/Numeric/LinearAlgebra.hs | 3 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Algorithms.hs | 6 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Interface.hs | 4 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/LAPACK.hs | 5 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Linear.hs | 4 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests.hs | 6 |
6 files changed, 17 insertions, 11 deletions
diff --git a/lib/Numeric/LinearAlgebra.hs b/lib/Numeric/LinearAlgebra.hs index 2652f2d..7664a9f 100644 --- a/lib/Numeric/LinearAlgebra.hs +++ b/lib/Numeric/LinearAlgebra.hs | |||
@@ -14,13 +14,10 @@ This module reexports all normally required functions for Linear Algebra applica | |||
14 | ----------------------------------------------------------------------------- | 14 | ----------------------------------------------------------------------------- |
15 | module Numeric.LinearAlgebra ( | 15 | module Numeric.LinearAlgebra ( |
16 | module Data.Packed, | 16 | module Data.Packed, |
17 | module Data.Packed.Random, | ||
18 | module Numeric.LinearAlgebra.Algorithms, | 17 | module Numeric.LinearAlgebra.Algorithms, |
19 | module Numeric.LinearAlgebra.Interface | 18 | module Numeric.LinearAlgebra.Interface |
20 | ) where | 19 | ) where |
21 | 20 | ||
22 | import Data.Packed | 21 | import Data.Packed |
23 | import Data.Packed.Random | ||
24 | import Numeric.LinearAlgebra.Algorithms | 22 | import Numeric.LinearAlgebra.Algorithms |
25 | import Numeric.LinearAlgebra.Instances() | ||
26 | import Numeric.LinearAlgebra.Interface | 23 | import Numeric.LinearAlgebra.Interface |
diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs index 7de9587..55398e0 100644 --- a/lib/Numeric/LinearAlgebra/Algorithms.hs +++ b/lib/Numeric/LinearAlgebra/Algorithms.hs | |||
@@ -76,8 +76,10 @@ module Numeric.LinearAlgebra.Algorithms ( | |||
76 | ) where | 76 | ) where |
77 | 77 | ||
78 | 78 | ||
79 | import Data.Packed.Internal hiding (fromComplex, toComplex, conj, (//)) | 79 | import Data.Packed.Internal hiding ((//)) |
80 | import Data.Packed | 80 | import Data.Packed.Vector |
81 | import Data.Packed.Matrix | ||
82 | import Data.Complex | ||
81 | import Numeric.GSL.Vector | 83 | import Numeric.GSL.Vector |
82 | import Numeric.LinearAlgebra.LAPACK as LAPACK | 84 | import Numeric.LinearAlgebra.LAPACK as LAPACK |
83 | import Numeric.LinearAlgebra.Linear | 85 | import Numeric.LinearAlgebra.Linear |
diff --git a/lib/Numeric/LinearAlgebra/Interface.hs b/lib/Numeric/LinearAlgebra/Interface.hs index 750670b..30547d9 100644 --- a/lib/Numeric/LinearAlgebra/Interface.hs +++ b/lib/Numeric/LinearAlgebra/Interface.hs | |||
@@ -9,9 +9,7 @@ Maintainer : Alberto Ruiz (aruiz at um dot es) | |||
9 | Stability : provisional | 9 | Stability : provisional |
10 | Portability : portable | 10 | Portability : portable |
11 | 11 | ||
12 | Operators for frequent operations. | 12 | Some useful operators, and Show, Read, Eq, Num, Fractional, and Floating instances for Vector and Matrix. |
13 | |||
14 | This module exports Show, Read, Eq, Num, Fractional, and Floating instances for Vector and Matrix. | ||
15 | 13 | ||
16 | In the context of the standard numeric operators, one-component vectors and matrices automatically expand to match the dimensions of the other operand. | 14 | In the context of the standard numeric operators, one-component vectors and matrices automatically expand to match the dimensions of the other operand. |
17 | 15 | ||
diff --git a/lib/Numeric/LinearAlgebra/LAPACK.hs b/lib/Numeric/LinearAlgebra/LAPACK.hs index f5af8be..7f057ba 100644 --- a/lib/Numeric/LinearAlgebra/LAPACK.hs +++ b/lib/Numeric/LinearAlgebra/LAPACK.hs | |||
@@ -41,8 +41,9 @@ module Numeric.LinearAlgebra.LAPACK ( | |||
41 | schurR, schurC | 41 | schurR, schurC |
42 | ) where | 42 | ) where |
43 | 43 | ||
44 | import Data.Packed.Internal hiding (toComplex) | 44 | import Data.Packed.Internal |
45 | import Data.Packed | 45 | import Data.Packed.Matrix |
46 | import Data.Complex | ||
46 | import Numeric.GSL.Vector(vectorMapValR, FunCodeSV(Scale)) | 47 | import Numeric.GSL.Vector(vectorMapValR, FunCodeSV(Scale)) |
47 | import Foreign | 48 | import Foreign |
48 | import Foreign.C.Types (CInt) | 49 | import Foreign.C.Types (CInt) |
diff --git a/lib/Numeric/LinearAlgebra/Linear.hs b/lib/Numeric/LinearAlgebra/Linear.hs index 2568410..c802712 100644 --- a/lib/Numeric/LinearAlgebra/Linear.hs +++ b/lib/Numeric/LinearAlgebra/Linear.hs | |||
@@ -18,7 +18,9 @@ module Numeric.LinearAlgebra.Linear ( | |||
18 | Linear(..) | 18 | Linear(..) |
19 | ) where | 19 | ) where |
20 | 20 | ||
21 | import Data.Packed | 21 | import Data.Packed.Vector |
22 | import Data.Packed.Matrix | ||
23 | import Data.Complex | ||
22 | import Numeric.GSL.Vector | 24 | import Numeric.GSL.Vector |
23 | 25 | ||
24 | -- | Basic element-by-element functions. | 26 | -- | Basic element-by-element functions. |
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs index ac26466..65b0e4c 100644 --- a/lib/Numeric/LinearAlgebra/Tests.hs +++ b/lib/Numeric/LinearAlgebra/Tests.hs | |||
@@ -78,6 +78,11 @@ volSphere r = 8 * quad2 (\x y -> sqrt (r*r-x*x-y*y)) | |||
78 | 78 | ||
79 | --------------------------------------------------------------------- | 79 | --------------------------------------------------------------------- |
80 | 80 | ||
81 | derivTest = abs (d (\x-> x * d (\y-> x+y) 1) 1 - 1) < 1E-10 | ||
82 | where d f x = fst $ derivCentral 0.01 f x | ||
83 | |||
84 | --------------------------------------------------------------------- | ||
85 | |||
81 | -- besselTest = utest "bessel_J0_e" ( abs (r-expected) < e ) | 86 | -- besselTest = utest "bessel_J0_e" ( abs (r-expected) < e ) |
82 | -- where (r,e) = bessel_J0_e 5.0 | 87 | -- where (r,e) = bessel_J0_e 5.0 |
83 | -- expected = -0.17759677131433830434739701 | 88 | -- expected = -0.17759677131433830434739701 |
@@ -319,6 +324,7 @@ runTests n = do | |||
319 | -- , utest "gamma" (gamma 5 == 24.0) | 324 | -- , utest "gamma" (gamma 5 == 24.0) |
320 | -- , besselTest | 325 | -- , besselTest |
321 | -- , exponentialTest | 326 | -- , exponentialTest |
327 | , utest "deriv" derivTest | ||
322 | , utest "integrate" (abs (volSphere 2.5 - 4/3*pi*2.5^3) < 1E-8) | 328 | , utest "integrate" (abs (volSphere 2.5 - 4/3*pi*2.5^3) < 1E-8) |
323 | , utest "polySolve" (polySolveProp [1,2,3,4]) | 329 | , utest "polySolve" (polySolveProp [1,2,3,4]) |
324 | , minimizationTest | 330 | , minimizationTest |