leftaroundabout / linearmap-family

Purely-functional, coordinate-free linear algebra
http://hackage.haskell.org/package/linearmap-category
GNU General Public License v3.0
26 stars 2 forks source link
functional-analysis haskell linear-algebra

Build Status

This project has two goals:

To give Haskell a competitive, native linear algebra library

That is, a library that supports:

  1. Basic vector operations ✓
  2. Efficient linear maps ✓
  3. Solving linear equations
    1. Inversion of finite-dimensional, linear isomorphisms (full-rank matrices) ✓
    2. Least-squares solution to under/overdetermined problems (?)
    3. Fast iterative methods (for large sparse systems, e.g. conjugate gradient) ✗
  4. Eigenvalue problems ✓
  5. Singular value decomposition ✗

At the moment, the only Haskell libraries that offer all of that appear to be hmatrix and eigen, which use bindings to the GSL (C) and Eigen (C++) libraries.

To get rid of those pesky matrices

Linear algebra isn't really about matrices. Vectors aren't really arrays of numbers.

What LA is really about are points in vector spaces, and ultimately geometric relations between them. And many interesting spaces aren't even finite-dimensional.

Regardless of whether matrices are used for the internal operations – and in fact, it's not so clear if this is always a good idea! – matrices shouldn't dominate the API of a linear algebra library. Haskell has managed to bring a lot innovation to the world of programming languages. It can nicely work with infinite, lazy data structures. Hopefully it can also make a bit of a revolution in the field of linear algebra!