From 337fefa7879028e1fba6cc820420c4b47f8e22b2 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Wed, 7 Dec 2011 21:08:55 +0100 Subject: converting to git --- .gitignore | 19 ++++ examples/fitting.hs | 24 ----- index.txt | 88 ++++++++++++++++ install.txt | 113 +++++++++++++++++++++ packages/special/lib/Numeric/GSL/Special/auto.hs | 0 .../special/lib/Numeric/GSL/Special/autoall.sh | 0 .../special/lib/Numeric/GSL/Special/replace.hs | 0 7 files changed, 220 insertions(+), 24 deletions(-) create mode 100644 .gitignore delete mode 100644 examples/fitting.hs create mode 100644 index.txt create mode 100644 install.txt mode change 100644 => 100755 packages/special/lib/Numeric/GSL/Special/auto.hs mode change 100644 => 100755 packages/special/lib/Numeric/GSL/Special/autoall.sh mode change 100644 => 100755 packages/special/lib/Numeric/GSL/Special/replace.hs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e31dea1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +_darcs +dist +experiments +examples/session +examples/mnist.txt +examples/candidates +material +doc.sh + +*.o +*.hi +*.chi +*.chs.h + +push.sh +index.html +install.html +reinstall.sh + 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 @@ --- nonlinear least-squares fitting - -import Numeric.GSL.Fitting -import Numeric.LinearAlgebra - -xs = map return [0 .. 39] -sigma = 0.1 -ys = map return $ toList $ fromList (map (head . expModel [5,0.1,1]) xs) - + scalar sigma * (randomVector 0 Gaussian 40) - -dat :: [([Double],([Double],Double))] - -dat = zip xs (zip ys (repeat sigma)) - -expModel [a,lambda,b] [t] = [a * exp (-lambda * t) + b] - -expModelDer [a,lambda,b] [t] = [[exp (-lambda * t), -t * a * exp(-lambda*t) , 1]] - -(sol,path) = fitModelScaled 1E-4 1E-4 20 (expModel, expModelDer) dat [1,0,0] - -main = do - print dat - print path - 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 @@ + + hmatrix + + + + +
hmatrix
+======= + +A Haskell library for numerical computation +------------------------------------------- + +A purely functional interface to linear algebra and other numerical algorithms, internally implemented using [LAPACK][lapack], [BLAS][blas], and [GSL][gsl]. + +This package includes standard matrix decompositions (eigensystems, singular values, Cholesky, QR, etc.), linear systems, numeric integration, root finding, etc. + +- [Tutorial][tutorial2] + +- [Source code and documentation (Hackage)][source] + +- [Installation help and known problems][Installation2] + +- Source repository: [darcs get http://patch-tag.com/r/aruiz/hmatrix][repo2] + +- [Changelog][changes2] + +Contributions, suggestions, and bug reports are welcome! + +Related Projects +---------------- + +- [hmatrix-static][hmatrix-static], by Reiner Pope. + A thin, lightweight wrapper over hmatrix to + support static checking of matrix and vector sizes (for instance, addition + of different-sized vectors will be disallowed at compile-time). + +- [hmatrix-gsl-stats][hmatrix-gsl-stats], [hstatistics][hstatistics], + and [hsignal][hsignal] by Vivian McPhail. + +- [repa][repa], regular, multi-dimensional, shape polymorphic parallel arrays. + +- [hTensor][hTensor], multidimensional arrays and simple tensor computations. + +- [BLAS][pBLAS] and [LAPACK][pLAPACK] Haskell bindings by Patrick Perry. + +- [GSL Haskell bindings][aGSL] by Mauricio C. Antunes. + +- The alternative [numeric prelude][nprelude] by Dylan Thurston, Henning Thielemann, + and Mikael Johansson. + +- [Math packages][mathHack] in Hackage. + +- [easyVision][easyVision2]: image processing and computer vision. + +- - - + +[Alberto Ruiz](http://dis.um.es/profesores/alberto) + +[lapack]: http://www.netlib.org/lapack/ +[blas]: http://www.netlib.org/blas/ +[gsl]: http://www.gnu.org/software/gsl/ + +[source]: http://hackage.haskell.org/package/hmatrix +[tutorial]: http://code.haskell.org/hmatrix/hmatrix.pdf +[tutorial2]: http://perception.inf.um.es/hmatrix/hmatrix.pdf +[installation]: http://code.haskell.org/hmatrix/install.html +[installation2]: http://perception.inf.um.es/hmatrix/install.html +[repo]: http://perception.inf.um.es/cgi-bin/darcsweb.cgi?r=hmatrix;a=summary +[repo2]: http://patch-tag.com/r/aruiz/hmatrix/ +[changes]: http://code.haskell.org/hmatrix/CHANGES +[changes2]: http://patch-tag.com/r/aruiz/hmatrix/snapshot/current/content/pretty/CHANGES +[docum]:http://perception.inf.um.es/hmatrix/doc + + +[hmatrix-static]: http://hackage.haskell.org/package/hmatrix-static +[hTensor]: http://perception.inf.um.es/tensor +[hmatrix-gsl-stats]: http://hackage.haskell.org/package/hmatrix-gsl-stats +[hstatistics]: http://hackage.haskell.org/package/hstatistics +[hsignal]: http://hackage.haskell.org/package/hsignal +[pBLAS]: http://hackage.haskell.org/package/blas +[pLAPACK]: http://github.com/patperry/lapack +[aGSL]: http://hackage.haskell.org/package/bindings-gsl +[nprelude]: http://hackage.haskell.org/package/numeric-prelude +[mathHack]: http://hackage.haskell.org/packages/archive/pkg-list.html#cat:math +[easyVision]: http://code.haskell.org/easyVision/ +[easyVision2]: http://perception.inf.um.es/easyVision/ +[repa]: http://hackage.haskell.org/package/repa + diff --git a/install.txt b/install.txt new file mode 100644 index 0000000..fbcc051 --- /dev/null +++ b/install.txt @@ -0,0 +1,113 @@ + + hmatrix installation + + + + +[hmatrix]: http://code.haskell.org/hmatrix +[hmatrix2]: http://perception.inf.um.es/hmatrix + + +[hmatrix][hmatrix2] installation +------------------------------------------------------- + +This 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). + +We 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**.) + + +### Linux ################################################## + + +Ubuntu/Debian: + + $ sudo apt-get install libgsl0-dev liblapack-dev + $ cabal install hmatrix + +Arch 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). + +Other distributions may require additional libraries. They can be given in a **--configure-option**. + +### Mac OS/X ############################################### + + +GSL must be installed via MacPorts: + + $ sudo port install gsl-devel +universal + $ cabal install hmatrix + +(Contributed by Heinrich Apfelmus and Torsten Kemps-Benedix). + +### Windows ############################################### + + +See 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]. + +[install]: http://code.haskell.org/hmatrix/INSTALL +[install2]: http://patch-tag.com/r/aruiz/hmatrix/snapshot/current/content/pretty/INSTALL +[winpack]: http://perception.inf.um.es/hmatrix/gsl-lapack-windows.zip + +- - - + +### Tests ############################################### + +After installation we must verify that the library works as expected: + + $ ghci + > Numeric.LinearAlgebra.Tests.runTests 20 + OK, passed 100 tests. + OK, passed 100 tests. + ... etc... + +If 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! + +If everything is ok you can reinstall the library with minimal dependencies: + + $ cabal install --reinstall hmatrix -f-tests [-f-vector] [-f-binary] + +- - - + +### Optimized BLAS/LAPACK ########################################## + +I have successfully tested ATLAS and MKL on Linux. + +### [ATLAS](http://math-atlas.sourceforge.net/) #################### + +In Ubuntu >= 9.04 we need: + + $ sudo apt-get install libatlas-base-dev + +In older Ubuntu/Debian versions we needed: + + $ sudo apt-get install refblas3-dev lapack3-dev atlas3-base-dev + +We may use a version (sse2, 3dnow, etc.) optimized for the machine. + +### Intel's MKL ############################################### + +There is a free noncommercial download available from Intel's website. To use it I have added the following lines in my .bashrc configuration file: + + export LD_LIBRARY_PATH=/path/to/mkl/lib/arch + export LIBRARY_PATH=/path/to/mkl/lib/arch + +where arch = 32 or em64t. + +The library must be installed with the -fmkl flag: + + $ cabal install hmatrix -fmkl + +- - - + +### Known problems ############################################### + +- libatlas-sse2-dev in Ubuntu 9.04 is broken (see this +[bug report](https://bugs.launchpad.net/ubuntu/+source/atlas/+bug/368478)). Alternatively we can use libatlas-base-dev. + +- 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. + +- **catch** does not work if the error is produced by a Haskell function when it is called from inside C function. + +- - - + +[Alberto Ruiz](http://dis.um.es/profesores/alberto) + diff --git a/packages/special/lib/Numeric/GSL/Special/auto.hs b/packages/special/lib/Numeric/GSL/Special/auto.hs old mode 100644 new mode 100755 diff --git a/packages/special/lib/Numeric/GSL/Special/autoall.sh b/packages/special/lib/Numeric/GSL/Special/autoall.sh old mode 100644 new mode 100755 diff --git a/packages/special/lib/Numeric/GSL/Special/replace.hs b/packages/special/lib/Numeric/GSL/Special/replace.hs old mode 100644 new mode 100755 -- cgit v1.2.3