diff options
-rw-r--r-- | INSTALL | 4 | ||||
-rw-r--r-- | README | 17 | ||||
-rw-r--r-- | hmatrix.cabal | 4 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 2 | ||||
-rw-r--r-- | lib/Graphics/Plot.hs | 23 | ||||
-rw-r--r-- | lib/Numeric/GSL.hs | 1 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Algorithms.hs | 1 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/LAPACK.hs | 1 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Linear.hs | 1 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Tests.hs | 2 |
10 files changed, 20 insertions, 36 deletions
@@ -4,8 +4,8 @@ | |||
4 | 4 | ||
5 | INSTALLATION | 5 | INSTALLATION |
6 | 6 | ||
7 | Recommended method: | 7 | Recommended method (ok in Ubuntu/Debian systems): |
8 | $ sudo apt-get install libgsl0-dev refblas3-dev lapack3-dev atlas3-[your arch]-dev | 8 | $ sudo apt-get install libgsl0-dev liblapack-dev |
9 | $ cabal install hmatrix | 9 | $ cabal install hmatrix |
10 | 10 | ||
11 | Detailed installation instructions: | 11 | Detailed installation instructions: |
@@ -4,25 +4,13 @@ | |||
4 | 4 | ||
5 | INSTALLATION | 5 | INSTALLATION |
6 | 6 | ||
7 | Recommended method (ok in Ubuntu/Debian systems): | 7 | See the INSTALL file. |
8 | $ sudo apt-get install libgsl0-dev refblas3-dev lapack3-dev atlas3-[your_arch]-dev | ||
9 | $ cabal install hmatrix | ||
10 | |||
11 | Detailed installation instructions: | ||
12 | http://www.hmatrix.googlepages.com/installation | ||
13 | |||
14 | For installation in Windows see the companion INSTALL file. | ||
15 | 8 | ||
16 | TESTS --------------------------------------------- | 9 | TESTS --------------------------------------------- |
17 | 10 | ||
18 | $ ghci | 11 | $ ghci |
19 | GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help | ||
20 | Prelude> Numeric.LinearAlgebra.Tests.runTests 20 | 12 | Prelude> Numeric.LinearAlgebra.Tests.runTests 20 |
21 | 13 | ||
22 | Additional tests with big matrices (taking a few minutes): | ||
23 | |||
24 | $ runhaskell examples/experiments/bigtests | ||
25 | |||
26 | EXAMPLES ------------------------------------------------------ | 14 | EXAMPLES ------------------------------------------------------ |
27 | 15 | ||
28 | $ ghci | 16 | $ ghci |
@@ -60,9 +48,6 @@ KNOWN PROBLEMS / BUGS ------------------------------- | |||
60 | produced segmentation faults when working with big matrices | 48 | produced segmentation faults when working with big matrices |
61 | on compiled programs. | 49 | on compiled programs. |
62 | 50 | ||
63 | - On distributions with old GSL versions you should comment out a couple of functions | ||
64 | in the export lists of Ellint.hs and Debye.hs | ||
65 | |||
66 | ACKNOWLEDGEMENTS ----------------------------------------------------- | 51 | ACKNOWLEDGEMENTS ----------------------------------------------------- |
67 | 52 | ||
68 | I thank Don Stewart, Henning Thielemann, Bulat Ziganshin and all the people | 53 | I thank Don Stewart, Henning Thielemann, Bulat Ziganshin and all the people |
diff --git a/hmatrix.cabal b/hmatrix.cabal index 64fef13..a7662b9 100644 --- a/hmatrix.cabal +++ b/hmatrix.cabal | |||
@@ -1,5 +1,5 @@ | |||
1 | Name: hmatrix | 1 | Name: hmatrix |
2 | Version: 0.7.2.0 | 2 | Version: 0.7.2.1 |
3 | License: GPL | 3 | License: GPL |
4 | License-file: LICENSE | 4 | License-file: LICENSE |
5 | Author: Alberto Ruiz | 5 | Author: Alberto Ruiz |
@@ -11,7 +11,7 @@ Description: This library provides a purely functional interface to basic | |||
11 | and other numerical computations, internally implemented using | 11 | and other numerical computations, internally implemented using |
12 | GSL, BLAS and LAPACK. | 12 | GSL, BLAS and LAPACK. |
13 | Category: Math | 13 | Category: Math |
14 | tested-with: GHC ==6.10.4 | 14 | tested-with: GHC ==6.12.1 |
15 | 15 | ||
16 | cabal-version: >=1.2 | 16 | cabal-version: >=1.2 |
17 | build-type: Custom | 17 | build-type: Custom |
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index 009297a..bc623de 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs | |||
@@ -41,7 +41,9 @@ import Foreign.ForeignPtr (mallocForeignPtrBytes) | |||
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | import GHC.Base | 43 | import GHC.Base |
44 | #if __GLASGOW_HASKELL__ < 612 | ||
44 | import GHC.IOBase | 45 | import GHC.IOBase |
46 | #endif | ||
45 | 47 | ||
46 | -- | A one-dimensional array of objects stored in a contiguous memory block. | 48 | -- | A one-dimensional array of objects stored in a contiguous memory block. |
47 | data Vector t = | 49 | data Vector t = |
diff --git a/lib/Graphics/Plot.hs b/lib/Graphics/Plot.hs index b3cf9d9..510e1b7 100644 --- a/lib/Graphics/Plot.hs +++ b/lib/Graphics/Plot.hs | |||
@@ -51,7 +51,7 @@ meshdom :: Vector Double -> Vector Double -> (Matrix Double , Matrix Double) | |||
51 | meshdom r1 r2 = (outer r1 (constant 1 (size r2)), outer (constant 1 (size r1)) r2) | 51 | meshdom r1 r2 = (outer r1 (constant 1 (size r2)), outer (constant 1 (size r1)) r2) |
52 | 52 | ||
53 | gnuplotX :: String -> IO () | 53 | gnuplotX :: String -> IO () |
54 | gnuplotX command = do {system cmdstr; return()} where | 54 | gnuplotX command = do { _ <- system cmdstr; return()} where |
55 | cmdstr = "echo \""++command++"\" | gnuplot -persist" | 55 | cmdstr = "echo \""++command++"\" | gnuplot -persist" |
56 | 56 | ||
57 | datafollows = "\\\"-\\\"" | 57 | datafollows = "\\\"-\\\"" |
@@ -76,8 +76,8 @@ mesh' m = do | |||
76 | writeFile "splot-gnu-command" "splot \"splot-tmp.txt\" matrix with lines; pause -1"; | 76 | writeFile "splot-gnu-command" "splot \"splot-tmp.txt\" matrix with lines; pause -1"; |
77 | toFile' "splot-tmp.txt" m | 77 | toFile' "splot-tmp.txt" m |
78 | putStr "Press [Return] to close the graphic and continue... " | 78 | putStr "Press [Return] to close the graphic and continue... " |
79 | system "gnuplot -persist splot-gnu-command" | 79 | _ <- system "gnuplot -persist splot-gnu-command" |
80 | system "rm splot-tmp.txt splot-gnu-command" | 80 | _ <- system "rm splot-tmp.txt splot-gnu-command" |
81 | return () | 81 | return () |
82 | 82 | ||
83 | {- | Draws the surface represented by the function f in the desired ranges and number of points, internally using 'mesh'. | 83 | {- | Draws the surface represented by the function f in the desired ranges and number of points, internally using 'mesh'. |
@@ -161,7 +161,7 @@ matrixToPGM m = header ++ unlines (map unwords ll) where | |||
161 | -- | imshow shows a representation of a matrix as a gray level image using ImageMagick's display. | 161 | -- | imshow shows a representation of a matrix as a gray level image using ImageMagick's display. |
162 | imshow :: Matrix Double -> IO () | 162 | imshow :: Matrix Double -> IO () |
163 | imshow m = do | 163 | imshow m = do |
164 | system $ "echo \""++ matrixToPGM m ++"\"| display -antialias -resize 300 - &" | 164 | _ <- system $ "echo \""++ matrixToPGM m ++"\"| display -antialias -resize 300 - &" |
165 | return () | 165 | return () |
166 | 166 | ||
167 | ---------------------------------------------------- | 167 | ---------------------------------------------------- |
@@ -173,12 +173,12 @@ gnuplotpdf title command ds = gnuplot (prelude ++ command ++" "++ draw) >> postp | |||
173 | draw = concat (intersperse ", " (map ("\"-\" "++) defs)) ++ "\n" ++ | 173 | draw = concat (intersperse ", " (map ("\"-\" "++) defs)) ++ "\n" ++ |
174 | concatMap pr dats | 174 | concatMap pr dats |
175 | postproc = do | 175 | postproc = do |
176 | system $ "epstopdf "++title++".eps" | 176 | _ <- system $ "epstopdf "++title++".eps" |
177 | mklatex | 177 | mklatex |
178 | system $ "pdflatex "++title++"aux.tex > /dev/null" | 178 | _ <- system $ "pdflatex "++title++"aux.tex > /dev/null" |
179 | system $ "pdfcrop "++title++"aux.pdf > /dev/null" | 179 | _ <- system $ "pdfcrop "++title++"aux.pdf > /dev/null" |
180 | system $ "mv "++title++"aux-crop.pdf "++title++".pdf" | 180 | _ <- system $ "mv "++title++"aux-crop.pdf "++title++".pdf" |
181 | system $ "rm "++title++"aux.* "++title++".eps "++title++".tex" | 181 | _ <- system $ "rm "++title++"aux.* "++title++".eps "++title++".tex" |
182 | return () | 182 | return () |
183 | 183 | ||
184 | mklatex = writeFile (title++"aux.tex") $ | 184 | mklatex = writeFile (title++"aux.tex") $ |
@@ -201,5 +201,6 @@ gnuplotpdf title command ds = gnuplot (prelude ++ command ++" "++ draw) >> postp | |||
201 | 201 | ||
202 | gnuplot cmd = do | 202 | gnuplot cmd = do |
203 | writeFile "gnuplotcommand" cmd | 203 | writeFile "gnuplotcommand" cmd |
204 | system "gnuplot gnuplotcommand" | 204 | _ <- system "gnuplot gnuplotcommand" |
205 | system "rm gnuplotcommand" | 205 | _ <- system "rm gnuplotcommand" |
206 | return () | ||
diff --git a/lib/Numeric/GSL.hs b/lib/Numeric/GSL.hs index 2e90fff..cc5d156 100644 --- a/lib/Numeric/GSL.hs +++ b/lib/Numeric/GSL.hs | |||
@@ -32,7 +32,6 @@ import Numeric.GSL.Polynomials | |||
32 | import Numeric.GSL.Minimization | 32 | import Numeric.GSL.Minimization |
33 | import Numeric.GSL.Root | 33 | import Numeric.GSL.Root |
34 | import Complex | 34 | import Complex |
35 | import Numeric.GSL.Special | ||
36 | 35 | ||
37 | 36 | ||
38 | -- | This action removes the GSL default error handler (which aborts the program), so that | 37 | -- | This action removes the GSL default error handler (which aborts the program), so that |
diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs index 954b214..e0cc0a0 100644 --- a/lib/Numeric/LinearAlgebra/Algorithms.hs +++ b/lib/Numeric/LinearAlgebra/Algorithms.hs | |||
@@ -72,7 +72,6 @@ import Data.Packed.Internal hiding (fromComplex, toComplex, conj, (//)) | |||
72 | import Data.Packed | 72 | import Data.Packed |
73 | import Numeric.GSL.Vector | 73 | import Numeric.GSL.Vector |
74 | import Numeric.LinearAlgebra.LAPACK as LAPACK | 74 | import Numeric.LinearAlgebra.LAPACK as LAPACK |
75 | import Complex | ||
76 | import Numeric.LinearAlgebra.Linear | 75 | import Numeric.LinearAlgebra.Linear |
77 | import Data.List(foldl1') | 76 | import Data.List(foldl1') |
78 | import Data.Array | 77 | import Data.Array |
diff --git a/lib/Numeric/LinearAlgebra/LAPACK.hs b/lib/Numeric/LinearAlgebra/LAPACK.hs index ffa2cb5..30a3d3b 100644 --- a/lib/Numeric/LinearAlgebra/LAPACK.hs +++ b/lib/Numeric/LinearAlgebra/LAPACK.hs | |||
@@ -30,7 +30,6 @@ module Numeric.LinearAlgebra.LAPACK ( | |||
30 | import Data.Packed.Internal hiding (toComplex) | 30 | import Data.Packed.Internal hiding (toComplex) |
31 | import Data.Packed | 31 | import Data.Packed |
32 | import Numeric.GSL.Vector(vectorMapValR, FunCodeSV(Scale)) | 32 | import Numeric.GSL.Vector(vectorMapValR, FunCodeSV(Scale)) |
33 | import Complex | ||
34 | import Foreign | 33 | import Foreign |
35 | import Foreign.C.Types (CInt) | 34 | import Foreign.C.Types (CInt) |
36 | import Control.Monad(when) | 35 | import Control.Monad(when) |
diff --git a/lib/Numeric/LinearAlgebra/Linear.hs b/lib/Numeric/LinearAlgebra/Linear.hs index 0426bb7..699985f 100644 --- a/lib/Numeric/LinearAlgebra/Linear.hs +++ b/lib/Numeric/LinearAlgebra/Linear.hs | |||
@@ -20,7 +20,6 @@ module Numeric.LinearAlgebra.Linear ( | |||
20 | 20 | ||
21 | import Data.Packed | 21 | import Data.Packed |
22 | import Numeric.GSL.Vector | 22 | import Numeric.GSL.Vector |
23 | import Complex | ||
24 | 23 | ||
25 | -- | A generic interface for vectors and matrices to a few element-by-element functions in Numeric.GSL.Vector. | 24 | -- | A generic interface for vectors and matrices to a few element-by-element functions in Numeric.GSL.Vector. |
26 | class (Container c e) => Linear c e where | 25 | class (Container c e) => Linear c e where |
diff --git a/lib/Numeric/LinearAlgebra/Tests.hs b/lib/Numeric/LinearAlgebra/Tests.hs index bf29ee9..e591285 100644 --- a/lib/Numeric/LinearAlgebra/Tests.hs +++ b/lib/Numeric/LinearAlgebra/Tests.hs | |||
@@ -225,7 +225,7 @@ runTests n = do | |||
225 | test (\m -> toRows (m::RM) == read (show (toRows m))) | 225 | test (\m -> toRows (m::RM) == read (show (toRows m))) |
226 | test (\m -> toRows (m::CM) == read (show (toRows m))) | 226 | test (\m -> toRows (m::CM) == read (show (toRows m))) |
227 | putStrLn "------ some unit tests" | 227 | putStrLn "------ some unit tests" |
228 | runTestTT $ TestList | 228 | _ <- runTestTT $ TestList |
229 | [ utest "1E5 rots" rotTest | 229 | [ utest "1E5 rots" rotTest |
230 | , utest "det1" detTest1 | 230 | , utest "det1" detTest1 |
231 | , utest "expm1" (expmTest1) | 231 | , utest "expm1" (expmTest1) |