diff options
Diffstat (limited to 'lib/Numeric/LinearAlgebra')
-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 |
5 files changed, 17 insertions, 8 deletions
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 |