hmatrix-0.19.0.0: Numeric Linear Algebra

Copyright(c) Alberto Ruiz 2014
LicenseBSD3
Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

Numeric.LinearAlgebra.Static

Contents

Description

Experimental interface with statically checked dimensions.

See code examples at http://dis.um.es/~alberto/hmatrix/static.html.

Synopsis

Vector

data R n Source #

Instances

Domain R L Source # 

Methods

mul :: (KnownNat m, KnownNat k, KnownNat n) => L m k -> L k n -> L m n Source #

app :: (KnownNat m, KnownNat n) => L m n -> R n -> R m Source #

dot :: KnownNat n => R n -> R n -> Source #

cross :: R 3 -> R 3 -> R 3 Source #

diagR :: (KnownNat m, KnownNat n, KnownNat k) => -> R k -> L m n Source #

dvmap :: KnownNat n => ( -> ) -> R n -> R n Source #

dmmap :: (KnownNat m, KnownNat n) => ( -> ) -> L n m -> L n m Source #

outer :: (KnownNat m, KnownNat n) => R n -> R m -> L n m Source #

zipWithVector :: KnownNat n => ( -> -> ) -> R n -> R n -> R n Source #

det :: KnownNat n => L n n -> Source #

invlndet :: KnownNat n => L n n -> (L n n, (, )) Source #

expm :: KnownNat n => L n n -> L n n Source #

sqrtm :: KnownNat n => L n n -> L n n Source #

inv :: KnownNat n => L n n -> L n n Source #

KnownNat n => Sized (R n) Vector Source # 
Floating (R n) Source # 

Methods

pi :: R n #

exp :: R n -> R n #

log :: R n -> R n #

sqrt :: R n -> R n #

(**) :: R n -> R n -> R n #

logBase :: R n -> R n -> R n #

sin :: R n -> R n #

cos :: R n -> R n #

tan :: R n -> R n #

asin :: R n -> R n #

acos :: R n -> R n #

atan :: R n -> R n #

sinh :: R n -> R n #

cosh :: R n -> R n #

tanh :: R n -> R n #

asinh :: R n -> R n #

acosh :: R n -> R n #

atanh :: R n -> R n #

log1p :: R n -> R n #

expm1 :: R n -> R n #

log1pexp :: R n -> R n #

log1mexp :: R n -> R n #

Fractional (R n) Source # 

Methods

(/) :: R n -> R n -> R n #

recip :: R n -> R n #

fromRational :: Rational -> R n #

Num (R n) Source # 

Methods

(+) :: R n -> R n -> R n #

(-) :: R n -> R n -> R n #

(*) :: R n -> R n -> R n #

negate :: R n -> R n #

abs :: R n -> R n #

signum :: R n -> R n #

fromInteger :: Integer -> R n #

KnownNat n => Show (R n) Source # 

Methods

showsPrec :: Int -> R n -> ShowS #

show :: R n -> String #

showList :: [R n] -> ShowS #

Generic (R n) Source # 

Associated Types

type Rep (R n) :: * -> * #

Methods

from :: R n -> Rep (R n) x #

to :: Rep (R n) x -> R n #

KnownNat n => Binary (R n) Source # 

Methods

put :: R n -> Put #

get :: Get (R n) #

putList :: [R n] -> Put #

NFData (R n) Source # 

Methods

rnf :: R n -> () #

Additive (R n) Source # 

Methods

add :: R n -> R n -> R n Source #

KnownNat n => Disp (R n) Source # 

Methods

disp :: Int -> R n -> IO () Source #

KnownNat n => Eigen (Sym n) (R n) (L n n) Source # 

Methods

eigensystem :: Sym n -> (R n, L n n) Source #

eigenvalues :: Sym n -> R n Source #

KnownNat n => Diag (L n n) (R n) Source # 

Methods

takeDiag :: L n n -> R n Source #

type Rep (R n) Source # 
type Rep (R n)

vec2 :: -> -> R 2 Source #

vec3 :: -> -> -> R 3 Source #

vec4 :: -> -> -> -> R 4 Source #

(&) :: forall n. (KnownNat n, 1 <= n) => R n -> -> R (n + 1) infixl 4 Source #

(#) :: forall n m. (KnownNat n, KnownNat m) => R n -> R m -> R (n + m) infixl 4 Source #

split :: forall p n. (KnownNat p, KnownNat n, p <= n) => R n -> (R p, R (n - p)) Source #

headTail :: (KnownNat n, 1 <= n) => R n -> (, R (n - 1)) Source #

vector :: KnownNat n => [] -> R n Source #

linspace :: forall n. KnownNat n => (, ) -> R n Source #

range :: forall n. KnownNat n => R n Source #

dim :: forall n. KnownNat n => R n Source #

Matrix

data L m n Source #

Instances

Domain R L Source # 

Methods

mul :: (KnownNat m, KnownNat k, KnownNat n) => L m k -> L k n -> L m n Source #

app :: (KnownNat m, KnownNat n) => L m n -> R n -> R m Source #

dot :: KnownNat n => R n -> R n -> Source #

cross :: R 3 -> R 3 -> R 3 Source #

diagR :: (KnownNat m, KnownNat n, KnownNat k) => -> R k -> L m n Source #

dvmap :: KnownNat n => ( -> ) -> R n -> R n Source #

dmmap :: (KnownNat m, KnownNat n) => ( -> ) -> L n m -> L n m Source #

outer :: (KnownNat m, KnownNat n) => R n -> R m -> L n m Source #

zipWithVector :: KnownNat n => ( -> -> ) -> R n -> R n -> R n Source #

det :: KnownNat n => L n n -> Source #

invlndet :: KnownNat n => L n n -> (L n n, (, )) Source #

expm :: KnownNat n => L n n -> L n n Source #

sqrtm :: KnownNat n => L n n -> L n n Source #

inv :: KnownNat n => L n n -> L n n Source #

(KnownNat m, KnownNat n) => Sized (L m n) Matrix Source # 

Methods

konst :: -> L m n Source #

unwrap :: L m n -> Matrix Source #

fromList :: [] -> L m n Source #

extract :: L m n -> Matrix Source #

create :: Matrix -> Maybe (L m n) Source #

size :: L m n -> IndexOf Matrix Source #

KnownNat n => Eigen (Sym n) (R n) (L n n) Source # 

Methods

eigensystem :: Sym n -> (R n, L n n) Source #

eigenvalues :: Sym n -> R n Source #

KnownNat n => Eigen (Sq n) (C n) (M n n) Source # 

Methods

eigensystem :: Sq n -> (C n, M n n) Source #

eigenvalues :: Sq n -> C n Source #

(KnownNat n, KnownNat m) => Floating (L n m) Source # 

Methods

pi :: L n m #

exp :: L n m -> L n m #

log :: L n m -> L n m #

sqrt :: L n m -> L n m #

(**) :: L n m -> L n m -> L n m #

logBase :: L n m -> L n m -> L n m #

sin :: L n m -> L n m #

cos :: L n m -> L n m #

tan :: L n m -> L n m #

asin :: L n m -> L n m #

acos :: L n m -> L n m #

atan :: L n m -> L n m #

sinh :: L n m -> L n m #

cosh :: L n m -> L n m #

tanh :: L n m -> L n m #

asinh :: L n m -> L n m #

acosh :: L n m -> L n m #

atanh :: L n m -> L n m #

log1p :: L n m -> L n m #

expm1 :: L n m -> L n m #

log1pexp :: L n m -> L n m #

log1mexp :: L n m -> L n m #

(KnownNat n, KnownNat m) => Fractional (L n m) Source # 

Methods

(/) :: L n m -> L n m -> L n m #

recip :: L n m -> L n m #

fromRational :: Rational -> L n m #

(KnownNat n, KnownNat m) => Num (L n m) Source # 

Methods

(+) :: L n m -> L n m -> L n m #

(-) :: L n m -> L n m -> L n m #

(*) :: L n m -> L n m -> L n m #

negate :: L n m -> L n m #

abs :: L n m -> L n m #

signum :: L n m -> L n m #

fromInteger :: Integer -> L n m #

(KnownNat m, KnownNat n) => Show (L m n) Source # 

Methods

showsPrec :: Int -> L m n -> ShowS #

show :: L m n -> String #

showList :: [L m n] -> ShowS #

Generic (L m n) Source # 

Associated Types

type Rep (L m n) :: * -> * #

Methods

from :: L m n -> Rep (L m n) x #

to :: Rep (L m n) x -> L m n #

(KnownNat n, KnownNat m) => Binary (L m n) Source # 

Methods

put :: L m n -> Put #

get :: Get (L m n) #

putList :: [L m n] -> Put #

NFData (L n m) Source # 

Methods

rnf :: L n m -> () #

(KnownNat m, KnownNat n) => Additive (L m n) Source # 

Methods

add :: L m n -> L m n -> L m n Source #

(KnownNat m, KnownNat n) => Disp (L m n) Source # 

Methods

disp :: Int -> L m n -> IO () Source #

KnownNat n => Diag (L n n) (R n) Source # 

Methods

takeDiag :: L n n -> R n Source #

(KnownNat n, KnownNat m) => Transposable (L m n) (L n m) Source # 

Methods

tr :: L m n -> L n m Source #

tr' :: L m n -> L n m Source #

type Rep (L m n) Source # 
type Rep (L m n)

type Sq n = L n n Source #

build :: forall m n. (KnownNat n, KnownNat m) => ( -> -> ) -> L m n Source #

row :: R n -> L 1 n Source #

col :: KnownNat n => R n -> L n 1 Source #

(|||) :: (KnownNat r2, KnownNat r1, KnownNat ((+) r1 r2), KnownNat c) => L c r1 -> L c r2 -> L c ((+) r1 r2) infixl 3 Source #

(===) :: (KnownNat r1, KnownNat r2, KnownNat c) => L r1 c -> L r2 c -> L (r1 + r2) c infixl 2 Source #

splitRows :: forall p m n. (KnownNat p, KnownNat m, KnownNat n, p <= m) => L m n -> (L p n, L (m - p) n) Source #

splitCols :: forall p m n. (KnownNat p, KnownNat m, KnownNat n, KnownNat (n - p), p <= n) => L m n -> (L m p, L m (n - p)) Source #

unrow :: L 1 n -> R n Source #

uncol :: KnownNat n => L n 1 -> R n Source #

tr :: Transposable m mt => m -> mt Source #

conjugate transpose

eye :: KnownNat n => Sq n Source #

diag :: KnownNat n => R n -> Sq n Source #

blockAt :: forall m n. (KnownNat m, KnownNat n) => -> Int -> Int -> Matrix Double -> L m n Source #

matrix :: (KnownNat m, KnownNat n) => [] -> L m n Source #

Complex

data C n Source #

Instances

Domain C M Source # 

Methods

mul :: (KnownNat m, KnownNat k, KnownNat n) => M m k -> M k n -> M m n Source #

app :: (KnownNat m, KnownNat n) => M m n -> C n -> C m Source #

dot :: KnownNat n => C n -> C n -> Source #

cross :: C 3 -> C 3 -> C 3 Source #

diagR :: (KnownNat m, KnownNat n, KnownNat k) => -> C k -> M m n Source #

dvmap :: KnownNat n => ( -> ) -> C n -> C n Source #

dmmap :: (KnownNat m, KnownNat n) => ( -> ) -> M n m -> M n m Source #

outer :: (KnownNat m, KnownNat n) => C n -> C m -> M n m Source #

zipWithVector :: KnownNat n => ( -> -> ) -> C n -> C n -> C n Source #

det :: KnownNat n => M n n -> Source #

invlndet :: KnownNat n => M n n -> (M n n, (, )) Source #

expm :: KnownNat n => M n n -> M n n Source #

sqrtm :: KnownNat n => M n n -> M n n Source #

inv :: KnownNat n => M n n -> M n n Source #

KnownNat n => Sized (C n) Vector Source # 
Floating (C n) Source # 

Methods

pi :: C n #

exp :: C n -> C n #

log :: C n -> C n #

sqrt :: C n -> C n #

(**) :: C n -> C n -> C n #

logBase :: C n -> C n -> C n #

sin :: C n -> C n #

cos :: C n -> C n #

tan :: C n -> C n #

asin :: C n -> C n #

acos :: C n -> C n #

atan :: C n -> C n #

sinh :: C n -> C n #

cosh :: C n -> C n #

tanh :: C n -> C n #

asinh :: C n -> C n #

acosh :: C n -> C n #

atanh :: C n -> C n #

log1p :: C n -> C n #

expm1 :: C n -> C n #

log1pexp :: C n -> C n #

log1mexp :: C n -> C n #

Fractional (C n) Source # 

Methods

(/) :: C n -> C n -> C n #

recip :: C n -> C n #

fromRational :: Rational -> C n #

Num (C n) Source # 

Methods

(+) :: C n -> C n -> C n #

(-) :: C n -> C n -> C n #

(*) :: C n -> C n -> C n #

negate :: C n -> C n #

abs :: C n -> C n #

signum :: C n -> C n #

fromInteger :: Integer -> C n #

KnownNat n => Show (C n) Source # 

Methods

showsPrec :: Int -> C n -> ShowS #

show :: C n -> String #

showList :: [C n] -> ShowS #

Generic (C n) Source # 

Associated Types

type Rep (C n) :: * -> * #

Methods

from :: C n -> Rep (C n) x #

to :: Rep (C n) x -> C n #

NFData (C n) Source # 

Methods

rnf :: C n -> () #

Additive (C n) Source # 

Methods

add :: C n -> C n -> C n Source #

KnownNat n => Disp (C n) Source # 

Methods

disp :: Int -> C n -> IO () Source #

KnownNat n => Eigen (Sq n) (C n) (M n n) Source # 

Methods

eigensystem :: Sq n -> (C n, M n n) Source #

eigenvalues :: Sq n -> C n Source #

KnownNat n => Diag (M n n) (C n) Source # 

Methods

takeDiag :: M n n -> C n Source #

type Rep (C n) Source # 
type Rep (C n)

data M m n Source #

Instances

Domain C M Source # 

Methods

mul :: (KnownNat m, KnownNat k, KnownNat n) => M m k -> M k n -> M m n Source #

app :: (KnownNat m, KnownNat n) => M m n -> C n -> C m Source #

dot :: KnownNat n => C n -> C n -> Source #

cross :: C 3 -> C 3 -> C 3 Source #

diagR :: (KnownNat m, KnownNat n, KnownNat k) => -> C k -> M m n Source #

dvmap :: KnownNat n => ( -> ) -> C n -> C n Source #

dmmap :: (KnownNat m, KnownNat n) => ( -> ) -> M n m -> M n m Source #

outer :: (KnownNat m, KnownNat n) => C n -> C m -> M n m Source #

zipWithVector :: KnownNat n => ( -> -> ) -> C n -> C n -> C n Source #

det :: KnownNat n => M n n -> Source #

invlndet :: KnownNat n => M n n -> (M n n, (, )) Source #

expm :: KnownNat n => M n n -> M n n Source #

sqrtm :: KnownNat n => M n n -> M n n Source #

inv :: KnownNat n => M n n -> M n n Source #

(KnownNat m, KnownNat n) => Sized (M m n) Matrix Source # 

Methods

konst :: -> M m n Source #

unwrap :: M m n -> Matrix Source #

fromList :: [] -> M m n Source #

extract :: M m n -> Matrix Source #

create :: Matrix -> Maybe (M m n) Source #

size :: M m n -> IndexOf Matrix Source #

KnownNat n => Eigen (Sq n) (C n) (M n n) Source # 

Methods

eigensystem :: Sq n -> (C n, M n n) Source #

eigenvalues :: Sq n -> C n Source #

(KnownNat n, KnownNat m) => Floating (M n m) Source # 

Methods

pi :: M n m #

exp :: M n m -> M n m #

log :: M n m -> M n m #

sqrt :: M n m -> M n m #

(**) :: M n m -> M n m -> M n m #

logBase :: M n m -> M n m -> M n m #

sin :: M n m -> M n m #

cos :: M n m -> M n m #

tan :: M n m -> M n m #

asin :: M n m -> M n m #

acos :: M n m -> M n m #

atan :: M n m -> M n m #

sinh :: M n m -> M n m #

cosh :: M n m -> M n m #

tanh :: M n m -> M n m #

asinh :: M n m -> M n m #

acosh :: M n m -> M n m #

atanh :: M n m -> M n m #

log1p :: M n m -> M n m #

expm1 :: M n m -> M n m #

log1pexp :: M n m -> M n m #

log1mexp :: M n m -> M n m #

(KnownNat n, KnownNat m) => Fractional (M n m) Source # 

Methods

(/) :: M n m -> M n m -> M n m #

recip :: M n m -> M n m #

fromRational :: Rational -> M n m #

(KnownNat n, KnownNat m) => Num (M n m) Source # 

Methods

(+) :: M n m -> M n m -> M n m #

(-) :: M n m -> M n m -> M n m #

(*) :: M n m -> M n m -> M n m #

negate :: M n m -> M n m #

abs :: M n m -> M n m #

signum :: M n m -> M n m #

fromInteger :: Integer -> M n m #

(KnownNat m, KnownNat n) => Show (M m n) Source # 

Methods

showsPrec :: Int -> M m n -> ShowS #

show :: M m n -> String #

showList :: [M m n] -> ShowS #

Generic (M m n) Source # 

Associated Types

type Rep (M m n) :: * -> * #

Methods

from :: M m n -> Rep (M m n) x #

to :: Rep (M m n) x -> M m n #

NFData (M n m) Source # 

Methods

rnf :: M n m -> () #

(KnownNat m, KnownNat n) => Additive (M m n) Source # 

Methods

add :: M m n -> M m n -> M m n Source #

(KnownNat m, KnownNat n) => Disp (M m n) Source # 

Methods

disp :: Int -> M m n -> IO () Source #

KnownNat n => Diag (M n n) (C n) Source # 

Methods

takeDiag :: M n n -> C n Source #

(KnownNat n, KnownNat m) => Transposable (M m n) (M n m) Source # 

Methods

tr :: M m n -> M n m Source #

tr' :: M m n -> M n m Source #

type Rep (M m n) Source # 
type Rep (M m n)

data Her n Source #

Instances

KnownNat n => Disp (Her n) Source # 

Methods

disp :: Int -> Her n -> IO () Source #

KnownNat n => Transposable (Her n) (Her n) Source # 

Methods

tr :: Her n -> Her n Source #

tr' :: Her n -> Her n Source #

her :: KnownNat n => M n n -> Her n Source #

𝑖 :: Sized s c => s Source #

Products

(<>) :: forall m k n. (KnownNat m, KnownNat k, KnownNat n) => L m k -> L k n -> L m n infixr 8 Source #

(#>) :: (KnownNat m, KnownNat n) => L m n -> R n -> R m infixr 8 Source #

(<.>) :: KnownNat n => R n -> R n -> infixr 8 Source #

Linear Systems

linSolve :: (KnownNat m, KnownNat n) => L m m -> L m n -> Maybe (L m n) Source #

(<\>) :: (KnownNat m, KnownNat n, KnownNat r) => L m n -> L m r -> L n r Source #

Factorizations

svd :: (KnownNat m, KnownNat n) => L m n -> (L m m, R n, L n n) Source #

withCompactSVD :: forall m n z. (KnownNat m, KnownNat n) => L m n -> (forall k. KnownNat k => (L m k, R k, L n k) -> z) -> z Source #

svdTall :: (KnownNat m, KnownNat n, n <= m) => L m n -> (L m n, R n, L n n) Source #

svdFlat :: (KnownNat m, KnownNat n, m <= n) => L m n -> (L m m, R m, L n m) Source #

class Eigen m l v | m -> l, m -> v where Source #

Minimal complete definition

eigensystem, eigenvalues

Methods

eigensystem :: m -> (l, v) Source #

eigenvalues :: m -> l Source #

Instances

KnownNat n => Eigen (Sym n) (R n) (L n n) Source # 

Methods

eigensystem :: Sym n -> (R n, L n n) Source #

eigenvalues :: Sym n -> R n Source #

KnownNat n => Eigen (Sq n) (C n) (M n n) Source # 

Methods

eigensystem :: Sq n -> (C n, M n n) Source #

eigenvalues :: Sq n -> C n Source #

withNullspace :: forall m n z. (KnownNat m, KnownNat n) => L m n -> (forall k. KnownNat k => L n k -> z) -> z Source #

withOrth :: forall m n z. (KnownNat m, KnownNat n) => L m n -> (forall k. KnownNat k => L n k -> z) -> z Source #

qr :: (KnownNat m, KnownNat n) => L m n -> (L m m, L m n) Source #

chol :: KnownNat n => Sym n -> Sq n Source #

Norms

class Normed a where Source #

p-norm for vectors, operator norm for matrices

Minimal complete definition

norm_0, norm_1, norm_2, norm_Inf

Methods

norm_0 :: a -> R Source #

norm_1 :: a -> R Source #

norm_2 :: a -> R Source #

norm_Inf :: a -> R Source #

Instances

Normed (Vector Float) Source # 
Normed (Vector (Complex Float)) Source # 
Normed (Vector C) Source # 
Normed (Vector R) Source # 
Normed (Vector Z) Source # 
Normed (Vector I) Source # 
KnownNat m => Normed (Vector (Mod m Z)) Source # 

Methods

norm_0 :: Vector (Mod m Z) -> R Source #

norm_1 :: Vector (Mod m Z) -> R Source #

norm_2 :: Vector (Mod m Z) -> R Source #

norm_Inf :: Vector (Mod m Z) -> R Source #

KnownNat m => Normed (Vector (Mod m I)) Source # 

Methods

norm_0 :: Vector (Mod m I) -> R Source #

norm_1 :: Vector (Mod m I) -> R Source #

norm_2 :: Vector (Mod m I) -> R Source #

norm_Inf :: Vector (Mod m I) -> R Source #

Normed (Matrix C) Source # 
Normed (Matrix R) Source # 

Random arrays

type Seed = Int Source #

data RandDist Source #

Constructors

Uniform

uniform distribution in [0,1)

Gaussian

normal distribution with mean zero and standard deviation one

randomVector :: forall n. KnownNat n => Seed -> RandDist -> R n Source #

rand :: forall m n. (KnownNat m, KnownNat n) => IO (L m n) Source #

randn :: forall m n. (KnownNat m, KnownNat n) => IO (L m n) Source #

gaussianSample :: forall m n. (KnownNat m, KnownNat n) => Seed -> R n -> Sym n -> L m n Source #

uniformSample Source #

Arguments

:: (KnownNat m, KnownNat n) 
=> Seed 
-> R n

minimums of each row

-> R n

maximums of each row

-> L m n 

Misc

mean :: (KnownNat n, 1 <= n) => R n -> Source #

meanCov :: forall m n. (KnownNat m, KnownNat n, 1 <= m) => L m n -> (R n, Sym n) Source #

class Disp t where Source #

Minimal complete definition

disp

Methods

disp :: Int -> t -> IO () Source #

Instances

KnownNat n => Disp (C n) Source # 

Methods

disp :: Int -> C n -> IO () Source #

KnownNat n => Disp (R n) Source # 

Methods

disp :: Int -> R n -> IO () Source #

KnownNat n => Disp (Her n) Source # 

Methods

disp :: Int -> Her n -> IO () Source #

KnownNat n => Disp (Sym n) Source # 

Methods

disp :: Int -> Sym n -> IO () Source #

(KnownNat m, KnownNat n) => Disp (M m n) Source # 

Methods

disp :: Int -> M m n -> IO () Source #

(KnownNat m, KnownNat n) => Disp (L m n) Source # 

Methods

disp :: Int -> L m n -> IO () Source #

class Domain field vec mat | mat -> vec field, vec -> mat field, field -> mat vec where Source #

Minimal complete definition

mul, app, dot, cross, diagR, dvmap, dmmap, outer, zipWithVector, det, invlndet, expm, sqrtm, inv

Methods

mul :: forall m k n. (KnownNat m, KnownNat k, KnownNat n) => mat m k -> mat k n -> mat m n Source #

app :: forall m n. (KnownNat m, KnownNat n) => mat m n -> vec n -> vec m Source #

dot :: forall n. KnownNat n => vec n -> vec n -> field Source #

cross :: vec 3 -> vec 3 -> vec 3 Source #

diagR :: forall m n k. (KnownNat m, KnownNat n, KnownNat k) => field -> vec k -> mat m n Source #

dvmap :: forall n. KnownNat n => (field -> field) -> vec n -> vec n Source #

dmmap :: forall n m. (KnownNat m, KnownNat n) => (field -> field) -> mat n m -> mat n m Source #

outer :: forall n m. (KnownNat m, KnownNat n) => vec n -> vec m -> mat n m Source #

zipWithVector :: forall n. KnownNat n => (field -> field -> field) -> vec n -> vec n -> vec n Source #

det :: forall n. KnownNat n => mat n n -> field Source #

invlndet :: forall n. KnownNat n => mat n n -> (mat n n, (field, field)) Source #

expm :: forall n. KnownNat n => mat n n -> mat n n Source #

sqrtm :: forall n. KnownNat n => mat n n -> mat n n Source #

inv :: forall n. KnownNat n => mat n n -> mat n n Source #

Instances

Domain C M Source # 

Methods

mul :: (KnownNat m, KnownNat k, KnownNat n) => M m k -> M k n -> M m n Source #

app :: (KnownNat m, KnownNat n) => M m n -> C n -> C m Source #

dot :: KnownNat n => C n -> C n -> Source #

cross :: C 3 -> C 3 -> C 3 Source #

diagR :: (KnownNat m, KnownNat n, KnownNat k) => -> C k -> M m n Source #

dvmap :: KnownNat n => ( -> ) -> C n -> C n Source #

dmmap :: (KnownNat m, KnownNat n) => ( -> ) -> M n m -> M n m Source #

outer :: (KnownNat m, KnownNat n) => C n -> C m -> M n m Source #

zipWithVector :: KnownNat n => ( -> -> ) -> C n -> C n -> C n Source #

det :: KnownNat n => M n n -> Source #

invlndet :: KnownNat n => M n n -> (M n n, (, )) Source #

expm :: KnownNat n => M n n -> M n n Source #

sqrtm :: KnownNat n => M n n -> M n n Source #

inv :: KnownNat n => M n n -> M n n Source #

Domain R L Source # 

Methods

mul :: (KnownNat m, KnownNat k, KnownNat n) => L m k -> L k n -> L m n Source #

app :: (KnownNat m, KnownNat n) => L m n -> R n -> R m Source #

dot :: KnownNat n => R n -> R n -> Source #

cross :: R 3 -> R 3 -> R 3 Source #

diagR :: (KnownNat m, KnownNat n, KnownNat k) => -> R k -> L m n Source #

dvmap :: KnownNat n => ( -> ) -> R n -> R n Source #

dmmap :: (KnownNat m, KnownNat n) => ( -> ) -> L n m -> L n m Source #

outer :: (KnownNat m, KnownNat n) => R n -> R m -> L n m Source #

zipWithVector :: KnownNat n => ( -> -> ) -> R n -> R n -> R n Source #

det :: KnownNat n => L n n -> Source #

invlndet :: KnownNat n => L n n -> (L n n, (, )) Source #

expm :: KnownNat n => L n n -> L n n Source #

sqrtm :: KnownNat n => L n n -> L n n Source #

inv :: KnownNat n => L n n -> L n n Source #

withVector :: forall z. Vector -> (forall n. KnownNat n => R n -> z) -> z Source #

withMatrix :: forall z. Matrix -> (forall m n. (KnownNat m, KnownNat n) => L m n -> z) -> z Source #

exactLength :: forall n m. (KnownNat n, KnownNat m) => R m -> Maybe (R n) Source #

Useful for constraining two dependently typed vectors to match each other in length when they are unknown at compile-time.

exactDims :: forall n m j k. (KnownNat n, KnownNat m, KnownNat j, KnownNat k) => L m n -> Maybe (L j k) Source #

Useful for constraining two dependently typed matrices to match each other in dimensions when they are unknown at compile-time.

toRows :: forall m n. (KnownNat m, KnownNat n) => L m n -> [R n] Source #

toColumns :: forall m n. (KnownNat m, KnownNat n) => L m n -> [R m] Source #

withRows :: forall n z. KnownNat n => [R n] -> (forall m. KnownNat m => L m n -> z) -> z Source #

withColumns :: forall m z. KnownNat m => [R m] -> (forall n. KnownNat n => L m n -> z) -> z Source #

class Num t => Sized t s d | s -> t, s -> d where Source #

Minimal complete definition

konst, unwrap, fromList, extract, create, size

Methods

konst :: t -> s Source #

unwrap :: s -> d t Source #

fromList :: [t] -> s Source #

extract :: s -> d t Source #

create :: d t -> Maybe s Source #

size :: s -> IndexOf d Source #

Instances

KnownNat n => Sized (C n) Vector Source # 
KnownNat n => Sized (R n) Vector Source # 
(KnownNat m, KnownNat n) => Sized (M m n) Matrix Source # 

Methods

konst :: -> M m n Source #

unwrap :: M m n -> Matrix Source #

fromList :: [] -> M m n Source #

extract :: M m n -> Matrix Source #

create :: Matrix -> Maybe (M m n) Source #

size :: M m n -> IndexOf Matrix Source #

(KnownNat m, KnownNat n) => Sized (L m n) Matrix Source # 

Methods

konst :: -> L m n Source #

unwrap :: L m n -> Matrix Source #

fromList :: [] -> L m n Source #

extract :: L m n -> Matrix Source #

create :: Matrix -> Maybe (L m n) Source #

size :: L m n -> IndexOf Matrix Source #

class Diag m d | m -> d where Source #

Minimal complete definition

takeDiag

Methods

takeDiag :: m -> d Source #

Instances

KnownNat n => Diag (M n n) (C n) Source # 

Methods

takeDiag :: M n n -> C n Source #

KnownNat n => Diag (L n n) (R n) Source # 

Methods

takeDiag :: L n n -> R n Source #

data Sym n Source #

Instances

KnownNat n => Floating (Sym n) Source # 

Methods

pi :: Sym n #

exp :: Sym n -> Sym n #

log :: Sym n -> Sym n #

sqrt :: Sym n -> Sym n #

(**) :: Sym n -> Sym n -> Sym n #

logBase :: Sym n -> Sym n -> Sym n #

sin :: Sym n -> Sym n #

cos :: Sym n -> Sym n #

tan :: Sym n -> Sym n #

asin :: Sym n -> Sym n #

acos :: Sym n -> Sym n #

atan :: Sym n -> Sym n #

sinh :: Sym n -> Sym n #

cosh :: Sym n -> Sym n #

tanh :: Sym n -> Sym n #

asinh :: Sym n -> Sym n #

acosh :: Sym n -> Sym n #

atanh :: Sym n -> Sym n #

log1p :: Sym n -> Sym n #

expm1 :: Sym n -> Sym n #

log1pexp :: Sym n -> Sym n #

log1mexp :: Sym n -> Sym n #

KnownNat n => Fractional (Sym n) Source # 

Methods

(/) :: Sym n -> Sym n -> Sym n #

recip :: Sym n -> Sym n #

fromRational :: Rational -> Sym n #

KnownNat n => Num (Sym n) Source # 

Methods

(+) :: Sym n -> Sym n -> Sym n #

(-) :: Sym n -> Sym n -> Sym n #

(*) :: Sym n -> Sym n -> Sym n #

negate :: Sym n -> Sym n #

abs :: Sym n -> Sym n #

signum :: Sym n -> Sym n #

fromInteger :: Integer -> Sym n #

KnownNat n => Show (Sym n) Source # 

Methods

showsPrec :: Int -> Sym n -> ShowS #

show :: Sym n -> String #

showList :: [Sym n] -> ShowS #

KnownNat n => Additive (Sym n) Source # 

Methods

add :: Sym n -> Sym n -> Sym n Source #

KnownNat n => Disp (Sym n) Source # 

Methods

disp :: Int -> Sym n -> IO () Source #

KnownNat n => Transposable (Sym n) (Sym n) Source # 

Methods

tr :: Sym n -> Sym n Source #

tr' :: Sym n -> Sym n Source #

KnownNat n => Eigen (Sym n) (R n) (L n n) Source # 

Methods

eigensystem :: Sym n -> (R n, L n n) Source #

eigenvalues :: Sym n -> R n Source #

sym :: KnownNat n => Sq n -> Sym n Source #

mTm :: (KnownNat m, KnownNat n) => L m n -> Sym n Source #

unSym :: Sym n -> Sq n Source #

(<·>) :: KnownNat n => R n -> R n -> infixr 8 Source #

Orphan instances

KnownNat n => Normed (R n) Source # 

Methods

norm_0 :: R n -> R Source #

norm_1 :: R n -> R Source #

norm_2 :: R n -> R Source #

norm_Inf :: R n -> R Source #

(KnownNat n', KnownNat m') => Testable (L n' m') Source # 

Methods

checkT :: L n' m' -> (Bool, IO ()) Source #

ioCheckT :: L n' m' -> IO (Bool, IO ()) Source #

(KnownNat m, KnownNat n) => Normed (L m n) Source # 

Methods

norm_0 :: L m n -> R Source #

norm_1 :: L m n -> R Source #

norm_2 :: L m n -> R Source #

norm_Inf :: L m n -> R Source #