matrix-sized: Haskell matrix library with interface to C++ linear algebra libraries.

[ bsd3, library, math ] [ Propose Tags ]

A Haskell implementation of matrices with statically known sizes. The library also comes with the bindings to high performance C++ linear algebra libraries such as Eigen and Spectra.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.1.0, 0.1.1
Change log ChangeLog.md
Dependencies base (>=4.10 && <5), binary, bytestring, deepseq, primitive (>=0.6.4.0), singletons, vector (>=0.11) [details]
License BSD-3-Clause
Copyright (c) 2020 Kai Zhang
Author Kai Zhang
Maintainer kai@kzhang.org
Category Math
Home page https://github.com/kaizhang/matrix-sized#readme
Bug tracker https://github.com/kaizhang/matrix-sized/issues
Source repo head: git clone https://github.com/kaizhang/matrix-sized
Uploaded by kaizhang at 2020-03-18T20:10:16Z
Distributions
Downloads 1231 total (17 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for matrix-sized-0.0.2

[back to package description]

Type-safe linear algebra library

  • General matrix types are implemented in native Haskell.

  • The dimensions of matrices are statically typed.

  • Provides bindings to high performance C++ linear algebra libraries such Eigen and Spectra.

Following GHC extensions may be needed:

  • ScopedTypeVariables
  • RankNTypes
  • TypeFamilies
  • DataKinds

Example

let mat = D.matrix [ [1,0,3]
                   , [0,5,6]
                   , [0,0,0] ] :: Matrix 3 3 Double
    mat' = D.convertAny mat :: SparseMatrix 3 3 Double

print mat
print mat'

print $ eigs (sing :: Sing 1) mat == eigs (sing :: Sing 1) mat'

print $ cholesky mat

print $ mat %*% mat %*% mat
print $ mat' %*% mat' %*% mat