hmatrix: Linear algebra and numerical computations

[ bsd3, library, math ] [ Propose Tags ] [ Report a vulnerability ]

Purely functional interface to basic linear algebra and other numerical computations, internally implemented using GSL, BLAS and LAPACK.


[Skip to Readme]

Modules

[Last Documentation]

  • Data
    • Data.Packed
      • Data.Packed.Convert
      • Data.Packed.Development
      • Data.Packed.Matrix
      • Data.Packed.Random
      • Data.Packed.ST
      • Data.Packed.Vector
  • Graphics
    • Graphics.Plot
  • Numeric
    • Numeric.GSL
      • Numeric.GSL.Differentiation
      • Numeric.GSL.Fourier
      • Numeric.GSL.Integration
      • Numeric.GSL.Minimization
      • Numeric.GSL.Polynomials
      • Numeric.GSL.Root
      • Numeric.GSL.Special
        • Numeric.GSL.Special.Airy
        • Numeric.GSL.Special.Bessel
        • Numeric.GSL.Special.Clausen
        • Numeric.GSL.Special.Coulomb
        • Numeric.GSL.Special.Coupling
        • Numeric.GSL.Special.Dawson
        • Numeric.GSL.Special.Debye
        • Numeric.GSL.Special.Dilog
        • Numeric.GSL.Special.Elementary
        • Numeric.GSL.Special.Ellint
        • Numeric.GSL.Special.Elljac
        • Numeric.GSL.Special.Erf
        • Numeric.GSL.Special.Exp
        • Numeric.GSL.Special.Expint
        • Numeric.GSL.Special.Fermi_dirac
        • Numeric.GSL.Special.Gamma
        • Numeric.GSL.Special.Gegenbauer
        • Numeric.GSL.Special.Hyperg
        • Numeric.GSL.Special.Laguerre
        • Numeric.GSL.Special.Lambert
        • Numeric.GSL.Special.Legendre
        • Numeric.GSL.Special.Log
        • Numeric.GSL.Special.Pow_int
        • Numeric.GSL.Special.Psi
        • Numeric.GSL.Special.Synchrotron
        • Numeric.GSL.Special.Transport
        • Numeric.GSL.Special.Trig
        • Numeric.GSL.Special.Zeta
      • Numeric.GSL.Vector
    • Numeric.LinearAlgebra
      • Numeric.LinearAlgebra.Algorithms
      • Numeric.LinearAlgebra.Instances
      • Numeric.LinearAlgebra.Interface
      • Numeric.LinearAlgebra.LAPACK
      • Numeric.LinearAlgebra.Linear
      • Numeric.LinearAlgebra.Tests

Flags

Automatic Flags
NameDescriptionDefault
splitbase

Choose the new smaller, split-up base package.

Enabled
mkl

Link with Intel's MKL optimized libraries.

Disabled
accelerate

Use the accelerate framework for LAPACK/BLAS on OS X

Disabled
unsafe

Compile the library with bound checking disabled.

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Versions [RSS] 0.1.0.0, 0.1.1.0, 0.2.0.0, 0.2.1.0, 0.3.0.0, 0.4.0.0, 0.5.0.1, 0.5.1.1, 0.5.2.0, 0.5.2.1, 0.5.2.2, 0.6.0.0, 0.7.1.0, 0.7.2.1, 0.8.0.0, 0.8.1.0, 0.8.1.1, 0.8.2.0, 0.8.3.1, 0.9.3.0, 0.10.0.0, 0.10.0.1, 0.10.0.2, 0.11.0.0, 0.11.0.1, 0.11.0.3, 0.11.0.4, 0.11.1.0, 0.12.0.0, 0.12.0.1, 0.12.0.2, 0.13.0.0, 0.13.1.0, 0.14.0.0, 0.14.0.1, 0.14.1.0, 0.15.0.0, 0.15.0.1, 0.15.2.0, 0.15.2.1, 0.16.0.2, 0.16.0.3, 0.16.0.4, 0.16.0.5, 0.16.0.6, 0.16.1.0, 0.16.1.1, 0.16.1.2, 0.16.1.3, 0.16.1.4, 0.16.1.5, 0.17.0.1, 0.17.0.2, 0.18.0.0, 0.18.1.0, 0.18.2.0, 0.19.0.0, 0.20.0.0, 0.20.1, 0.20.2
Change log CHANGES
Dependencies array (<0.3.0), base (<5), haskell98 (<1.0.1.1), HUnit, process, QuickCheck, storable-complex [details]
Tested with ghc ==6.10.4, ghc ==6.12.1
License LicenseRef-GPL
Author Alberto Ruiz
Maintainer Alberto Ruiz <aruiz@um.es>
Category Math
Home page http://www.hmatrix.googlepages.com
Uploaded by AlbertoRuiz at 2009-12-30T12:38:04Z
Distributions Debian:0.20.0.0, LTSHaskell:0.20.2, NixOS:0.20.2, Stackage:0.20.2
Reverse Dependencies 125 direct, 54 indirect [details]
Downloads 75249 total (204 in the last 30 days)
Rating 2.5 (votes: 9) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-12-30 [all 6 reports]

Readme for hmatrix-0.8.1.0

[back to package description]
-----------------------------------------
 A simple scientific library for Haskell
-----------------------------------------

INSTALLATION

See the INSTALL file.

TESTS ---------------------------------------------

$ ghci
Prelude> Numeric.LinearAlgebra.Tests.runTests 20

EXAMPLES ------------------------------------------------------

$ ghci
Prelude> :m + Numeric.GSL
Prelude Numeric.GSL> let quad = integrateQNG 1E-10
Prelude Numeric.GSL> quad (^2) 0 1
(0.3333333333333333,3.700743415417188e-15)

Prelude Numeric.GSL> :m + Numeric.LinearAlgebra
Prelude Numeric.LinearAlgebra> let m = (2><3)[1,2,3,4,5,6::Double]
Prelude Numeric.LinearAlgebra> let (u,d,v) = full svd m
Prelude Numeric.LinearAlgebra> d
(2><3)
 [ 9.508032000695724,                0.0, 0.0
 ,               0.0, 0.7728696356734838, 0.0 ]
Prelude Numeric.LinearAlgebra> u <> d <> trans v
(2><3)
 [ 1.0000000000000004,               2.0, 3.0
 , 3.9999999999999996, 5.000000000000001, 6.0 ]
Prelude Numeric.GSL> :q
Leaving GHCi.

A number of illustrative programs are included in the examples folder.

KNOWN PROBLEMS / BUGS -------------------------------

- 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.

- On Ubuntu 6.06 LTS (Dapper) atlas3-sse2-dev (3.6.0-20)
  produced segmentation faults when working with big matrices
  on compiled programs.

ACKNOWLEDGEMENTS -----------------------------------------------------

I thank Don Stewart, Henning Thielemann, Bulat Ziganshin and all the people
in the Haskell mailing lists for their help.

- Nico Mahlo discovered a bug in the eigendecomposition wrapper.

- Frederik Eaton discovered a bug in the design of the wrappers.

- Eric Kidd has created a wiki page explaining the installation on MacOS X:
  http://www.haskell.org/haskellwiki/GSLHaskell_on_MacOS_X

- Fawzi Mohamed discovered a portability bug in the lapack wrappers.

- Pedro E. López de Teruel fixed the interface to lapack.

- Antti Siira discovered a bug in the plotting functions.

- Paulo Tanimoto helped to fix the configuration of the required libraries.
  He also discovered the segfault of minimize.hs in ghci.

- Xiao-Yong Jin reported a bug on x86_64 caused by the assumptions in f2c.h,
  which are wrong for this architecture.

- Jason Schroeder reported an error in the documentation.

- Bulat Ziganshin gave invaluable help for the ST monad interface to
  in-place modifications.

- Don Stewart fixed the implementation of the internal data structures
  to achieve excellent, C-like performance in Haskell functions which
  explicitly work with the elements of vectors and matrices.

- Dylan Alex Simon improved the numeric instances to allow optimized
  implementations of signum and abs on Vectors.

- Pedro E. López de Teruel discovered the need of asm("finit") to
  avoid the wrong NaNs produced by foreign functions.

- Reiner Pope added support for luSolve, based on (d|z)getrs.

- Simon Beaumont reported the need of QuickCheck<2 and the invalid
  asm("finit") on ppc. He also contributed the configuration options
  for the accelerate framework on OS X.

- Daniel Schüssler added compatibility with QuickCheck 2 as well
  as QuickCheck 1 using the C preprocessor. He also added some
  implementations for the new "shrink" method of class Arbitrary.

- Tracy Wadleigh improved the definitions of (|>) and (><), which now
  apply an appropriate 'take' to the given lists so that they may be
  safely used on lists that are too long (or infinite).

- Chris Waterson improved the configure.hs program for OS/X.

- Erik de Castro Lopo added buildVector and buildMatrix, which take a
  size parameter(s) and a function that maps vector/matrix indices
  to the values at that position.