hmatrix-0.20.1: Numeric Linear Algebra
Copyright(c) Alberto Ruiz 2014
LicenseBSD3
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Numeric.LinearAlgebra.Static

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

Instances details
Domain R L Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

dot :: forall (n :: Nat). KnownNat n => R n -> R n -> Source #

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

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

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

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

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

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

det :: forall (n :: Nat). KnownNat n => L n n -> Source #

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

expm :: forall (n :: Nat). KnownNat n => L n n -> L n n Source #

sqrtm :: forall (n :: Nat). KnownNat n => L n n -> L n n Source #

inv :: forall (n :: Nat). KnownNat n => L n n -> L n n Source #

KnownNat n => Sized (R n) Vector Source # 
Instance details

Defined in Internal.Static

Floating (R n) Source # 
Instance details

Defined in Internal.Static

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 # 
Instance details

Defined in Internal.Static

Methods

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

recip :: R n -> R n #

fromRational :: Rational -> R n #

Num (R n) Source # 
Instance details

Defined in Internal.Static

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 # 
Instance details

Defined in Internal.Static

Methods

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

show :: R n -> String #

showList :: [R n] -> ShowS #

Generic (R n) Source # 
Instance details

Defined in Internal.Static

Associated Types

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

Methods

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

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

KnownNat n => Binary (R n) Source # 
Instance details

Defined in Internal.Static

Methods

put :: R n -> Put #

get :: Get (R n) #

putList :: [R n] -> Put #

NFData (R n) Source # 
Instance details

Defined in Internal.Static

Methods

rnf :: R n -> () #

Additive (R n) Source # 
Instance details

Defined in Internal.Static

Methods

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

KnownNat n => Normed (R n) Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

norm_0 :: R n -> R0 Source #

norm_1 :: R n -> R0 Source #

norm_2 :: R n -> R0 Source #

norm_Inf :: R n -> R0 Source #

KnownNat n => Disp (R n) Source # 
Instance details

Defined in Internal.Static

Methods

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

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

Defined in Numeric.LinearAlgebra.Static

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 # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

type Rep (R n) Source # 
Instance details

Defined in Internal.Static

type Rep (R n)

vec2 :: -> -> R 2 Source #

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

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

(&) :: forall n. KnownNat 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

Instances details
Domain R L Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

dot :: forall (n :: Nat). KnownNat n => R n -> R n -> Source #

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

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

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

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

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

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

det :: forall (n :: Nat). KnownNat n => L n n -> Source #

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

expm :: forall (n :: Nat). KnownNat n => L n n -> L n n Source #

sqrtm :: forall (n :: Nat). KnownNat n => L n n -> L n n Source #

inv :: forall (n :: Nat). KnownNat n => L n n -> L n n Source #

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

Defined in Internal.Static

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 # 
Instance details

Defined in Numeric.LinearAlgebra.Static

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 # 
Instance details

Defined in Numeric.LinearAlgebra.Static

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 # 
Instance details

Defined in Internal.Static

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 # 
Instance details

Defined in Internal.Static

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 # 
Instance details

Defined in Internal.Static

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 # 
Instance details

Defined in Internal.Static

Methods

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

show :: L m n -> String #

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

Generic (L m n) Source # 
Instance details

Defined in Internal.Static

Associated Types

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

Methods

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

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

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

Defined in Internal.Static

Methods

put :: L m n -> Put #

get :: Get (L m n) #

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

NFData (L n m) Source # 
Instance details

Defined in Internal.Static

Methods

rnf :: L n m -> () #

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

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

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

Defined in Internal.Static

Methods

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

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

Defined in Numeric.LinearAlgebra.Static

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 #

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

Defined in Internal.Static

Methods

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

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

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

Defined in Internal.Static

Methods

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

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

type Rep (L m n) Source # 
Instance details

Defined in Internal.Static

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 :: forall (n :: Nat). KnownNat n => R n -> L n 1 Source #

(|||) :: forall (c :: Nat) (r1 :: Nat) (r2 :: Nat). (KnownNat c, KnownNat (r1 + r2), KnownNat r1, KnownNat r2) => 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 :: forall (n :: Nat). 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

Instances details
Domain C M Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

dot :: forall (n :: Nat). KnownNat n => C n -> C n -> Source #

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

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

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

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

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

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

det :: forall (n :: Nat). KnownNat n => M n n -> Source #

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

expm :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

sqrtm :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

inv :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

KnownNat n => Sized (C n) Vector Source # 
Instance details

Defined in Internal.Static

Floating (C n) Source # 
Instance details

Defined in Internal.Static

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 # 
Instance details

Defined in Internal.Static

Methods

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

recip :: C n -> C n #

fromRational :: Rational -> C n #

Num (C n) Source # 
Instance details

Defined in Internal.Static

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 # 
Instance details

Defined in Internal.Static

Methods

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

show :: C n -> String #

showList :: [C n] -> ShowS #

Generic (C n) Source # 
Instance details

Defined in Internal.Static

Associated Types

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

Methods

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

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

NFData (C n) Source # 
Instance details

Defined in Internal.Static

Methods

rnf :: C n -> () #

Additive (C n) Source # 
Instance details

Defined in Internal.Static

Methods

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

KnownNat n => Disp (C n) Source # 
Instance details

Defined in Internal.Static

Methods

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

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

Defined in Numeric.LinearAlgebra.Static

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 # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

type Rep (C n) Source # 
Instance details

Defined in Internal.Static

type Rep (C n)

data M m n Source #

Instances

Instances details
Domain C M Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

dot :: forall (n :: Nat). KnownNat n => C n -> C n -> Source #

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

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

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

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

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

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

det :: forall (n :: Nat). KnownNat n => M n n -> Source #

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

expm :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

sqrtm :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

inv :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

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

Defined in Internal.Static

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 # 
Instance details

Defined in Numeric.LinearAlgebra.Static

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 # 
Instance details

Defined in Internal.Static

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 # 
Instance details

Defined in Internal.Static

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 # 
Instance details

Defined in Internal.Static

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 # 
Instance details

Defined in Internal.Static

Methods

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

show :: M m n -> String #

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

Generic (M m n) Source # 
Instance details

Defined in Internal.Static

Associated Types

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

Methods

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

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

NFData (M n m) Source # 
Instance details

Defined in Internal.Static

Methods

rnf :: M n m -> () #

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

Defined in Internal.Static

Methods

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

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

Defined in Internal.Static

Methods

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

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

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

Defined in Internal.Static

Methods

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

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

type Rep (M m n) Source # 
Instance details

Defined in Internal.Static

type Rep (M m n)

data Her n Source #

Instances

Instances details
KnownNat n => Disp (Her n) Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

Defined in Numeric.LinearAlgebra.Static

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 #

toComplex :: KnownNat n => (R n, R n) -> C n Source #

fromComplex :: KnownNat n => C n -> (R n, R n) Source #

complex :: KnownNat n => R n -> C n Source #

real :: KnownNat n => C n -> R n Source #

imag :: KnownNat n => C n -> R n Source #

sqMagnitude :: KnownNat n => C n -> R n Source #

magnitude :: KnownNat n => C n -> R n 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 #

Methods

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

eigenvalues :: m -> l Source #

Instances

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

Defined in Numeric.LinearAlgebra.Static

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 # 
Instance details

Defined in Numeric.LinearAlgebra.Static

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

Methods

norm_0 :: a -> R Source #

norm_1 :: a -> R Source #

norm_2 :: a -> R Source #

norm_Inf :: a -> R Source #

Instances

Instances details
Normed (Vector Float) Source # 
Instance details

Defined in Internal.Util

Normed (Vector (Complex Float)) Source # 
Instance details

Defined in Internal.Util

Normed (Vector C) Source # 
Instance details

Defined in Internal.Util

Normed (Vector R) Source # 
Instance details

Defined in Internal.Util

Normed (Vector Z) Source # 
Instance details

Defined in Internal.Util

Normed (Vector I) Source # 
Instance details

Defined in Internal.Util

KnownNat m => Normed (Vector (Mod m Z)) Source # 
Instance details

Defined in Internal.Modular

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 # 
Instance details

Defined in Internal.Modular

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 # 
Instance details

Defined in Internal.Util

Normed (Matrix R) Source # 
Instance details

Defined in Internal.Util

KnownNat n => Normed (R n) Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

norm_0 :: R n -> R0 Source #

norm_1 :: R n -> R0 Source #

norm_2 :: R n -> R0 Source #

norm_Inf :: R n -> R0 Source #

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

Defined in Numeric.LinearAlgebra.Static

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 #

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

:: forall m n. (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 #

Methods

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

Instances

Instances details
KnownNat n => Disp (C n) Source # 
Instance details

Defined in Internal.Static

Methods

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

KnownNat n => Disp (R n) Source # 
Instance details

Defined in Internal.Static

Methods

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

KnownNat n => Disp (Her n) Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

KnownNat n => Disp (Sym n) Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

Defined in Internal.Static

Methods

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

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

Defined in Internal.Static

Methods

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

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

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

Instances details
Domain C M Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

dot :: forall (n :: Nat). KnownNat n => C n -> C n -> Source #

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

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

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

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

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

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

det :: forall (n :: Nat). KnownNat n => M n n -> Source #

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

expm :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

sqrtm :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

inv :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

Domain R L Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

dot :: forall (n :: Nat). KnownNat n => R n -> R n -> Source #

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

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

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

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

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

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

det :: forall (n :: Nat). KnownNat n => L n n -> Source #

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

expm :: forall (n :: Nat). KnownNat n => L n n -> L n n Source #

sqrtm :: forall (n :: Nat). KnownNat n => L n n -> L n n Source #

inv :: forall (n :: Nat). 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 #

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

Instances details
KnownNat n => Sized (C n) Vector Source # 
Instance details

Defined in Internal.Static

KnownNat n => Sized (R n) Vector Source # 
Instance details

Defined in Internal.Static

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

Defined in Internal.Static

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 # 
Instance details

Defined in Internal.Static

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 #

Methods

takeDiag :: m -> d Source #

Instances

Instances details
KnownNat n => Diag (M n n) (C n) Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

Defined in Numeric.LinearAlgebra.Static

Methods

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

data Sym n Source #

Instances

Instances details
KnownNat n => Floating (Sym n) Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

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 # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

recip :: Sym n -> Sym n #

fromRational :: Rational -> Sym n #

KnownNat n => Num (Sym n) Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

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 # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

show :: Sym n -> String #

showList :: [Sym n] -> ShowS #

KnownNat n => Additive (Sym n) Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

KnownNat n => Disp (Sym n) Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

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

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

Defined in Numeric.LinearAlgebra.Static

Methods

tr :: Sym n -> Sym n Source #

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

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

Defined in Numeric.LinearAlgebra.Static

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 # 
Instance details

Methods

norm_0 :: R n -> R0 Source #

norm_1 :: R n -> R0 Source #

norm_2 :: R n -> R0 Source #

norm_Inf :: R n -> R0 Source #

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

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 # 
Instance details

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 #