yap-0.0: yet another prelude - a simplistic refactoring with algebraic classes

Portabilityportable
Stabilityprovisional
Maintainerross@soi.city.ac.uk

Data.YAP.Matrix

Description

An example instance of the new classes: arbitrary-sized matrices, based on a haskell-cafe posting by Udo Stenzel on 22 Jun 2006.

Beware that the identity matrix is infinite.

Synopsis

Documentation

newtype Matrix a Source

Constructors

Matrix [[a]]

list of rows

Instances

Functor Matrix 
Eq a => Eq (Matrix a) 
Show a => Show (Matrix a) 
Ring a => Ring (Matrix a) 
AbelianGroup a => AbelianGroup (Matrix a) 

apply :: Ring a => Matrix a -> Vector a -> Vector aSource

Multiply a matrix by a vector.