qlinear-0.1.0.0: Typesafe library for linear algebra

Safe HaskellNone
LanguageHaskell2010

QLinear.Identity

Synopsis

Documentation

e :: forall n a. (KnownNat n, HasIdentity a) => Identity n a Source #

Polymirphic identity matrix

Identity matrix can udjust to other matrix with known size. If size is unknown, just set it yourself

>>> e :: Identity 4 Int
[1,0,0,0]
[0,1,0,0]
[0,0,1,0]
[0,0,0,1]
>>> e ~+~ [matrix| 1 2; 3 4 |]
[2,2]
[3,5]

type Identity n a = Matrix n n a Source #

class HasIdentity a where Source #

Methods

zero :: a Source #

one :: a Source #

Instances
Num a => HasIdentity a Source # 
Instance details

Defined in QLinear.Identity

Methods

zero :: a Source #

one :: a Source #