exp-pairs-0.1.1.0: Linear programming over exponent pairs

Copyright(c) Andrew Lelechenko, 2014-2015
LicenseGPL-3
Maintainerandrew.lelechenko@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell98

Math.ExpPairs.Matrix3

Description

Provides types and functions for matrices and vectors of order 3. Can be used instead of Data.Matrix to reduce overhead and simplify code.

Synopsis

Documentation

data Matrix3 t Source

Matrix of order 3. Instances of Num, Fractional and Monoid are defined in terms of the multiplicative group of matrices, not the additive one. E. g.,

toList 1 == [1,0,0,0,1,0,0,0,1]
toList 1 /= [1,1,1,1,1,1,1,1,1]

Constructors

Matrix3 

Fields

a11 :: t
 
a12 :: t
 
a13 :: t
 
a21 :: t
 
a22 :: t
 
a23 :: t
 
a31 :: t
 
a32 :: t
 
a33 :: t
 

Instances

Functor Matrix3 
Eq t => Eq (Matrix3 t) 
Fractional t => Fractional (Matrix3 t) 
Num t => Num (Matrix3 t) 
Show t => Show (Matrix3 t) 
Num t => Monoid (Matrix3 t) 

data Vector3 t Source

Three-component vector.

Constructors

Vector3 

Fields

a1 :: t
 
a2 :: t
 
a3 :: t
 

Instances

Eq t => Eq (Vector3 t) 
Show t => Show (Vector3 t) 

fromList :: [t] -> Matrix3 t Source

Convert a list of 9 elements into Matrix3.

toList :: Matrix3 t -> [t] Source

Convert Matrix3 into a list of 9 elements.

det :: Num t => Matrix3 t -> t Source

Computes the determinant of a matrix.

multCol :: Num t => Matrix3 t -> Vector3 t -> Vector3 t Source

Multiplicate a matrix by a vector (considered as a column).

normalize :: Integral t => Matrix3 t -> Matrix3 t Source

Divide all elements of the matrix by their greatest common divisor. This is useful for matrices of projective transformations to reduce the magnitude of computations.

prettyMatrix :: Show t => Matrix3 t -> String Source

Print a matrix, separating rows with new lines and elements with spaces.