Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- module Data.Matrix.Static.LinearAlgebra.Types
- class Arithmetic (mat1 :: MatrixKind) (mat2 :: MatrixKind) where
- (@@) :: (Numeric a, SingI n, SingI m, If (mat1 == mat2) mat1 Matrix ~ mat3) => mat1 n p Vector a -> mat2 p m Vector a -> mat3 n m Vector a
- (%+%) :: (Numeric a, SingI n, SingI m, If (mat1 == mat2) mat1 Matrix ~ mat3) => mat1 n m Vector a -> mat2 n m Vector a -> mat3 n m Vector a
- (%-%) :: (Numeric a, SingI n, SingI m, If (mat1 == mat2) mat1 Matrix ~ mat3) => mat1 n m Vector a -> mat2 n m Vector a -> mat3 n m Vector a
- (%*%) :: (Numeric a, SingI n, SingI m, If (mat1 == mat2) mat1 SparseMatrix ~ mat3) => mat1 n m Vector a -> mat2 n m Vector a -> mat3 n m Vector a
- class Factorization mat where
- eigS :: (SingI k, SingI n, k <= (n - 2)) => Sing k -> mat n n Vector Double -> (Matrix k 1 (Complex Double), Matrix n k (Complex Double))
- eigSH :: (SingI k, SingI n, k <= (n - 1)) => Sing k -> mat n n Vector Double -> (Matrix k 1 Double, Matrix n k Double)
- cholesky :: (Numeric a, SingI n) => mat n n Vector a -> mat n n Vector a
- class LinearAlgebra (mat :: MatrixKind) where
- zeros :: (SingI m, SingI n) => Matrix m n Double
- ones :: (SingI m, SingI n) => Matrix m n Double
- inverse :: (SingI n, Numeric a) => Matrix n n a -> Matrix n n a
- eig :: forall n. SingI n => Matrix n n Double -> (Matrix n 1 (Complex Double), Matrix n n (Complex Double))
- svd :: forall n p a m. (Numeric (R a), Numeric a, SingI n, SingI p, SingI m, m ~ Min n p) => Matrix n p a -> (Matrix n m a, Matrix m 1 (R a), Matrix p m a)
- cond :: (Numeric a, Numeric (R a), Ord (R a), Fractional (R a), SingI n, SingI m, SingI (Min n m)) => Matrix n m a -> R a
Documentation
class Arithmetic (mat1 :: MatrixKind) (mat2 :: MatrixKind) where Source #
(@@) :: (Numeric a, SingI n, SingI m, If (mat1 == mat2) mat1 Matrix ~ mat3) => mat1 n p Vector a -> mat2 p m Vector a -> mat3 n m Vector a infixr 8 Source #
Matrix multiplication between different types of matrices.
(%+%) :: (Numeric a, SingI n, SingI m, If (mat1 == mat2) mat1 Matrix ~ mat3) => mat1 n m Vector a -> mat2 n m Vector a -> mat3 n m Vector a infixr 8 Source #
Element-wise addition between different types of matrices.
(%-%) :: (Numeric a, SingI n, SingI m, If (mat1 == mat2) mat1 Matrix ~ mat3) => mat1 n m Vector a -> mat2 n m Vector a -> mat3 n m Vector a infixr 8 Source #
Element-wise substraction between different types of matrices.
(%*%) :: (Numeric a, SingI n, SingI m, If (mat1 == mat2) mat1 SparseMatrix ~ mat3) => mat1 n m Vector a -> mat2 n m Vector a -> mat3 n m Vector a infixr 8 Source #
Element-wise multiplication between different types of matrices.
Instances
Arithmetic Matrix Matrix Source # | |
Defined in Data.Matrix.Static.LinearAlgebra (@@) :: (Numeric a, SingI n, SingI m, If (Matrix == Matrix) Matrix Matrix ~ mat3) => Matrix n p Vector a -> Matrix p m Vector a -> mat3 n m Vector a Source # (%+%) :: (Numeric a, SingI n, SingI m, If (Matrix == Matrix) Matrix Matrix ~ mat3) => Matrix n m Vector a -> Matrix n m Vector a -> mat3 n m Vector a Source # (%-%) :: (Numeric a, SingI n, SingI m, If (Matrix == Matrix) Matrix Matrix ~ mat3) => Matrix n m Vector a -> Matrix n m Vector a -> mat3 n m Vector a Source # (%*%) :: (Numeric a, SingI n, SingI m, If (Matrix == Matrix) Matrix SparseMatrix ~ mat3) => Matrix n m Vector a -> Matrix n m Vector a -> mat3 n m Vector a Source # | |
Arithmetic Matrix SparseMatrix Source # | |
Defined in Data.Matrix.Static.LinearAlgebra (@@) :: (Numeric a, SingI n, SingI m, If (Matrix == SparseMatrix) Matrix Matrix ~ mat3) => Matrix n p Vector a -> SparseMatrix p m Vector a -> mat3 n m Vector a Source # (%+%) :: (Numeric a, SingI n, SingI m, If (Matrix == SparseMatrix) Matrix Matrix ~ mat3) => Matrix n m Vector a -> SparseMatrix n m Vector a -> mat3 n m Vector a Source # (%-%) :: (Numeric a, SingI n, SingI m, If (Matrix == SparseMatrix) Matrix Matrix ~ mat3) => Matrix n m Vector a -> SparseMatrix n m Vector a -> mat3 n m Vector a Source # (%*%) :: (Numeric a, SingI n, SingI m, If (Matrix == SparseMatrix) Matrix SparseMatrix ~ mat3) => Matrix n m Vector a -> SparseMatrix n m Vector a -> mat3 n m Vector a Source # | |
Arithmetic SparseMatrix Matrix Source # | |
Defined in Data.Matrix.Static.LinearAlgebra (@@) :: (Numeric a, SingI n, SingI m, If (SparseMatrix == Matrix) SparseMatrix Matrix ~ mat3) => SparseMatrix n p Vector a -> Matrix p m Vector a -> mat3 n m Vector a Source # (%+%) :: (Numeric a, SingI n, SingI m, If (SparseMatrix == Matrix) SparseMatrix Matrix ~ mat3) => SparseMatrix n m Vector a -> Matrix n m Vector a -> mat3 n m Vector a Source # (%-%) :: (Numeric a, SingI n, SingI m, If (SparseMatrix == Matrix) SparseMatrix Matrix ~ mat3) => SparseMatrix n m Vector a -> Matrix n m Vector a -> mat3 n m Vector a Source # (%*%) :: (Numeric a, SingI n, SingI m, If (SparseMatrix == Matrix) SparseMatrix SparseMatrix ~ mat3) => SparseMatrix n m Vector a -> Matrix n m Vector a -> mat3 n m Vector a Source # | |
Arithmetic SparseMatrix SparseMatrix Source # | |
Defined in Data.Matrix.Static.LinearAlgebra (@@) :: (Numeric a, SingI n, SingI m, If (SparseMatrix == SparseMatrix) SparseMatrix Matrix ~ mat3) => SparseMatrix n p Vector a -> SparseMatrix p m Vector a -> mat3 n m Vector a Source # (%+%) :: (Numeric a, SingI n, SingI m, If (SparseMatrix == SparseMatrix) SparseMatrix Matrix ~ mat3) => SparseMatrix n m Vector a -> SparseMatrix n m Vector a -> mat3 n m Vector a Source # (%-%) :: (Numeric a, SingI n, SingI m, If (SparseMatrix == SparseMatrix) SparseMatrix Matrix ~ mat3) => SparseMatrix n m Vector a -> SparseMatrix n m Vector a -> mat3 n m Vector a Source # (%*%) :: (Numeric a, SingI n, SingI m, If (SparseMatrix == SparseMatrix) SparseMatrix SparseMatrix ~ mat3) => SparseMatrix n m Vector a -> SparseMatrix n m Vector a -> mat3 n m Vector a Source # |
class Factorization mat where Source #
eigS :: (SingI k, SingI n, k <= (n - 2)) => Sing k -> mat n n Vector Double -> (Matrix k 1 (Complex Double), Matrix n k (Complex Double)) Source #
Eigenvalues (from largest to smallest) and eigenvectors (as columns) of a general square matrix.
eigSH :: (SingI k, SingI n, k <= (n - 1)) => Sing k -> mat n n Vector Double -> (Matrix k 1 Double, Matrix n k Double) Source #
Eigenvalues (from largest to smallest) and eigenvectors (as columns) of a symmetric square matrix.
cholesky :: (Numeric a, SingI n) => mat n n Vector a -> mat n n Vector a Source #
Cholesky decomposition
Instances
Factorization Matrix Source # | |
Defined in Data.Matrix.Static.LinearAlgebra eigS :: (SingI k, SingI n, k <= (n - 2)) => Sing k -> Matrix n n Vector Double -> (Matrix0 k 1 (Complex Double), Matrix0 n k (Complex Double)) Source # eigSH :: (SingI k, SingI n, k <= (n - 1)) => Sing k -> Matrix n n Vector Double -> (Matrix0 k 1 Double, Matrix0 n k Double) Source # cholesky :: (Numeric a, SingI n) => Matrix n n Vector a -> Matrix n n Vector a Source # | |
Factorization SparseMatrix Source # | |
Defined in Data.Matrix.Static.LinearAlgebra eigS :: (SingI k, SingI n, k <= (n - 2)) => Sing k -> SparseMatrix n n Vector Double -> (Matrix k 1 (Complex Double), Matrix n k (Complex Double)) Source # eigSH :: (SingI k, SingI n, k <= (n - 1)) => Sing k -> SparseMatrix n n Vector Double -> (Matrix k 1 Double, Matrix n k Double) Source # cholesky :: (Numeric a, SingI n) => SparseMatrix n n Vector a -> SparseMatrix n n Vector a Source # |
class LinearAlgebra (mat :: MatrixKind) where Source #
ident :: (Numeric a, SingI n) => mat n n Vector a Source #
colSum :: (Numeric a, SingI n, Matrix mat Vector a) => mat m n Vector a -> Matrix 1 n a Source #
rowSum :: (Numeric a, SingI m, Matrix mat Vector a) => mat m n Vector a -> Matrix m 1 a Source #
Instances
LinearAlgebra Matrix Source # | |
Defined in Data.Matrix.Static.LinearAlgebra | |
LinearAlgebra SparseMatrix Source # | |
Defined in Data.Matrix.Static.LinearAlgebra ident :: (Numeric a, SingI n) => SparseMatrix n n Vector a Source # colSum :: (Numeric a, SingI n, Matrix SparseMatrix Vector a) => SparseMatrix m n Vector a -> Matrix 1 n a Source # rowSum :: (Numeric a, SingI m, Matrix SparseMatrix Vector a) => SparseMatrix m n Vector a -> Matrix m 1 a Source # |
Dense matrix operation
inverse :: (SingI n, Numeric a) => Matrix n n a -> Matrix n n a Source #
The inverse of a dense matrix.
eig :: forall n. SingI n => Matrix n n Double -> (Matrix n 1 (Complex Double), Matrix n n (Complex Double)) Source #
Compute the full eigendecomposition for dense matrix.