toy-lib-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Math.Matrix

Description

Vector-based matrix implementation.

Synopsis

Documentation

type Mat a = IxUVector (Int, Int) a #

HxW matrix.

type Col a = Vector a #

Column vector.

mulMatToCol :: (Num e, Unbox e) => Mat e -> Col e -> Col e #

\(O(HW)\) Multiplies HxW matrix to a Hx1 column vector.

mulMatToColMod :: (Unbox e, Integral e) => e -> Mat e -> Col e -> Col e #

\(O(HW)\) Multiplies HxW matrix to a Hx1 column vector, taking the modulus.

mulMat :: (Num e, Unbox e) => Mat e -> Mat e -> Mat e #

\(O(H_1 W_2 K)\) Multiplies H1xK matrix to a KxW2 matrix.

mulMatMod :: (Integral e, Unbox e) => e -> Mat e -> Mat e -> Mat e #

\(O(H_1 W_2 K)\) Multiplies H1xK matrix to a KxW2 matrix, taking the modulus.

unitMat :: (Unbox e, Num e) => Int -> Mat e #

\(O(N^2)\) Returns NxN unit matrix.

Orphan instances

(Num a, Unbox a) => Semigroup (Mat a) # 
Instance details

Methods

(<>) :: Mat a -> Mat a -> Mat a #

sconcat :: NonEmpty (Mat a) -> Mat a #

stimes :: Integral b => b -> Mat a -> Mat a #

(Num a, Unbox a) => SemigroupAction (Mat a) (Col a) # 
Instance details

Methods

sact :: Mat a -> Col a -> Col a #