hmatrix-0.20.2: Numeric Linear Algebra

Copyright | (c) Alberto Ruiz 2014
License | BSD3
Stability | experimental
Safe Haskell | None
Language | Haskell2010

Numeric.LinearAlgebra.Static

Contents

- Vector
- Matrix
- Complex
- Products
- Linear Systems
- Factorizations
- Norms
- Random arrays
- Misc
- Orphan instances

Description

Experimental interface with statically checked dimensions.

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

Synopsis

- type ℝ = Double
- data R (n :: Nat)
- vec2 :: ℝ -> ℝ -> R 2
- vec3 :: ℝ -> ℝ -> ℝ -> R 3
- vec4 :: ℝ -> ℝ -> ℝ -> ℝ -> R 4
- (&) :: forall (n :: Nat). KnownNat n => R n -> ℝ -> R (n + 1)
- (#) :: forall (n :: Nat) (m :: Nat). (KnownNat n, KnownNat m) => R n -> R m -> R (n + m)
- split :: forall (p :: Nat) (n :: Nat). (KnownNat p, KnownNat n, p <= n) => R n -> (R p, R (n - p))
- headTail :: forall (n :: Nat). (KnownNat n, 1 <= n) => R n -> (ℝ, R (n - 1))
- vector :: forall (n :: Nat). KnownNat n => [ℝ] -> R n
- linspace :: forall (n :: Nat). KnownNat n => (ℝ, ℝ) -> R n
- range :: forall (n :: Nat). KnownNat n => R n
- dim :: forall (n :: Nat). KnownNat n => R n
- data L (m :: Nat) (n :: Nat)
- type Sq (n :: Nat) = L n n
- build :: forall (m :: Nat) (n :: Nat). (KnownNat n, KnownNat m) => (ℝ -> ℝ -> ℝ) -> L m n
- row :: forall (n :: Nat). R n -> L 1 n
- col :: forall {n :: Nat}. KnownNat n => R n -> L n 1
- (|||) :: forall {c :: Nat} {r1 :: Nat} {r2 :: Nat}. (KnownNat c, KnownNat r1, KnownNat r2, KnownNat (r1 + r2)) => L c r1 -> L c r2 -> L c (r1 + r2)
- (===) :: forall (r1 :: Nat) (r2 :: Nat) (c :: Nat). (KnownNat r1, KnownNat r2, KnownNat c) => L r1 c -> L r2 c -> L (r1 + r2) c
- splitRows :: forall (p :: Nat) (m :: Nat) (n :: Nat). (KnownNat p, KnownNat m, KnownNat n, p <= m) => L m n -> (L p n, L (m - p) n)
- splitCols :: forall (p :: Nat) (m :: Nat) (n :: Nat). (KnownNat p, KnownNat m, KnownNat n, KnownNat (n - p), p <= n) => L m n -> (L m p, L m (n - p))
- unrow :: forall (n :: Nat). L 1 n -> R n
- uncol :: forall {n :: Nat}. KnownNat n => L n 1 -> R n
- tr :: Transposable m mt => m -> mt
- eye :: forall (n :: Nat). KnownNat n => Sq n
- diag :: forall (n :: Nat). KnownNat n => R n -> Sq n
- blockAt :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => ℝ -> Int -> Int -> Matrix Double -> L m n
- matrix :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => [ℝ] -> L m n
- type ℂ = Complex Double
- data C (n :: Nat)
- data M (m :: Nat) (n :: Nat)
- data Her (n :: Nat)
- her :: forall (n :: Nat). KnownNat n => M n n -> Her n
- 𝑖 :: forall s (c :: Type -> Type). Sized ℂ s c => s
- toComplex :: forall (n :: Nat). KnownNat n => (R n, R n) -> C n
- fromComplex :: forall (n :: Nat). KnownNat n => C n -> (R n, R n)
- complex :: forall (n :: Nat). KnownNat n => R n -> C n
- real :: forall (n :: Nat). KnownNat n => C n -> R n
- imag :: forall (n :: Nat). KnownNat n => C n -> R n
- sqMagnitude :: forall (n :: Nat). KnownNat n => C n -> R n
- magnitude :: forall (n :: Nat). KnownNat n => C n -> R n
- (<>) :: forall (m :: Nat) (k :: Nat) (n :: Nat). (KnownNat m, KnownNat k, KnownNat n) => L m k -> L k n -> L m n
- (#>) :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => L m n -> R n -> R m
- (<.>) :: forall (n :: Nat). KnownNat n => R n -> R n -> ℝ
- linSolve :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => L m m -> L m n -> Maybe (L m n)
- (<\>) :: forall (m :: Nat) (n :: Nat) (r :: Nat). (KnownNat m, KnownNat n, KnownNat r) => L m n -> L m r -> L n r
- svd :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => L m n -> (L m m, R n, L n n)
- withCompactSVD :: forall (m :: Nat) (n :: Nat) z. (KnownNat m, KnownNat n) => L m n -> (forall (k :: Nat). KnownNat k => (L m k, R k, L n k) -> z) -> z
- svdTall :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n, n <= m) => L m n -> (L m n, R n, L n n)
- svdFlat :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n, m <= n) => L m n -> (L m m, R m, L n m)
- class Eigen m l v | m -> l, m -> v where
  - eigensystem :: m -> (l, v)
  - eigenvalues :: m -> l
- withNullspace :: forall (m :: Nat) (n :: Nat) z. (KnownNat m, KnownNat n) => L m n -> (forall (k :: Nat). KnownNat k => L n k -> z) -> z
- withOrth :: forall (m :: Nat) (n :: Nat) z. (KnownNat m, KnownNat n) => L m n -> (forall (k :: Nat). KnownNat k => L n k -> z) -> z
- qr :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => L m n -> (L m m, L m n)
- chol :: forall (n :: Nat). KnownNat n => Sym n -> Sq n
- class Normed a where
  - norm_0 :: a -> R
  - norm_1 :: a -> R
  - norm_2 :: a -> R
  - norm_Inf :: a -> R
- type Seed = Int
- data RandDist
  - = Uniform
  - | Gaussian
- randomVector :: forall (n :: Nat). KnownNat n => Seed -> RandDist -> R n
- rand :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => IO (L m n)
- randn :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => IO (L m n)
- gaussianSample :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => Seed -> R n -> Sym n -> L m n
- uniformSample :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => Seed -> R n -> R n -> L m n
- mean :: forall (n :: Nat). (KnownNat n, 1 <= n) => R n -> ℝ
- meanCov :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n, 1 <= m) => L m n -> (R n, Sym n)
- class Disp t where
  - disp :: Int -> t -> IO ()
- class Domain field (vec :: Nat -> Type) (mat :: Nat -> Nat -> Type) | mat -> vec field, vec -> mat field, field -> mat vec where
  - mul :: forall (m :: Nat) (k :: Nat) (n :: Nat). (KnownNat m, KnownNat k, KnownNat n) => mat m k -> mat k n -> mat m n
  - app :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => mat m n -> vec n -> vec m
  - dot :: forall (n :: Nat). KnownNat n => vec n -> vec n -> field
  - cross :: vec 3 -> vec 3 -> vec 3
  - diagR :: forall (m :: Nat) (n :: Nat) (k :: Nat). (KnownNat m, KnownNat n, KnownNat k) => field -> vec k -> mat m n
  - dvmap :: forall (n :: Nat). KnownNat n => (field -> field) -> vec n -> vec n
  - dmmap :: forall (n :: Nat) (m :: Nat). (KnownNat m, KnownNat n) => (field -> field) -> mat n m -> mat n m
  - outer :: forall (n :: Nat) (m :: Nat). (KnownNat m, KnownNat n) => vec n -> vec m -> mat n m
  - zipWithVector :: forall (n :: Nat). KnownNat n => (field -> field -> field) -> vec n -> vec n -> vec n
  - det :: forall (n :: Nat). KnownNat n => mat n n -> field
  - invlndet :: forall (n :: Nat). KnownNat n => mat n n -> (mat n n, (field, field))
  - expm :: forall (n :: Nat). KnownNat n => mat n n -> mat n n
  - sqrtm :: forall (n :: Nat). KnownNat n => mat n n -> mat n n
  - inv :: forall (n :: Nat). KnownNat n => mat n n -> mat n n
- withVector :: Vector ℝ -> (forall (n :: Nat). KnownNat n => R n -> z) -> z
- withMatrix :: Matrix ℝ -> (forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => L m n -> z) -> z
- exactLength :: forall (n :: Nat) (m :: Nat). (KnownNat n, KnownNat m) => R m -> Maybe (R n)
- exactDims :: forall (n :: Nat) (m :: Nat) (j :: Nat) (k :: Nat). (KnownNat n, KnownNat m, KnownNat j, KnownNat k) => L m n -> Maybe (L j k)
- toRows :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => L m n -> [R n]
- toColumns :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => L m n -> [R m]
- withRows :: forall (n :: Nat) z. KnownNat n => [R n] -> (forall (m :: Nat). KnownNat m => L m n -> z) -> z
- withColumns :: forall (m :: Nat) z. KnownNat m => [R m] -> (forall (n :: Nat). KnownNat n => L m n -> z) -> z
- class Num t => Sized t s (d :: Type -> Type) | s -> t, s -> d where
  - konst :: t -> s
  - unwrap :: s -> d t
  - fromList :: [t] -> s
  - extract :: s -> d t
  - create :: d t -> Maybe s
  - size :: s -> IndexOf d
- class Diag m d | m -> d where
  - takeDiag :: m -> d
- data Sym (n :: Nat)
- sym :: forall (n :: Nat). KnownNat n => Sq n -> Sym n
- mTm :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => L m n -> Sym n
- unSym :: forall (n :: Nat). Sym n -> Sq n
- (<·>) :: forall (n :: Nat). KnownNat n => R n -> R n -> ℝ

# Vector

type ℝ = Double Source #

data R (n :: Nat) 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 Methods konst :: ℝ -> R n Source # unwrap :: R n -> Vector ℝ Source # fromList :: [ℝ] -> R n Source # extract :: R n -> Vector ℝ Source # create :: Vector ℝ -> Maybe (R n) Source # size :: R n -> IndexOf Vector Source #
KnownNat n => Binary (R n) Source # |
Instance details Defined in Internal.Static Methods put :: R n -> Put Source # get :: Get (R n) Source # putList :: [R n] -> Put Source #
NFData (R n) Source # |
Instance details Defined in Internal.Static Methods rnf :: R n -> () Source #
Floating (R n) Source # |

Instance details

Defined in Internal.Static

Methods

pi :: R n Source #

exp :: R n -> R n Source #

log :: R n -> R n Source #

sqrt :: R n -> R n Source #

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

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

sin :: R n -> R n Source #

cos :: R n -> R n Source #

tan :: R n -> R n Source #

asin :: R n -> R n Source #

acos :: R n -> R n Source #

atan :: R n -> R n Source #

sinh :: R n -> R n Source #

cosh :: R n -> R n Source #

tanh :: R n -> R n Source #

asinh :: R n -> R n Source #

acosh :: R n -> R n Source #

atanh :: R n -> R n Source #

log1p :: R n -> R n Source #

expm1 :: R n -> R n Source #

log1pexp :: R n -> R n Source #

log1mexp :: R n -> R n Source #

Generic (R n) Source # |

Instance details

Defined in Internal.Static

Associated Types

type Rep (R n) |
Instance details Defined in Internal.Static type Rep (R n)

Methods

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

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

Num (R n) Source # |
Instance details Defined in Internal.Static Methods (+) :: R n -> R n -> R n Source # (-) :: R n -> R n -> R n Source # (*) :: R n -> R n -> R n Source # negate :: R n -> R n Source # abs :: R n -> R n Source # signum :: R n -> R n Source # fromInteger :: Integer -> R n Source #
Fractional (R n) Source # |
Instance details Defined in Internal.Static Methods (/) :: R n -> R n -> R n Source # recip :: R n -> R n Source # fromRational :: Rational -> R n Source #
KnownNat n => Show (R n) Source # |
Instance details Defined in Internal.Static Methods showsPrec :: Int -> R n -> ShowS Source # show :: R n -> String Source # showList :: [R n] -> ShowS Source #
Additive (R n) Source # |
Instance details Defined in Internal.Static Methods add :: R n -> R n -> R n Source #
KnownNat n => Disp (R n) Source # |
Instance details Defined in Internal.Static Methods disp :: Int -> R n -> IO () Source #
KnownNat n => Normed (R n) Source # |
Instance details Defined in Numeric.LinearAlgebra.Static 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 => 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 :: Nat). KnownNat n => R n -> ℝ -> R (n + 1) infixl 4 Source #

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

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

headTail :: forall (n :: Nat). (KnownNat n, 1 <= n) => R n -> (ℝ, R (n - 1)) Source #

vector :: forall (n :: Nat). KnownNat n => [ℝ] -> R n Source #

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

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

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

# Matrix

data L (m :: Nat) (n :: Nat) 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 (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 => 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 m, KnownNat n) => Binary (L m n) Source # |
Instance details Defined in Internal.Static Methods put :: L m n -> Put Source # get :: Get (L m n) Source # putList :: [L m n] -> Put Source #
NFData (L n m) Source # |
Instance details Defined in Internal.Static Methods rnf :: L n m -> () Source #
(KnownNat n, KnownNat m) => Floating (L n m) Source # |

Instance details

Defined in Internal.Static

Methods

pi :: L n m Source #

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Generic (L m n) Source # |

Instance details

Defined in Internal.Static

Associated Types

type Rep (L m n) |
Instance details Defined in Internal.Static type Rep (L m n)

Methods

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

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

(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 Source # (-) :: L n m -> L n m -> L n m Source # (*) :: L n m -> L n m -> L n m Source # negate :: L n m -> L n m Source # abs :: L n m -> L n m Source # signum :: L n m -> L n m Source # fromInteger :: Integer -> L n m Source #
(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 Source # recip :: L n m -> L n m Source # fromRational :: Rational -> L n m Source #
(KnownNat m, KnownNat n) => Show (L m n) Source # |
Instance details Defined in Internal.Static Methods showsPrec :: Int -> L m n -> ShowS Source # show :: L m n -> String Source # showList :: [L m n] -> ShowS 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 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) => Disp (L m n) Source # |
Instance details Defined in Internal.Static Methods disp :: Int -> L m n -> IO () 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 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 :: Nat) = L n n Source #

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

row :: forall (n :: Nat). 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, KnownNat r2, KnownNat (r1 + r2)) => L c r1 -> L c r2 -> L c (r1 + r2) infixl 3 Source #

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

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

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

unrow :: forall (n :: Nat). 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 :: forall (n :: Nat). KnownNat n => Sq n Source #

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

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

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

# Complex

type ℂ = Complex Double Source #

data C (n :: Nat) 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 Methods konst :: ℂ -> C n Source # unwrap :: C n -> Vector ℂ Source # fromList :: [ℂ] -> C n Source # extract :: C n -> Vector ℂ Source # create :: Vector ℂ -> Maybe (C n) Source # size :: C n -> IndexOf Vector Source #
NFData (C n) Source # |
Instance details Defined in Internal.Static Methods rnf :: C n -> () Source #
Floating (C n) Source # |

Instance details

Defined in Internal.Static

Methods

pi :: C n Source #

exp :: C n -> C n Source #

log :: C n -> C n Source #

sqrt :: C n -> C n Source #

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

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

sin :: C n -> C n Source #

cos :: C n -> C n Source #

tan :: C n -> C n Source #

asin :: C n -> C n Source #

acos :: C n -> C n Source #

atan :: C n -> C n Source #

sinh :: C n -> C n Source #

cosh :: C n -> C n Source #

tanh :: C n -> C n Source #

asinh :: C n -> C n Source #

acosh :: C n -> C n Source #

atanh :: C n -> C n Source #

log1p :: C n -> C n Source #

expm1 :: C n -> C n Source #

log1pexp :: C n -> C n Source #

log1mexp :: C n -> C n Source #

Generic (C n) Source # |

Instance details

Defined in Internal.Static

Associated Types

type Rep (C n) |
Instance details Defined in Internal.Static type Rep (C n)

Methods

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

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

Num (C n) Source # |
Instance details Defined in Internal.Static Methods (+) :: C n -> C n -> C n Source # (-) :: C n -> C n -> C n Source # (*) :: C n -> C n -> C n Source # negate :: C n -> C n Source # abs :: C n -> C n Source # signum :: C n -> C n Source # fromInteger :: Integer -> C n Source #
Fractional (C n) Source # |
Instance details Defined in Internal.Static Methods (/) :: C n -> C n -> C n Source # recip :: C n -> C n Source # fromRational :: Rational -> C n Source #
KnownNat n => Show (C n) Source # |
Instance details Defined in Internal.Static Methods showsPrec :: Int -> C n -> ShowS Source # show :: C n -> String Source # showList :: [C n] -> ShowS Source #
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 :: Nat) (n :: Nat) 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 #
NFData (M n m) Source # |
Instance details Defined in Internal.Static Methods rnf :: M n m -> () Source #
(KnownNat n, KnownNat m) => Floating (M n m) Source # |

Instance details

Defined in Internal.Static

Methods

pi :: M n m Source #

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Generic (M m n) Source # |

Instance details

Defined in Internal.Static

Associated Types

type Rep (M m n) |
Instance details Defined in Internal.Static type Rep (M m n)

Methods

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

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

(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 Source # (-) :: M n m -> M n m -> M n m Source # (*) :: M n m -> M n m -> M n m Source # negate :: M n m -> M n m Source # abs :: M n m -> M n m Source # signum :: M n m -> M n m Source # fromInteger :: Integer -> M n m Source #
(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 Source # recip :: M n m -> M n m Source # fromRational :: Rational -> M n m Source #
(KnownNat m, KnownNat n) => Show (M m n) Source # |
Instance details Defined in Internal.Static Methods showsPrec :: Int -> M m n -> ShowS Source # show :: M m n -> String Source # showList :: [M m n] -> ShowS Source #
(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 :: Nat) 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 :: forall (n :: Nat). KnownNat n => M n n -> Her n Source #

𝑖 :: forall s (c :: Type -> Type). Sized ℂ s c => s Source #

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

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

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

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

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

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

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

# Products

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

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

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

# Linear Systems

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

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

# Factorizations

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

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

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

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

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

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

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

chol :: forall (n :: Nat). 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 (Matrix C) Source # |
Instance details Defined in Internal.Util Methods norm_0 :: Matrix C -> R Source # norm_1 :: Matrix C -> R Source # norm_2 :: Matrix C -> R Source # norm_Inf :: Matrix C -> R Source #
Normed (Matrix R) Source # |
Instance details Defined in Internal.Util Methods norm_0 :: Matrix R -> R Source # norm_1 :: Matrix R -> R Source # norm_2 :: Matrix R -> R Source # norm_Inf :: Matrix R -> R Source #
KnownNat n => Normed (R n) Source # |
Instance details Defined in Numeric.LinearAlgebra.Static 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 #
Normed (Vector (Complex Float)) Source # |
Instance details Defined in Internal.Util Methods norm_0 :: Vector (Complex Float) -> R Source # norm_1 :: Vector (Complex Float) -> R Source # norm_2 :: Vector (Complex Float) -> R Source # norm_Inf :: Vector (Complex Float) -> 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 #
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 #
Normed (Vector C) Source # |
Instance details Defined in Internal.Util Methods norm_0 :: Vector C -> R Source # norm_1 :: Vector C -> R Source # norm_2 :: Vector C -> R Source # norm_Inf :: Vector C -> R Source #
Normed (Vector I) Source # |
Instance details Defined in Internal.Util Methods norm_0 :: Vector I -> R Source # norm_1 :: Vector I -> R Source # norm_2 :: Vector I -> R Source # norm_Inf :: Vector I -> R Source #
Normed (Vector R) Source # |
Instance details Defined in Internal.Util Methods norm_0 :: Vector R -> R Source # norm_1 :: Vector R -> R Source # norm_2 :: Vector R -> R Source # norm_Inf :: Vector R -> R Source #
Normed (Vector Z) Source # |
Instance details Defined in Internal.Util Methods norm_0 :: Vector Z -> R Source # norm_1 :: Vector Z -> R Source # norm_2 :: Vector Z -> R Source # norm_Inf :: Vector Z -> R Source #
Normed (Vector Float) Source # |
Instance details Defined in Internal.Util Methods norm_0 :: Vector Float -> R Source # norm_1 :: Vector Float -> R Source # norm_2 :: Vector Float -> R Source # norm_Inf :: Vector Float -> R 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

#### Instances

Instances details

Enum RandDist Source # |

Instance details

Defined in Internal.Vectorized

Methods

succ :: RandDist -> RandDist Source #

pred :: RandDist -> RandDist Source #

toEnum :: Int -> RandDist Source #

fromEnum :: RandDist -> Int Source #

enumFrom :: RandDist -> [RandDist] Source #

enumFromThen :: RandDist -> RandDist -> [RandDist] Source #

enumFromTo :: RandDist -> RandDist -> [RandDist] Source #

enumFromThenTo :: RandDist -> RandDist -> RandDist -> [RandDist] Source #

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

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

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

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

uniformSample Source #

Arguments

:: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) |
=> Seed |
-> R n | minimums of each row
-> R n | maximums of each row
-> L m n |

# Misc

mean :: forall (n :: Nat). (KnownNat n, 1 <= n) => R n -> ℝ Source #

meanCov :: forall (m :: Nat) (n :: Nat). (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 (L m n) Source # |
Instance details Defined in Internal.Static Methods disp :: Int -> L m 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 #

class Domain field (vec :: Nat -> Type) (mat :: Nat -> Nat -> Type) | mat -> vec field, vec -> mat field, field -> mat vec where Source #

Methods

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

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

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

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

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

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

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

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

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

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

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

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

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

inv :: forall (n :: Nat). 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 :: Vector ℝ -> (forall (n :: Nat). KnownNat n => R n -> z) -> z Source #

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

exactLength :: forall (n :: Nat) (m :: Nat). (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 :: Nat) (m :: Nat) (j :: Nat) (k :: Nat). (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 :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => L m n -> [R n] Source #

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

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

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

class Num t => Sized t s (d :: Type -> Type) | 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 Methods konst :: ℂ -> C n Source # unwrap :: C n -> Vector ℂ Source # fromList :: [ℂ] -> C n Source # extract :: C n -> Vector ℂ Source # create :: Vector ℂ -> Maybe (C n) Source # size :: C n -> IndexOf Vector Source #
KnownNat n => Sized ℝ (R n) Vector Source # |
Instance details Defined in Internal.Static Methods konst :: ℝ -> R n Source # unwrap :: R n -> Vector ℝ Source # fromList :: [ℝ] -> R n Source # extract :: R n -> Vector ℝ Source # create :: Vector ℝ -> Maybe (R n) Source # size :: R n -> IndexOf Vector 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 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 (L n n) (R n) Source # |
Instance details Defined in Numeric.LinearAlgebra.Static Methods takeDiag :: L n n -> R 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 #

data Sym (n :: Nat) Source #

#### Instances

Instances details

KnownNat n => Floating (Sym n) Source # |

Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

pi :: Sym n Source #

exp :: Sym n -> Sym n Source #

log :: Sym n -> Sym n Source #

sqrt :: Sym n -> Sym n Source #

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

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

sin :: Sym n -> Sym n Source #

cos :: Sym n -> Sym n Source #

tan :: Sym n -> Sym n Source #

asin :: Sym n -> Sym n Source #

acos :: Sym n -> Sym n Source #

atan :: Sym n -> Sym n Source #

sinh :: Sym n -> Sym n Source #

cosh :: Sym n -> Sym n Source #

tanh :: Sym n -> Sym n Source #

asinh :: Sym n -> Sym n Source #

acosh :: Sym n -> Sym n Source #

atanh :: Sym n -> Sym n Source #

log1p :: Sym n -> Sym n Source #

expm1 :: Sym n -> Sym n Source #

log1pexp :: Sym n -> Sym n Source #

log1mexp :: Sym n -> Sym n Source #

KnownNat n => Num (Sym n) Source # |
Instance details Defined in Numeric.LinearAlgebra.Static Methods (+) :: Sym n -> Sym n -> Sym n Source # (-) :: Sym n -> Sym n -> Sym n Source # (*) :: Sym n -> Sym n -> Sym n Source # negate :: Sym n -> Sym n Source # abs :: Sym n -> Sym n Source # signum :: Sym n -> Sym n Source # fromInteger :: Integer -> Sym n Source #
KnownNat n => Fractional (Sym n) Source # |
Instance details Defined in Numeric.LinearAlgebra.Static Methods (/) :: Sym n -> Sym n -> Sym n Source # recip :: Sym n -> Sym n Source # fromRational :: Rational -> Sym n Source #
KnownNat n => Show (Sym n) Source # |
Instance details Defined in Numeric.LinearAlgebra.Static Methods showsPrec :: Int -> Sym n -> ShowS Source # show :: Sym n -> String Source # showList :: [Sym n] -> ShowS Source #
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 :: forall (n :: Nat). KnownNat n => Sq n -> Sym n Source #

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

unSym :: forall (n :: Nat). Sym n -> Sq n Source #

(<·>) :: forall (n :: Nat). KnownNat n => R n -> R n -> ℝ infixr 8 Source #

# Orphan instances

KnownNat n => Normed (R n) Source # |
Instance details 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 # |
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 #