numeric-prelude-0.4.3: An experimental alternative hierarchy of numeric type classes

Copyright (c) Henning Thielemann 2009 Mikael Johansson 2006 numericprelude@henning-thielemann.de provisional requires multi-parameter type classes None Haskell98

MathObj.Matrix

Description

Routines and abstractions for Matrices and basic linear algebra over fields or rings.

We stick to simple Int indices. Although advanced indices would be nice e.g. for matrices with sub-matrices, this is not easily implemented since arrays do only support a lower and an upper bound but no additional parameters.

ToDo: - Matrix inverse, determinant (see htam:Matrix)

Synopsis

# Documentation

data T a Source #

A matrix is a twodimensional array, indexed by integers.

Instances

 Source # Methodsfmap :: (a -> b) -> T a -> T b #(<\$) :: a -> T b -> T a # Source # Methodszero :: C a => T a Source #(<+>) :: C a => T a -> T a -> T a Source #(*>) :: C a => a -> T a -> T a Source # C a b => C a (T b) Source # Methods(*>) :: a -> T b -> T b Source # Eq a => Eq (T a) Source # Methods(==) :: T a -> T a -> Bool #(/=) :: T a -> T a -> Bool # Ord a => Ord (T a) Source # Methodscompare :: T a -> T a -> Ordering #(<) :: T a -> T a -> Bool #(<=) :: T a -> T a -> Bool #(>) :: T a -> T a -> Bool #(>=) :: T a -> T a -> Bool #max :: T a -> T a -> T a #min :: T a -> T a -> T a # Read a => Read (T a) Source # MethodsreadsPrec :: Int -> ReadS (T a) #readList :: ReadS [T a] #readPrec :: ReadPrec (T a) # Show a => Show (T a) Source # MethodsshowsPrec :: Int -> T a -> ShowS #show :: T a -> String #showList :: [T a] -> ShowS # C a => C (T a) Source # Methodszero :: T a Source #(+) :: T a -> T a -> T a Source #(-) :: T a -> T a -> T a Source #negate :: T a -> T a Source # C a => C (T a) Source # Methods(*) :: T a -> T a -> T a Source #one :: T a Source #(^) :: T a -> Integer -> T a Source #

format :: Show a => T a -> String Source #

transpose :: T a -> T a Source #

Transposition of matrices is just transposition in the sense of Data.List.

rows :: T a -> [[a]] Source #

columns :: T a -> [[a]] Source #

index :: T a -> Dimension -> Dimension -> a Source #

fromRows :: Dimension -> Dimension -> [[a]] -> T a Source #

fromColumns :: Dimension -> Dimension -> [[a]] -> T a Source #

fromList :: Dimension -> Dimension -> [a] -> T a Source #

zipWith :: (a -> b -> c) -> T a -> T b -> T c Source #

zero :: C a => Dimension -> Dimension -> T a Source #

one :: C a => Dimension -> T a Source #

diagonal :: C a => [a] -> T a Source #

scale :: C a => a -> T a -> T a Source #

random :: (RandomGen g, Random a) => Dimension -> Dimension -> g -> (T a, g) Source #

randomR :: (RandomGen g, Random a) => Dimension -> Dimension -> (a, a) -> g -> (T a, g) Source #