bed-and-breakfast: Efficient Matrix operations in 100% Haskell.

[ library, linear-algebra, math, mit, numeric ] [ Propose Tags ]

Efficient Matrix operations in 100% Haskell.

This library uses boxed and unboxed arrays in the ST monad, in order to achieve efficiency.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.2, 0.2.1, 0.2.2, 0.2.3, 0.3, 0.3.1, 0.3.2, 0.4, 0.4.1, 0.4.2, 0.4.3, 0.5
Change log CHANGES.md
Dependencies array (>=0.4), base (>=4.5 && <4.7), binary (>=0.5), deepseq (>=1.3), template-haskell (>=2.7) [details]
License MIT
Author Julian Fleischer <julian.fleischer@fu-berlin.de>
Maintainer Julian Fleischer <julian.fleischer@fu-berlin.de>
Revised Revision 1 made by AdamBergmark at 2015-05-03T12:21:47Z
Category Numeric, Math, Linear Algebra
Home page https://hackage.haskell.org/package/bed-and-breakfast
Source repo head: git clone https://github.com/scravy/bed-and-breakfast.git
Uploaded by JulianFleischer at 2014-01-17T15:40:53Z
Distributions
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 16591 total (45 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Successful builds reported [all 1 reports]

Readme for bed-and-breakfast-0.4.3

[back to package description]

bed-and-breakfast

Matrix operations in 100% pure Haskell.

Bed and Breakfast is a linear algebra library written in Haskell. It provides fast matrix operations like finding the determinant or the inverse of a matrix.

Example (GHCi Session)

*Numeric.Matrix> let m = fromList [[0,3,2],[5,6,10],[4,3,2.0]] :: Matrix Double
*Numeric.Matrix> inv m
Just  -0.2499999999999999  0.0  0.25
0.4166666666666667  -0.11111111111111112  0.1388888888888889
-0.12500000000000006  0.16666666666666669  -0.20833333333333334

*Numeric.Matrix> let m = fromList [[0,3,2],[5,6,10],[4,3,2.0]] :: Matrix Rational
*Numeric.Matrix> inv m
Just  (-1) % 4  0 % 1  1 % 4
5 % 12  (-1) % 9  5 % 36
(-1) % 8  1 % 6  (-5) % 24

Example (with Template Haskell Syntactic Sugar)

{-# LANGUAGE Haskell2010, TemplateHaskell, QuasiQuotes #-}

import Numeric.Matrix
import Numeric.Matrix.Sugar

m :: Matrix Double
m = [dMatrix| 20   30 40
              40.5 71 23
              20   20 27 |]

mInv = maybe (error "not invertible") id $ inv m