A Haskell library for multidimensional arrays, oriented to support simple tensor computations and multilinear algebra.
Array dimensions have an "identity" which is preserved in data manipulation. Indices are explicitly selected by name in expressions, and Einstein's summation convention for repeated indices is automatically applied.
The library has a purely functional interface: arrays are immutable, and operations typically work on whole structures which can be assembled and decomposed using simple primitives. Arguments are automatically made conformable by replicating them along extra dimensions appearing in an operation. There is preliminary support for Geometric Algebra, multidimensional linear systems of equations, and tensor decompositions.
Application to Multiview Geometry:
part 2: (in construction)
Source repository: darcs get http://perception.inf.um.es/~aruiz/darcs/hTensor
We need GHC (>=6.10) and cabal-install. See this page for installation instructions.
$
sudo apt-get install libgsl0-dev liblapack-dev
$
cabal update
$
cabal install hTensor
Simple test:
$
ghci
>
import Numeric.LinearAlgebra.Exterior
>
printA "%4.0f" $ leviCivita 4 !"pqrs" * cov
(leviCivita 4)!"qrsu"
p^4 x
u_4
u
-6 0 0 0
p 0 -6 0 0
0 0 -6 0
0 0 0 -6
Alberto Ruiz, University of Murcia, Spain