hgeometry-0.12.0.2: Geometric Algorithms, Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.Geometry.Matrix

Description

type-indexed matrices.

Synopsis

Documentation

newtype Matrix n m r Source #

A matrix of n rows, each of m columns, storing values of type r.

Constructors

Matrix (Vector n (Vector m r)) 

Instances

Instances details
(Arity n, Arity m) => Functor (Matrix n m) Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

fmap :: (a -> b) -> Matrix n m a -> Matrix n m b #

(<$) :: a -> Matrix n m b -> Matrix n m a #

(Arity n, Arity m) => Foldable (Matrix n m) Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

fold :: Monoid m0 => Matrix n m m0 -> m0 #

foldMap :: Monoid m0 => (a -> m0) -> Matrix n m a -> m0 #

foldMap' :: Monoid m0 => (a -> m0) -> Matrix n m a -> m0 #

foldr :: (a -> b -> b) -> b -> Matrix n m a -> b #

foldr' :: (a -> b -> b) -> b -> Matrix n m a -> b #

foldl :: (b -> a -> b) -> b -> Matrix n m a -> b #

foldl' :: (b -> a -> b) -> b -> Matrix n m a -> b #

foldr1 :: (a -> a -> a) -> Matrix n m a -> a #

foldl1 :: (a -> a -> a) -> Matrix n m a -> a #

toList :: Matrix n m a -> [a] #

null :: Matrix n m a -> Bool #

length :: Matrix n m a -> Int #

elem :: Eq a => a -> Matrix n m a -> Bool #

maximum :: Ord a => Matrix n m a -> a #

minimum :: Ord a => Matrix n m a -> a #

sum :: Num a => Matrix n m a -> a #

product :: Num a => Matrix n m a -> a #

(Arity n, Arity m) => Traversable (Matrix n m) Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

traverse :: Applicative f => (a -> f b) -> Matrix n m a -> f (Matrix n m b) #

sequenceA :: Applicative f => Matrix n m (f a) -> f (Matrix n m a) #

mapM :: Monad m0 => (a -> m0 b) -> Matrix n m a -> m0 (Matrix n m b) #

sequence :: Monad m0 => Matrix n m (m0 a) -> m0 (Matrix n m a) #

(Eq r, Arity n, Arity m) => Eq (Matrix n m r) Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

(==) :: Matrix n m r -> Matrix n m r -> Bool #

(/=) :: Matrix n m r -> Matrix n m r -> Bool #

(Ord r, Arity n, Arity m) => Ord (Matrix n m r) Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

compare :: Matrix n m r -> Matrix n m r -> Ordering #

(<) :: Matrix n m r -> Matrix n m r -> Bool #

(<=) :: Matrix n m r -> Matrix n m r -> Bool #

(>) :: Matrix n m r -> Matrix n m r -> Bool #

(>=) :: Matrix n m r -> Matrix n m r -> Bool #

max :: Matrix n m r -> Matrix n m r -> Matrix n m r #

min :: Matrix n m r -> Matrix n m r -> Matrix n m r #

(Show r, Arity n, Arity m) => Show (Matrix n m r) Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

showsPrec :: Int -> Matrix n m r -> ShowS #

show :: Matrix n m r -> String #

showList :: [Matrix n m r] -> ShowS #

identityMatrix :: (Arity d, Num r) => Matrix d d r Source #

Produces the Identity Matrix.

multM :: (Arity r, Arity c, Arity c', Num a) => Matrix r c a -> Matrix c c' a -> Matrix r c' a Source #

Matrix product.

mult :: (Arity m, Arity n, Num r) => Matrix n m r -> Vector m r -> Vector n r Source #

Matrix * column vector.

class Invertible n r where Source #

Class of matrices that are invertible.

Methods

inverse' :: Matrix n n r -> Matrix n n r Source #

Instances

Instances details
Fractional r => Invertible 2 r Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

inverse' :: Matrix 2 2 r -> Matrix 2 2 r Source #

Fractional r => Invertible 3 r Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

inverse' :: Matrix 3 3 r -> Matrix 3 3 r Source #

Fractional r => Invertible 4 r Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

inverse' :: Matrix 4 4 r -> Matrix 4 4 r Source #

class Arity d => HasDeterminant d where Source #

Class of matrices that have a determinant.

Methods

det :: Num r => Matrix d d r -> r Source #

Instances

Instances details
HasDeterminant 1 Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

det :: Num r => Matrix 1 1 r -> r Source #

HasDeterminant 2 Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

det :: Num r => Matrix 2 2 r -> r Source #

HasDeterminant 3 Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

det :: Num r => Matrix 3 3 r -> r Source #

HasDeterminant 4 Source # 
Instance details

Defined in Data.Geometry.Matrix

Methods

det :: Num r => Matrix 4 4 r -> r Source #