summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore19
-rw-r--r--examples/fitting.hs24
-rw-r--r--index.txt88
-rw-r--r--install.txt113
-rwxr-xr-x[-rw-r--r--]packages/special/lib/Numeric/GSL/Special/auto.hs0
-rwxr-xr-x[-rw-r--r--]packages/special/lib/Numeric/GSL/Special/autoall.sh0
-rwxr-xr-x[-rw-r--r--]packages/special/lib/Numeric/GSL/Special/replace.hs0
7 files changed, 220 insertions, 24 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e31dea1
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,19 @@
1_darcs
2dist
3experiments
4examples/session
5examples/mnist.txt
6examples/candidates
7material
8doc.sh
9
10*.o
11*.hi
12*.chi
13*.chs.h
14
15push.sh
16index.html
17install.html
18reinstall.sh
19
diff --git a/examples/fitting.hs b/examples/fitting.hs
deleted file mode 100644
index a8f6b1c..0000000
--- a/examples/fitting.hs
+++ /dev/null
@@ -1,24 +0,0 @@
1-- nonlinear least-squares fitting
2
3import Numeric.GSL.Fitting
4import Numeric.LinearAlgebra
5
6xs = map return [0 .. 39]
7sigma = 0.1
8ys = map return $ toList $ fromList (map (head . expModel [5,0.1,1]) xs)
9 + scalar sigma * (randomVector 0 Gaussian 40)
10
11dat :: [([Double],([Double],Double))]
12
13dat = zip xs (zip ys (repeat sigma))
14
15expModel [a,lambda,b] [t] = [a * exp (-lambda * t) + b]
16
17expModelDer [a,lambda,b] [t] = [[exp (-lambda * t), -t * a * exp(-lambda*t) , 1]]
18
19(sol,path) = fitModelScaled 1E-4 1E-4 20 (expModel, expModelDer) dat [1,0,0]
20
21main = do
22 print dat
23 print path
24 print sol
diff --git a/index.txt b/index.txt
new file mode 100644
index 0000000..e9cadd7
--- /dev/null
+++ b/index.txt
@@ -0,0 +1,88 @@
1<HEAD>
2 <TITLE>hmatrix</TITLE>
3 <STYLE> <!-- body{width: 600px; margin:50px auto;font-family:arial} --> </STYLE>
4</HEAD>
5
6
7<center>hmatrix</center>
8=======
9
10A Haskell library for numerical computation
11-------------------------------------------
12
13A purely functional interface to linear algebra and other numerical algorithms, internally implemented using [LAPACK][lapack], [BLAS][blas], and [GSL][gsl].
14
15This package includes standard matrix decompositions (eigensystems, singular values, Cholesky, QR, etc.), linear systems, numeric integration, root finding, etc.
16
17- [Tutorial][tutorial2]
18
19- [Source code and documentation (Hackage)][source]
20
21- [Installation help and known problems][Installation2]
22
23- Source repository: [darcs get http://patch-tag.com/r/aruiz/hmatrix][repo2]
24
25- [Changelog][changes2]
26
27Contributions, suggestions, and bug reports are welcome!
28
29Related Projects
30----------------
31
32- [hmatrix-static][hmatrix-static], by Reiner Pope.
33 A thin, lightweight wrapper over hmatrix to
34 support static checking of matrix and vector sizes (for instance, addition
35 of different-sized vectors will be disallowed at compile-time).
36
37- [hmatrix-gsl-stats][hmatrix-gsl-stats], [hstatistics][hstatistics],
38 and [hsignal][hsignal] by Vivian McPhail.
39
40- [repa][repa], regular, multi-dimensional, shape polymorphic parallel arrays.
41
42- [hTensor][hTensor], multidimensional arrays and simple tensor computations.
43
44- [BLAS][pBLAS] and [LAPACK][pLAPACK] Haskell bindings by Patrick Perry.
45
46- [GSL Haskell bindings][aGSL] by Mauricio C. Antunes.
47
48- The alternative [numeric prelude][nprelude] by Dylan Thurston, Henning Thielemann,
49 and Mikael Johansson.
50
51- [Math packages][mathHack] in Hackage.
52
53- [easyVision][easyVision2]: image processing and computer vision.
54
55- - -
56
57[Alberto Ruiz](http://dis.um.es/profesores/alberto)
58
59[lapack]: http://www.netlib.org/lapack/
60[blas]: http://www.netlib.org/blas/
61[gsl]: http://www.gnu.org/software/gsl/
62
63[source]: http://hackage.haskell.org/package/hmatrix
64[tutorial]: http://code.haskell.org/hmatrix/hmatrix.pdf
65[tutorial2]: http://perception.inf.um.es/hmatrix/hmatrix.pdf
66[installation]: http://code.haskell.org/hmatrix/install.html
67[installation2]: http://perception.inf.um.es/hmatrix/install.html
68[repo]: http://perception.inf.um.es/cgi-bin/darcsweb.cgi?r=hmatrix;a=summary
69[repo2]: http://patch-tag.com/r/aruiz/hmatrix/
70[changes]: http://code.haskell.org/hmatrix/CHANGES
71[changes2]: http://patch-tag.com/r/aruiz/hmatrix/snapshot/current/content/pretty/CHANGES
72[docum]:http://perception.inf.um.es/hmatrix/doc
73
74
75[hmatrix-static]: http://hackage.haskell.org/package/hmatrix-static
76[hTensor]: http://perception.inf.um.es/tensor
77[hmatrix-gsl-stats]: http://hackage.haskell.org/package/hmatrix-gsl-stats
78[hstatistics]: http://hackage.haskell.org/package/hstatistics
79[hsignal]: http://hackage.haskell.org/package/hsignal
80[pBLAS]: http://hackage.haskell.org/package/blas
81[pLAPACK]: http://github.com/patperry/lapack
82[aGSL]: http://hackage.haskell.org/package/bindings-gsl
83[nprelude]: http://hackage.haskell.org/package/numeric-prelude
84[mathHack]: http://hackage.haskell.org/packages/archive/pkg-list.html#cat:math
85[easyVision]: http://code.haskell.org/easyVision/
86[easyVision2]: http://perception.inf.um.es/easyVision/
87[repa]: http://hackage.haskell.org/package/repa
88
diff --git a/install.txt b/install.txt
new file mode 100644
index 0000000..fbcc051
--- /dev/null
+++ b/install.txt
@@ -0,0 +1,113 @@
1<HEAD>
2 <TITLE>hmatrix installation</TITLE>
3 <STYLE> <!-- body{width: 600px; margin:50px auto;font-family:arial} --> </STYLE>
4</HEAD>
5
6
7[hmatrix]: http://code.haskell.org/hmatrix
8[hmatrix2]: http://perception.inf.um.es/hmatrix
9
10
11[hmatrix][hmatrix2] installation
12-------------------------------------------------------
13
14This package requires the [Glasgow Haskell Compiler](http://www.haskell.org/ghc/index.html) ghc >= 6.10, and [cabal-install](http://www.haskell.org/haskellwiki/Cabal-Install), conveniently available in the [Haskell Platform](http://hackage.haskell.org/platform).
15
16We also need the development packages for [GSL](http://www.gnu.org/software/gsl) and BLAS/[LAPACK](http://www.netlib.org/lapack). (The graphical functions also require **gnuplot** and **imagemagick**.)
17
18
19### Linux ##################################################
20
21
22Ubuntu/Debian:
23
24 $ sudo apt-get install libgsl0-dev liblapack-dev
25 $ cabal install hmatrix
26
27Arch Linux: If the automatic installation from Hackage fails, install atlas-lapack and gsl, unpack the source, change the build-type to Simple in hmatrix.cabal (line 28) and add extra-libraries: gsl lapack (line 194).
28
29Other distributions may require additional libraries. They can be given in a **--configure-option**.
30
31### Mac OS/X ###############################################
32
33
34GSL must be installed via MacPorts:
35
36 $ sudo port install gsl-devel +universal
37 $ cabal install hmatrix
38
39(Contributed by Heinrich Apfelmus and Torsten Kemps-Benedix).
40
41### Windows ###############################################
42
43
44See the [INSTALL file][install2] included in the distribution. We use this [GSL binary](http://www.miscdebris.net/blog/2009/04/20/mingw-345-binaries-of-gnu-scientific-library-112-for-use-with-mingw-and-visual-c/), and blas/lapack dlls built with g77 (contributed by Gilberto Camara). All required files are in [gsl-lapack-windows.zip][winpack].
45
46[install]: http://code.haskell.org/hmatrix/INSTALL
47[install2]: http://patch-tag.com/r/aruiz/hmatrix/snapshot/current/content/pretty/INSTALL
48[winpack]: http://perception.inf.um.es/hmatrix/gsl-lapack-windows.zip
49
50- - -
51
52### Tests ###############################################
53
54After installation we must verify that the library works as expected:
55
56 $ ghci
57 > Numeric.LinearAlgebra.Tests.runTests 20
58 OK, passed 100 tests.
59 OK, passed 100 tests.
60 ... etc...
61
62If you get any failure please run lapack's own tests to confirm that your version is not broken. For instance, in ubuntu 9.04, **libatlas-sse2** does not work (see this [bug report](https://bugs.launchpad.net/ubuntu/+source/atlas/+bug/368478)). If your lapack library is ok but hmatrix's tests fail please send a bug report!
63
64If everything is ok you can reinstall the library with minimal dependencies:
65
66 $ cabal install --reinstall hmatrix -f-tests [-f-vector] [-f-binary]
67
68- - -
69
70### Optimized BLAS/LAPACK ##########################################
71
72I have successfully tested ATLAS and MKL on Linux.
73
74### [ATLAS](http://math-atlas.sourceforge.net/) ####################
75
76In Ubuntu >= 9.04 we need:
77
78 $ sudo apt-get install libatlas-base-dev
79
80In older Ubuntu/Debian versions we needed:
81
82 $ sudo apt-get install refblas3-dev lapack3-dev atlas3-base-dev
83
84We may use a version (sse2, 3dnow, etc.) optimized for the machine.
85
86### Intel's MKL ###############################################
87
88There is a free noncommercial download available from Intel's website. To use it I have added the following lines in my .bashrc configuration file:
89
90 export LD_LIBRARY_PATH=/path/to/mkl/lib/arch
91 export LIBRARY_PATH=/path/to/mkl/lib/arch
92
93where arch = 32 or em64t.
94
95The library must be installed with the -fmkl flag:
96
97 $ cabal install hmatrix -fmkl
98
99- - -
100
101### Known problems ###############################################
102
103- libatlas-sse2-dev in Ubuntu 9.04 is broken (see this
104[bug report](https://bugs.launchpad.net/ubuntu/+source/atlas/+bug/368478)). Alternatively we can use libatlas-base-dev.
105
106- On **64-bit** machines the example "minimize.hs", when run from ghci, produces a segmentation fault. It happens in the call to gsl\_multimin\_fdfminimizer_alloc, inside the C wrapper. If the program is called by runhaskell, it just terminates prematurely, producing no results. Curiously, in compiled mode the program seems to work perfectly well.
107
108- **catch** does not work if the error is produced by a Haskell function when it is called from inside C function.
109
110- - -
111
112[Alberto Ruiz](http://dis.um.es/profesores/alberto)
113
diff --git a/packages/special/lib/Numeric/GSL/Special/auto.hs b/packages/special/lib/Numeric/GSL/Special/auto.hs
index b6276b2..b6276b2 100644..100755
--- a/packages/special/lib/Numeric/GSL/Special/auto.hs
+++ b/packages/special/lib/Numeric/GSL/Special/auto.hs
diff --git a/packages/special/lib/Numeric/GSL/Special/autoall.sh b/packages/special/lib/Numeric/GSL/Special/autoall.sh
index 18d0a6e..18d0a6e 100644..100755
--- a/packages/special/lib/Numeric/GSL/Special/autoall.sh
+++ b/packages/special/lib/Numeric/GSL/Special/autoall.sh
diff --git a/packages/special/lib/Numeric/GSL/Special/replace.hs b/packages/special/lib/Numeric/GSL/Special/replace.hs
index f20a6b8..f20a6b8 100644..100755
--- a/packages/special/lib/Numeric/GSL/Special/replace.hs
+++ b/packages/special/lib/Numeric/GSL/Special/replace.hs