bedandbreakfast
Efficient Matrix operations in 100% Haskell. https://hackage.haskell.org/package/bedandbreakfast
Latest on Hackage:  0.4.3 
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
MIT licensed and maintained by Julian Fleischer
bedandbreakfast
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.
 API documentation
 bedandbreakfast on Hackage
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
Changes
 v0.1

Initial version, features
det
, basic arithmetic operations, and instances forFloat
,Double
,Complex
, andRational
.  v0.1.1

Fixed wrong algorithm for computing the inverse of a
Matrix
.  v0.1.2

Added instances for
Num Matrix
,Fractional Matrix
, andEq Matrix
.  v0.1.3

inv
is now a total function and will no longer callerror
if a matrix is not invertible. AlsoMatrix
derivesData.Typeable
. now.  v0.1.4

Added
scale
, and methods for joining matrices vertically and horizontally. Corrected a bug inisUnit
reported by Charles Durham.isUnit
returned True for any matrix for whichall (== 1) . trace
would have, which is wrong).  v0.2

A little bit more documentation. Also moved some
functions (
isXXX
) away from the type classMatrixElement
. Properly flagged the package as experimental (was improperly marked asstable
, copied form a template).  v0.2.1

Added
cofactors
,adjugate
,minor
, andminorMatrix
.  v0.2.2

rank
works now for any Matrix component type.  v0.2.3

Added
Read
instance forMatrix
. Improved on documentation.  v0.3

Added a QuickCheck test suite, fixed a bug in
det
(det would crash for singular matrices, where it should return 0).  v0.3.1

Added TemplateHaskell syntactic sugar (see
Numeric.Matrix.Sugar
). Rewrote multiplication.matrix
function build an array faster now.  v0.3.2

Numeric.Matrix.Sugar
was not mentioned in the cabal file. Improved test suite. Improved documentation.  v0.4

Fixed a bug regarding
empty
andfromList
. Use unsafe operations where it is safe for speed. Added RULES. Added an instance for binary.  v0.4.1
 The unsafe operations used in v0.4 turned out to fatally fail on certain platforms. Revoked this change.
 v0.4.2

Fixed a tiny bug regarding the
row
function for extracting the number of rows in a Matrix. Thanks to Tim Makarios for finding and fixing the bug.  v0.4.3
 Fixed a bug in @transpose@ that prevented it from working correctly with nonsquare matrices. Thanks to @owst@ from @hub.darcs.net@.
comments powered byDisqus
A service provided by
FP Complete