License | BSD3 |
---|---|
Maintainer | marcin.jan.mrotek@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
- Typeclasses
- Shape-polymorphic conversion
- Data types
- Special types
- Dot product
- Dense matrix-vector product.
- Dense matrix-matrix product.
- Vector outer product.
- Kronecker product.
- Cross product.
- Sum of elements.
- Product of elements.
- Linear systems.
- Inverse and pseudoinverse
- Determinant and rank
- Norms
- Nullspace and range
- SVD
- Eigensystems
- QR
- Cholesky
- Hessenberg
- Schur
- LU
- Symmetric indefinite
- Matrix functions
- Correlation and convolution
- Random vectors and matrices
- Misc
HMatrix linear algebra functions wrapped to accept Repa arrays.
- class (Container Vector t, Container Matrix t, Konst t Int Vector, Konst t (Int, Int) Matrix, CTrans t, Product t, Additive (Vector t), Additive (Matrix t), Linear t Vector, Linear t Matrix) => Numeric t
- class (Numeric t, Convert t, Normed Matrix t, Normed Vector t, Floating t, Linear t Vector, Linear t Matrix, Additive (Vector t), Additive (Matrix t), (~) * (RealOf t) Double) => Field t
- class (Num e, Element e) => Product e
- class LSDiv c
- class HShape sh where
- type HType sh :: * -> *
- toRepa :: Numeric t => HType sh t -> Array F sh t
- fromRepa :: Numeric t => Array F sh t -> HType sh t
- fromRepaS :: Numeric t => Array D sh t -> HType sh t
- fromRepaSIO :: Numeric t => Array D sh t -> IO (HType sh t)
- fromRepaP :: (Numeric t, Monad m) => Array D sh t -> m (HType sh t)
- fromRepaPIO :: Numeric t => Array D sh t -> IO (HType sh t)
- data Vector a :: * -> *
- data Matrix t :: * -> *
- data RandDist :: *
- type Seed = Int
- data Herm t :: * -> *
- data LU t :: * -> *
- data LDL t :: * -> *
- dot :: Numeric t => Array F DIM1 t -> Array F DIM1 t -> t
- dotS :: Numeric t => Array D DIM1 t -> Array D DIM1 t -> t
- dotSIO :: Numeric t => Array D DIM1 t -> Array D DIM1 t -> IO t
- dotP :: (Numeric t, Monad m) => Array D DIM1 t -> Array D DIM1 t -> m t
- dotPIO :: Numeric t => Array D DIM1 t -> Array D DIM1 t -> IO t
- app :: Numeric t => Array F DIM2 t -> Array F DIM1 t -> Array F DIM1 t
- appS :: Numeric t => Array D DIM2 t -> Array D DIM1 t -> Array F DIM1 t
- appSIO :: Numeric t => Array D DIM2 t -> Array D DIM1 t -> IO (Array F DIM1 t)
- appP :: (Numeric t, Monad m) => Array D DIM2 t -> Array D DIM1 t -> m (Array F DIM1 t)
- appPIO :: Numeric t => Array D DIM2 t -> Array D DIM1 t -> IO (Array F DIM1 t)
- mul :: Numeric t => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t
- mulS :: Numeric t => Array D DIM2 t -> Array D DIM2 t -> Array F DIM2 t
- mulSIO :: Numeric t => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- mulP :: (Numeric t, Monad m) => Array D DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t)
- mulPIO :: Numeric t => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- outer :: (Product t, Numeric t) => Array F DIM1 t -> Array F DIM1 t -> Array F DIM2 t
- outerS :: (Product t, Numeric t) => Array D DIM1 t -> Array D DIM1 t -> Array F DIM2 t
- outerSIO :: (Product t, Numeric t) => Array D DIM1 t -> Array D DIM1 t -> IO (Array F DIM2 t)
- outerP :: (Product t, Numeric t, Monad m) => Array D DIM1 t -> Array D DIM1 t -> m (Array F DIM2 t)
- outerPIO :: (Product t, Numeric t) => Array D DIM1 t -> Array D DIM1 t -> IO (Array F DIM2 t)
- kronecker :: (Product t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t
- kroneckerS :: (Product t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> Array F DIM2 t
- kroneckerSIO :: (Product t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- kroneckerP :: (Product t, Numeric t, Monad m) => Array D DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t)
- kroneckerPIO :: (Product t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- cross :: Array F DIM1 Double -> Array F DIM1 Double -> Array F DIM1 Double
- crossS :: Array D DIM1 Double -> Array D DIM1 Double -> Array F DIM1 Double
- crossSIO :: Array D DIM1 Double -> Array D DIM1 Double -> IO (Array F DIM1 Double)
- sumElements :: (Numeric t, HShape sh, Container (HType sh) t) => Array F sh t -> t
- sumElementsS :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> t
- sumElementsSIO :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> IO t
- sumElementsP :: (Numeric t, HShape sh, Container (HType sh) t, Monad m) => Array D sh t -> m t
- sumElementsPIO :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> IO t
- prodElements :: (Numeric t, HShape sh, Container (HType sh) t) => Array F sh t -> t
- prodElementsS :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> t
- prodElementsSIO :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> IO t
- prodElementsP :: (Numeric t, HShape sh, Container (HType sh) t, Monad m) => Array D sh t -> m t
- prodElementsPIO :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> IO t
- (<\>) :: (Field t, Numeric t, HShape sh, LSDiv (HType sh)) => Array F DIM2 t -> Array F sh t -> Array F sh t
- solve :: (Field t, Numeric t, HShape sh, LSDiv (HType sh)) => Array F DIM2 t -> Array F sh t -> Array F sh t
- solveS :: (Field t, Numeric t, HShape sh, LSDiv (HType sh)) => Array D DIM2 t -> Array D sh t -> Array F sh t
- solveSIO :: (Field t, Numeric t, HShape sh, LSDiv (HType sh)) => Array D DIM2 t -> Array D sh t -> IO (Array F sh t)
- solveP :: (Field t, Numeric t, HShape sh, LSDiv (HType sh), Monad m) => Array D DIM2 t -> Array D sh t -> m (Array F sh t)
- solvePIO :: (Field t, Numeric t, HShape sh, LSDiv (HType sh)) => Array D DIM2 t -> Array D sh t -> IO (Array F sh t)
- linearSolve :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Maybe (Array F DIM2 t)
- linearSolveS :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> Maybe (Array F DIM2 t)
- linearSolveSIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Maybe (Array F DIM2 t))
- linearSolveP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> Array D DIM2 t -> m (Maybe (Array F DIM2 t))
- linearSolvePIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Maybe (Array F DIM2 t))
- linearSolveLS :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t
- linearSolveLS_S :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> Array F DIM2 t
- linearSolveLS_SIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- linearSolveLS_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t)
- linearSolveLS_PIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- linearSolveSVD :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t
- linearSolveSVD_S :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> Array F DIM2 t
- linearSolveSVD_SIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- linearSolveSVD_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t)
- linearSolveSVD_PIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- luSolve :: (Field t, Numeric t) => LU t -> Array F DIM2 t -> Array F DIM2 t
- luSolveS :: (Field t, Numeric t) => LU t -> Array D DIM2 t -> Array F DIM2 t
- luSolveSIO :: (Field t, Numeric t) => LU t -> Array D DIM2 t -> IO (Array F DIM2 t)
- luSolveP :: (Field t, Numeric t, Monad m) => LU t -> Array D DIM2 t -> m (Array F DIM2 t)
- luSolvePIO :: (Field t, Numeric t) => LU t -> Array D DIM2 t -> IO (Array F DIM2 t)
- cholSolve :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t
- cholSolveS :: (Field t, Numeric t) => Array F DIM2 t -> Array D DIM2 t -> Array F DIM2 t
- cholSolveSIO :: (Field t, Numeric t) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- cholSolveP :: (Field t, Numeric t, Monad m) => Array F DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t)
- cholSolvePIO :: (Field t, Numeric t) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- inv :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t
- invS :: (Field t, Numeric t) => Array D DIM2 t -> Array F DIM2 t
- invSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- invP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t)
- invPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- pinv :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t
- pinvS :: (Field t, Numeric t) => Array D DIM2 t -> Array F DIM2 t
- pinvSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- pinvP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t)
- pinvPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- pinvTol :: (Field t, Numeric t) => Double -> Array F DIM2 t -> Array F DIM2 t
- pinvTolS :: (Field t, Numeric t) => Double -> Array D DIM2 t -> Array F DIM2 t
- pinvTolSIO :: (Field t, Numeric t) => Double -> Array D DIM2 t -> IO (Array F DIM2 t)
- pinvTolP :: (Field t, Numeric t, Monad m) => Double -> Array D DIM2 t -> m (Array F DIM2 t)
- pinvTolPIO :: (Field t, Numeric t) => Double -> Array D DIM2 t -> IO (Array F DIM2 t)
- rcond :: (Field t, Numeric t) => Array F DIM2 t -> Double
- rcondS :: (Field t, Numeric t) => Array D DIM2 t -> Double
- rcondSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO Double
- rcondP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m Double
- rcondPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO Double
- rank :: (Field t, Numeric t) => Array F DIM2 t -> Int
- rankS :: (Field t, Numeric t) => Array D DIM2 t -> Int
- rankSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO Int
- rankP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m Int
- rankPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO Int
- det :: (Field t, Numeric t) => Array F DIM2 t -> t
- detS :: (Field t, Numeric t) => Array D DIM2 t -> t
- detSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO t
- detP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m t
- detPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO t
- invlndet :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, (t, t))
- invlndetS :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, (t, t))
- invlndetSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, (t, t))
- invlndetP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, (t, t))
- invlndetPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, (t, t))
- norm_Frob :: (Normed (Vector t), Element t) => Array F DIM2 t -> Double
- norm_FrobS :: (Normed (Vector t), Element t) => Array D DIM2 t -> Double
- norm_FrobSIO :: (Normed (Vector t), Element t) => Array D DIM2 t -> IO Double
- norm_FrobP :: (Normed (Vector t), Element t, Monad m) => Array D DIM2 t -> m Double
- norm_FrobPIO :: (Normed (Vector t), Element t) => Array D DIM2 t -> IO Double
- norm_nuclear :: (Field t, Numeric t) => Array F DIM2 t -> Double
- norm_nuclearS :: (Field t, Numeric t) => Array D DIM2 t -> Double
- norm_nuclearSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO Double
- norm_nuclearP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m Double
- norm_nuclearPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO Double
- orth :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t
- orthS :: (Field t, Numeric t) => Array D DIM2 t -> Array F DIM2 t
- orthSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- orthP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t)
- orthPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- nullspace :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t
- nullspaceS :: (Field t, Numeric t) => Array D DIM2 t -> Array F DIM2 t
- nullspaceSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- nullspaceP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t)
- nullspacePIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- null1 :: Array F DIM2 Double -> Array F DIM1 Double
- null1S :: Array D DIM2 Double -> Array F DIM1 Double
- null1SIO :: Array D DIM2 Double -> IO (Array F DIM1 Double)
- null1P :: Monad m => Array D DIM2 Double -> m (Array F DIM1 Double)
- null1PIO :: Array D DIM2 Double -> IO (Array F DIM1 Double)
- null1sym :: Herm Double -> Array F DIM1 Double
- svd :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- svdS :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- svdSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- svdP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- svdPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- thinSVD :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- thinSVD_S :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- thinSVD_SIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- thinSVD_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- thinSVD_PIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- compactSVD :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- compactSVD_S :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- compactSVD_SIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- compactSVD_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- compactSVD_PIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t)
- singularValues :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM1 Double
- singularValuesS :: (Field t, Numeric t) => Array D DIM2 t -> Array F DIM1 Double
- singularValuesSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 Double)
- singularValuesP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM1 Double)
- singularValuesPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 Double)
- leftSV :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM1 Double)
- leftSV_S :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM1 Double)
- leftSV_SIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double)
- leftSV_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM1 Double)
- leftSV_PIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double)
- rightSV :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM1 Double, Array F DIM2 t)
- rightSV_S :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM1 Double, Array F DIM2 t)
- rightSV_SIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 Double, Array F DIM2 t)
- rightSV_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM1 Double, Array F DIM2 t)
- rightSV_PIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 Double, Array F DIM2 t)
- eig :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM1 (Complex Double), Array F DIM2 (Complex Double))
- eigS :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM1 (Complex Double), Array F DIM2 (Complex Double))
- eigSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 (Complex Double), Array F DIM2 (Complex Double))
- eigP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM1 (Complex Double), Array F DIM2 (Complex Double))
- eigPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 (Complex Double), Array F DIM2 (Complex Double))
- eigSH :: (Field t, Numeric t) => Herm t -> (Array F DIM1 Double, Array F DIM2 t)
- eigenvalues :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM1 (Complex Double)
- eigenvaluesS :: (Field t, Numeric t) => Array D DIM2 t -> Array F DIM1 (Complex Double)
- eigenvaluesSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 (Complex Double))
- eigenvaluesP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM1 (Complex Double))
- eigenvaluesPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 (Complex Double))
- eigenvaluesSH :: (Field t, Numeric t) => Herm t -> Array F DIM1 Double
- geigSH :: (Field t, Numeric t) => Herm t -> Herm t -> (Array F DIM1 Double, Array F DIM2 t)
- qr :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t)
- qrS :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM2 t)
- qrSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t)
- qrP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM2 t)
- qrPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t)
- rq :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t)
- rqS :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM2 t)
- rqSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t)
- rqP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM2 t)
- rqPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t)
- qrRaw :: (Field t, Numeric t) => Array F DIM2 t -> QR t
- qrRawS :: (Field t, Numeric t) => Array D DIM2 t -> QR t
- qrRawSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (QR t)
- qrRawP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (QR t)
- qrRawPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (QR t)
- qrgr :: (Field t, Numeric t) => Int -> QR t -> Array F DIM2 t
- chol :: Field t => Herm t -> Array F DIM2 t
- mbChol :: Field t => Herm t -> Maybe (Array F DIM2 t)
- hess :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t)
- hessS :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM2 t)
- hessSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t)
- hessP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM2 t)
- hessPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t)
- schur :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t)
- schurS :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM2 t)
- schurSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t)
- schurP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM2 t)
- schurPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t)
- lu :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t)
- luS :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t)
- luSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t)
- luP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t)
- luPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t)
- luPacked :: (Field t, Numeric t) => Array F DIM2 t -> LU t
- luPackedS :: (Field t, Numeric t) => Array D DIM2 t -> LU t
- luPackedSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (LU t)
- luPackedP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (LU t)
- luPackedPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (LU t)
- luFact :: Numeric t => LU t -> (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t)
- ldlSolve :: Field t => LDL t -> Array F DIM2 t -> Array F DIM2 t
- ldlSolveS :: Field t => LDL t -> Array D DIM2 t -> Array F DIM2 t
- ldlSolveSIO :: Field t => LDL t -> Array D DIM2 t -> IO (Array F DIM2 t)
- ldlSolveP :: (Field t, Monad m) => LDL t -> Array D DIM2 t -> m (Array F DIM2 t)
- ldlSolvePIO :: Field t => LDL t -> Array D DIM2 t -> IO (Array F DIM2 t)
- ldlPacked :: Field t => Herm t -> LDL t
- expm :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t
- expmS :: (Field t, Numeric t) => Array D DIM2 t -> Array F DIM2 t
- expmSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- expmP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t)
- expmPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- sqrtm :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t
- sqrtmS :: (Field t, Numeric t) => Array D DIM2 t -> Array F DIM2 t
- sqrtmSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- sqrtmP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t)
- sqrtmPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t)
- matFunc :: (Complex Double -> Complex Double) -> Array F DIM2 (Complex Double) -> Array F DIM2 (Complex Double)
- matFuncS :: (Complex Double -> Complex Double) -> Array D DIM2 (Complex Double) -> Array F DIM2 (Complex Double)
- matFuncSIO :: (Complex Double -> Complex Double) -> Array D DIM2 (Complex Double) -> IO (Array F DIM2 (Complex Double))
- matFuncP :: Monad m => (Complex Double -> Complex Double) -> Array D DIM2 (Complex Double) -> m (Array F DIM2 (Complex Double))
- matFuncPIO :: (Complex Double -> Complex Double) -> Array D DIM2 (Complex Double) -> IO (Array F DIM2 (Complex Double))
- corr :: (Product t, Numeric t) => Array F DIM1 t -> Array F DIM1 t -> Array F DIM1 t
- corrS :: (Product t, Numeric t) => Array F DIM1 t -> Array D DIM1 t -> Array F DIM1 t
- corrSIO :: (Product t, Numeric t) => Array F DIM1 t -> Array D DIM1 t -> IO (Array F DIM1 t)
- corrP :: (Product t, Numeric t, Monad m) => Array F DIM1 t -> Array D DIM1 t -> m (Array F DIM1 t)
- corrPIO :: (Product t, Numeric t) => Array F DIM1 t -> Array D DIM1 t -> IO (Array F DIM1 t)
- conv :: (Product t, Numeric t) => Array F DIM1 t -> Array F DIM1 t -> Array F DIM1 t
- convS :: (Product t, Numeric t) => Array F DIM1 t -> Array D DIM1 t -> Array F DIM1 t
- convSIO :: (Product t, Numeric t) => Array F DIM1 t -> Array D DIM1 t -> IO (Array F DIM1 t)
- convP :: (Product t, Numeric t, Monad m) => Array F DIM1 t -> Array D DIM1 t -> m (Array F DIM1 t)
- convPIO :: (Product t, Numeric t) => Array F DIM1 t -> Array D DIM1 t -> IO (Array F DIM1 t)
- corrMin :: (Product t, Numeric t, RealElement t) => Array F DIM1 t -> Array F DIM1 t -> Array F DIM1 t
- corrMinS :: (Product t, Numeric t, RealElement t) => Array F DIM1 t -> Array D DIM1 t -> Array F DIM1 t
- corrMinSIO :: (Product t, Numeric t, RealElement t) => Array F DIM1 t -> Array D DIM1 t -> IO (Array F DIM1 t)
- corrMinP :: (Product t, Numeric t, RealElement t, Monad m) => Array F DIM1 t -> Array D DIM1 t -> m (Array F DIM1 t)
- corrMinPIO :: (Product t, Numeric t, RealElement t) => Array F DIM1 t -> Array D DIM1 t -> IO (Array F DIM1 t)
- corr2 :: (Product t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t
- corr2S :: (Product t, Numeric t) => Array F DIM2 t -> Array D DIM2 t -> Array F DIM2 t
- corr2SIO :: (Product t, Numeric t) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- corr2P :: (Product t, Numeric t, Monad m) => Array F DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t)
- corr2PIO :: (Product t, Numeric t) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- conv2 :: (Product t, Numeric t, Num (Vector t)) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t
- conv2S :: (Product t, Numeric t, Num (Vector t)) => Array F DIM2 t -> Array D DIM2 t -> Array F DIM2 t
- conv2SIO :: (Product t, Numeric t, Num (Vector t)) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- conv2P :: (Product t, Numeric t, Num (Vector t), Monad m) => Array F DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t)
- conv2PIO :: (Product t, Numeric t, Num (Vector t)) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t)
- randomVector :: Seed -> RandDist -> Int -> Array F DIM1 Double
- randomMatrix :: RandDist -> Int -> Int -> IO (Array F DIM2 Double)
- gaussianSample :: Seed -> Int -> Array F DIM1 Double -> Array F DIM2 Double -> Array F DIM2 Double
- uniformSample :: Seed -> Int -> [(Double, Double)] -> Array F DIM2 Double
- meanCov :: Array F DIM2 Double -> (Array F DIM1 Double, Array F DIM2 Double)
- rowOuters :: Array F DIM2 Double -> Array F DIM2 Double -> Array F DIM2 Double
- sym :: Field t => Array F DIM2 t -> Herm t
- symS :: Field t => Array D DIM2 t -> Herm t
- symSIO :: Field t => Array D DIM2 t -> IO (Herm t)
- symP :: (Field t, Monad m) => Array D DIM2 t -> m (Herm t)
- symPIO :: Field t => Array D DIM2 t -> IO (Herm t)
- mTm :: Field t => Array F DIM2 t -> Herm t
- mTmS :: Field t => Array D DIM2 t -> Herm t
- mTmSIO :: Field t => Array D DIM2 t -> IO (Herm t)
- mTmP :: (Field t, Monad m) => Array D DIM2 t -> m (Herm t)
- mTmPIO :: Field t => Array D DIM2 t -> IO (Herm t)
- trustSym :: Field t => Array F DIM2 t -> Herm t
- trustSymS :: Field t => Array D DIM2 t -> Herm t
- trustSymSIO :: Field t => Array D DIM2 t -> IO (Herm t)
- trustSymP :: (Field t, Monad m) => Array D DIM2 t -> m (Herm t)
- trustSymPIO :: Field t => Array D DIM2 t -> IO (Herm t)
- unSym :: Numeric t => Herm t -> Array F DIM2 t
Typeclasses
class (Container Vector t, Container Matrix t, Konst t Int Vector, Konst t (Int, Int) Matrix, CTrans t, Product t, Additive (Vector t), Additive (Matrix t), Linear t Vector, Linear t Matrix) => Numeric t
class (Numeric t, Convert t, Normed Matrix t, Normed Vector t, Floating t, Linear t Vector, Linear t Matrix, Additive (Vector t), Additive (Matrix t), (~) * (RealOf t) Double) => Field t
Generic linear algebra functions for double precision real and complex matrices.
(Single precision data can be converted using single
and double
).
svd', thinSVD', sv', luPacked', luSolve', mbLinearSolve', linearSolve', cholSolve', ldlPacked', ldlSolve', linearSolveSVD', linearSolveLS', eig', eigSH'', eigOnly, eigOnlySH, cholSH', mbCholSH', qr', qrgr', hess', schur'
class (Num e, Element e) => Product e
Matrix product and related functions
multiply, absSum, norm1, norm2, normInf
Shape-polymorphic conversion
Shape-polymorphic conversion.
toRepa :: Numeric t => HType sh t -> Array F sh t Source
fromRepa :: Numeric t => Array F sh t -> HType sh t Source
fromRepaS :: Numeric t => Array D sh t -> HType sh t Source
fromRepaSIO :: Numeric t => Array D sh t -> IO (HType sh t) Source
fromRepaP :: (Numeric t, Monad m) => Array D sh t -> m (HType sh t) Source
fromRepaPIO :: Numeric t => Array D sh t -> IO (HType sh t) Source
Data types
data Vector a :: * -> *
Storable
-based vectors
data Matrix t :: * -> *
Matrix representation suitable for BLAS/LAPACK computations.
LSDiv Matrix | |
Complexable Matrix | |
Normed Matrix Double | |
Normed Matrix Float | |
(Num a, Element a, Container Vector a) => Container Matrix a | |
Container Matrix t => Linear t Matrix | |
Mul Matrix Matrix Matrix | |
Mul Matrix Vector Vector | |
Mul Vector Matrix Vector | |
Normed Matrix (Complex Double) | |
Normed Matrix (Complex Float) | |
(Num e, Container Vector e) => Konst e (Int, Int) Matrix | |
(Storable t, NFData t) => NFData (Matrix t) | |
Normed (Matrix R) | |
Normed (Matrix C) | |
Container Matrix t => Additive (Matrix t) | |
KnownNat m => Testable (Matrix (Mod m I)) | |
Storable t => TransArray (Matrix t) | |
Element t => Indexable (Matrix t) (Vector t) | |
(CTrans t, Container Vector t) => Transposable (Matrix t) (Matrix t) | |
Container Matrix e => Build (Int, Int) (e -> e -> e) Matrix e | |
type IndexOf Matrix = (Int, Int) | |
type ArgOf Matrix a = a -> a -> a | |
type ElementOf (Matrix a) = a | |
type TransRaw (Matrix t) b = CInt -> CInt -> Ptr t -> b | |
type Trans (Matrix t) b = CInt -> CInt -> CInt -> CInt -> Ptr t -> b |
data RandDist :: *
Special types
data Herm t :: * -> *
data LU t :: * -> *
LU decomposition of a matrix in a compact format.
data LDL t :: * -> *
LDL decomposition of a complex Hermitian or real symmetric matrix in a compact format.
Dot product
dotS :: Numeric t => Array D DIM1 t -> Array D DIM1 t -> t Source
Vector dot product. Arguments computed sequentially.
dotSIO :: Numeric t => Array D DIM1 t -> Array D DIM1 t -> IO t Source
Vector dot product. Arguments computed sequentially inside the IO monad.
dotP :: (Numeric t, Monad m) => Array D DIM1 t -> Array D DIM1 t -> m t Source
Vector dot product. Arguments computed in parallel.
dotPIO :: Numeric t => Array D DIM1 t -> Array D DIM1 t -> IO t Source
Vector dot product. Arguments computed in parallel inside the IO monad.
Dense matrix-vector product.
app :: Numeric t => Array F DIM2 t -> Array F DIM1 t -> Array F DIM1 t Source
Dense matrix-vector product.
appS :: Numeric t => Array D DIM2 t -> Array D DIM1 t -> Array F DIM1 t Source
Dense matrix-vector product. Arguments computed sequentially.
appSIO :: Numeric t => Array D DIM2 t -> Array D DIM1 t -> IO (Array F DIM1 t) Source
Dense matrix-vector product. Arguments computed sequentially inside the IO monad.
appP :: (Numeric t, Monad m) => Array D DIM2 t -> Array D DIM1 t -> m (Array F DIM1 t) Source
Dense matrix-vector product. Arguments computed in parallel.
appPIO :: Numeric t => Array D DIM2 t -> Array D DIM1 t -> IO (Array F DIM1 t) Source
Dense matrix-vector product. Arguments computed in parallel inside the IO monad.
Dense matrix-matrix product.
mul :: Numeric t => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t Source
Dense matrix-matrix product.
mulS :: Numeric t => Array D DIM2 t -> Array D DIM2 t -> Array F DIM2 t Source
Dense matrix-matrix product. Arguments computed sequentially.
mulSIO :: Numeric t => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
Dense matrix-matrix product. Arguments computed sequentially inside the IO monad
mulP :: (Numeric t, Monad m) => Array D DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t) Source
Dense matrix-matrix product. Arguments computed in parallel.
mulPIO :: Numeric t => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
Dense matrix-matrix product. Arguments computed in parallel inside the IO monad
Vector outer product.
outer :: (Product t, Numeric t) => Array F DIM1 t -> Array F DIM1 t -> Array F DIM2 t Source
Outer product of two vectors.
outerS :: (Product t, Numeric t) => Array D DIM1 t -> Array D DIM1 t -> Array F DIM2 t Source
Outer product of two vectors. Arguments computed sequentially.
outerSIO :: (Product t, Numeric t) => Array D DIM1 t -> Array D DIM1 t -> IO (Array F DIM2 t) Source
Outer product of two vectors. Arguments computed sequentially inside the IO monad.
outerP :: (Product t, Numeric t, Monad m) => Array D DIM1 t -> Array D DIM1 t -> m (Array F DIM2 t) Source
Outer product of two vectors. Arguments computed in parallel.
outerPIO :: (Product t, Numeric t) => Array D DIM1 t -> Array D DIM1 t -> IO (Array F DIM2 t) Source
Outer product of two vectors. Arguments computed in parallel inside the IO monad.
Kronecker product.
kronecker :: (Product t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t Source
Kronecker product of two matrices.
kroneckerS :: (Product t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> Array F DIM2 t Source
Kronecker product of two matrices. Arguments computed sequentially.
kroneckerSIO :: (Product t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
Kronecker product of two matrices. Arguments computed sequentially inside the IO monad.
kroneckerP :: (Product t, Numeric t, Monad m) => Array D DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t) Source
Kronecker product of two matrices. Arguments computed in parallel.
kroneckerPIO :: (Product t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
Kronecker product of two matrices. Arguments computed in parallel inside the IO monad.
Cross product.
cross :: Array F DIM1 Double -> Array F DIM1 Double -> Array F DIM1 Double Source
Vector cross product.
crossS :: Array D DIM1 Double -> Array D DIM1 Double -> Array F DIM1 Double Source
Vector cross product. Arguments computed sequentially.
crossSIO :: Array D DIM1 Double -> Array D DIM1 Double -> IO (Array F DIM1 Double) Source
Vector cross product. Arguments computed sequentially inside the IO monad.
Sum of elements.
sumElements :: (Numeric t, HShape sh, Container (HType sh) t) => Array F sh t -> t Source
Sum elements of a matrix or a vector.
sumElementsS :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> t Source
Sum elements of a matrix or a vector. Argument computed sequentially.
sumElementsSIO :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> IO t Source
Sum elements of a matrix or a vector. Argument computed sequentially in the IO monad.
sumElementsP :: (Numeric t, HShape sh, Container (HType sh) t, Monad m) => Array D sh t -> m t Source
Sum elements of a matrix or a vector. Argument computed in parallel.
sumElementsPIO :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> IO t Source
Sum elements of a matrix or a vector. Argument computed in parallel in the IO monad.
Product of elements.
prodElements :: (Numeric t, HShape sh, Container (HType sh) t) => Array F sh t -> t Source
Multiply elements of a matrix or a vector.
prodElementsS :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> t Source
Multiply elements of a matrix or a vector. Argument computed sequentially.
prodElementsSIO :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> IO t Source
Multiply elements of a matrix or a vector. Argument computed sequentially inside the IO monad.
prodElementsP :: (Numeric t, HShape sh, Container (HType sh) t, Monad m) => Array D sh t -> m t Source
Multiply elements of a matrix or a vector. Argument computed in parallel.
prodElementsPIO :: (Numeric t, HShape sh, Container (HType sh) t) => Array D sh t -> IO t Source
Multiply elements of a matrix or a vector. Argument computed in parallel inside the IO monad.
Linear systems.
(<\>) :: (Field t, Numeric t, HShape sh, LSDiv (HType sh)) => Array F DIM2 t -> Array F sh t -> Array F sh t Source
Infix alias for solve
.
solve :: (Field t, Numeric t, HShape sh, LSDiv (HType sh)) => Array F DIM2 t -> Array F sh t -> Array F sh t Source
Least squares solution of a linear system, similar to the operator of Matlab/Octave (based on linearSolveSD).
solveS :: (Field t, Numeric t, HShape sh, LSDiv (HType sh)) => Array D DIM2 t -> Array D sh t -> Array F sh t Source
Least squares solution of a linear system, similar to the operator of Matlab/Octave (based on linearSolveSD). Arguments are computed sequentially.
solveSIO :: (Field t, Numeric t, HShape sh, LSDiv (HType sh)) => Array D DIM2 t -> Array D sh t -> IO (Array F sh t) Source
Least squares solution of a linear system, similar to the operator of Matlab/Octave (based on linearSolveSD). Arguments are computed sequentially inside the IO monad.
solveP :: (Field t, Numeric t, HShape sh, LSDiv (HType sh), Monad m) => Array D DIM2 t -> Array D sh t -> m (Array F sh t) Source
Least squares solution of a linear system, similar to the operator of Matlab/Octave (based on linearSolveSD). Arguments are computed in parallel.
solvePIO :: (Field t, Numeric t, HShape sh, LSDiv (HType sh)) => Array D DIM2 t -> Array D sh t -> IO (Array F sh t) Source
Least squares solution of a linear system, similar to the operator of Matlab/Octave (based on linearSolveSD). Arguments are computed in parallel inside the IO monad.
linearSolve :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Maybe (Array F DIM2 t) Source
Solve a linear system (for square coefficient matrix and several right hand sides) using the LU decomposition, returning Nothing for a singular system. For underconstrained or overconstrained systems use linearSolveLS
or linearSolveSVD
.
linearSolveS :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> Maybe (Array F DIM2 t) Source
Solve a linear system using the LU decomposition. Arguments computed sequentially.
linearSolveSIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Maybe (Array F DIM2 t)) Source
Solve a linear system using the LU decomposition. Arguments computed sequentially inside the IO monad.
linearSolveP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> Array D DIM2 t -> m (Maybe (Array F DIM2 t)) Source
Solve a linear system using the LU decomposition. Arguments computed in parallel.
linearSolvePIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Maybe (Array F DIM2 t)) Source
Solve a linear system using the LU decomposition. Arguments computed in parallel inside the IO monad.
linearSolveLS :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t Source
Least squared error solution of an overcompensated system, or the minimum norm solution of an undercompensated system. For rank-deficient systems use linearSolveSVD
.
linearSolveLS_S :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> Array F DIM2 t Source
linearSolveLS_SIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
linearSolveLS_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t) Source
linearSolveLS_PIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
linearSolveSVD :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t Source
Minimum norm solution of a general linear least squares problem Ax=b using the SVD. Admits rank-deficient systems but is slower than linearSolveLS
. The effective rank of A is determined by treating as zero those singular values which are less than eps times the largest singular value.
linearSolveSVD_S :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> Array F DIM2 t Source
linearSolveSVD_SIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
linearSolveSVD_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t) Source
linearSolveSVD_PIO :: (Field t, Numeric t) => Array D DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
luSolve :: (Field t, Numeric t) => LU t -> Array F DIM2 t -> Array F DIM2 t Source
Solution of a linear system (for several right hand sides) from the precomputed LU factorization obtained by luPacked
.
cholSolve :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t Source
Solve a symmetric or Herimitian positive definite linear system using a precomputed Cholesky decomposition obtained by chol
.
cholSolveSIO :: (Field t, Numeric t) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
cholSolveP :: (Field t, Numeric t, Monad m) => Array F DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t) Source
cholSolvePIO :: (Field t, Numeric t) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
Inverse and pseudoinverse
pinv :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t Source
Pseudoinverse of a general matrix, with default tolerance (pinvTol
1, similar to GNU-Octave)
pinvTol :: (Field t, Numeric t) => Double -> Array F DIM2 t -> Array F DIM2 t Source
pinvTol r computes the pseudoinverse of a matrix with tolerance tol=r*g*eps*(max rows cols), where g is the greatest singular value.
Determinant and rank
rcond :: (Field t, Numeric t) => Array F DIM2 t -> Double Source
Reciprocal of the 2-norm condition number of a matrix, computed from the singular values.
rank :: (Field t, Numeric t) => Array F DIM2 t -> Int Source
Number of linearly independent rows or columns. See also ranksv
.
det :: (Field t, Numeric t) => Array F DIM2 t -> t Source
Determinant of a square matrix. To avoid possible overflow or underflow use invlndet
.
Norms
Nullspace and range
orth :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t Source
An orthonormal basis of the range space of a matrix. See also orthSVD
.
nullspace :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t Source
An orthonormal basis of the null space of a matrix. See also nullspaceSVD
.
null1 :: Array F DIM2 Double -> Array F DIM1 Double Source
Solution of an overconstrained homogenous linear system.
null1sym :: Herm Double -> Array F DIM1 Double Source
Solution of an overconstrained homogenous symmetric linear system.
SVD
svd :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
Full singular value decomposition.
svdS :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
svdSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
svdP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
svdPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
thinSVD :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
A version of svd
which returns only the min (rows m) (cols m) singular vectors of m. (u,s,v) = thinSVD m ==> m == u * diag s * tr v
thinSVD_S :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
thinSVD_SIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
thinSVD_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
thinSVD_PIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
compactSVD :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
Similar to thinSVD
, returning only the nonzero singular values and the corresponding singular vectors.
compactSVD_S :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
compactSVD_SIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
compactSVD_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
compactSVD_PIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double, Array F DIM2 t) Source
singularValues :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM1 Double Source
Singular values only.
singularValuesP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM1 Double) Source
leftSV :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM1 Double) Source
Singular values and all left singular vectors (as columns).
leftSV_SIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double) Source
leftSV_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM1 Double) Source
leftSV_PIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM1 Double) Source
rightSV :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM1 Double, Array F DIM2 t) Source
Singular values and all right singular vectors (as columns).
rightSV_SIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 Double, Array F DIM2 t) Source
rightSV_P :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM1 Double, Array F DIM2 t) Source
rightSV_PIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 Double, Array F DIM2 t) Source
Eigensystems
eig :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM1 (Complex Double), Array F DIM2 (Complex Double)) Source
Eigenvalues (not ordered) and eigenvectors (as columns) of a general square matrix. (s,v) = eig m ==> m * v = v == v <> diag s
eigS :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM1 (Complex Double), Array F DIM2 (Complex Double)) Source
eigSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 (Complex Double), Array F DIM2 (Complex Double)) Source
eigP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM1 (Complex Double), Array F DIM2 (Complex Double)) Source
eigPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 (Complex Double), Array F DIM2 (Complex Double)) Source
eigSH :: (Field t, Numeric t) => Herm t -> (Array F DIM1 Double, Array F DIM2 t) Source
Eigenvalues and eigenvectors (as columns) of a complex hermitian or a real symmetric matrix, in descending order.
eigenvalues :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM1 (Complex Double) Source
Eigenvalues (not ordered) of a general square matrix.
eigenvaluesSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 (Complex Double)) Source
eigenvaluesP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM1 (Complex Double)) Source
eigenvaluesPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM1 (Complex Double)) Source
eigenvaluesSH :: (Field t, Numeric t) => Herm t -> Array F DIM1 Double Source
Eigenvalues (in descending order) of a complex hermitian or real symmetric matrix.
geigSH :: (Field t, Numeric t) => Herm t -> Herm t -> (Array F DIM1 Double, Array F DIM2 t) Source
Generalized symmetric positive definite eigensystem Av = IBv, for A and B symmetric, B positive definite.
QR
qr :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t) Source
QR factorization. (q,r) = qr m ==> m = q * r where q is unitary and r is upper triangular.
rq :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t) Source
RQ factorization. (r,q) = rq m ==> m = r * q where q is unitary and r is upper triangular.
qrgr :: (Field t, Numeric t) => Int -> QR t -> Array F DIM2 t Source
Generate a matrix with k othogonal columns from the output of qrRaw
.
Cholesky
chol :: Field t => Herm t -> Array F DIM2 t Source
Cholesky factorization of a positive definite hermitian or symmetric matrix. c = chol m ==> m == c' * c where c is upper triangular.
mbChol :: Field t => Herm t -> Maybe (Array F DIM2 t) Source
Similar to chol, but instead of an error (e.g., caused by a matrix not positive definite) it returns Nothing.
Hessenberg
hess :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t) Source
Hessenberg factorization. (p,h) == hess m ==> p * h * p' where p is unitary and h is in upper Hessenberg form (zero entries below the first subdiagonal).
hessP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM2 t) Source
Schur
schur :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t) Source
Schur factorization. (u,s) = schur m ==> m == u * s * u' where u is unitary and s is a Schur matrix. A complex Schur matrix is upper triangular. A real Schur matrix is upper triangular in 2x2 blocks.
schurP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM2 t) Source
LU
lu :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t) Source
Explicit LU factorization of a general matrix. (l,u,p,s) = lu m ==> m = p * l * u where l is lower triangular, u is upper triangular, p is a permutation matrix, and s is the signature of the permutation.
luS :: (Field t, Numeric t) => Array D DIM2 t -> (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t) Source
luSIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t) Source
luP :: (Field t, Numeric t, Monad m) => Array D DIM2 t -> m (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t) Source
luPIO :: (Field t, Numeric t) => Array D DIM2 t -> IO (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t) Source
luPacked :: (Field t, Numeric t) => Array F DIM2 t -> LU t Source
Obtains the LU decomposition in a packed data structure suitable for luSolve
.
luFact :: Numeric t => LU t -> (Array F DIM2 t, Array F DIM2 t, Array F DIM2 t, t) Source
Compute the explicit LU decomposition from the compact one obtained by luPacked.
Symmetric indefinite
ldlSolve :: Field t => LDL t -> Array F DIM2 t -> Array F DIM2 t Source
Solution of a linear system (for several right hand sides) from a precomputed LDL factorization obtained by ldlPacked
.
Note: this can be slower than the general solver based on the LU decomposition.
ldlPacked :: Field t => Herm t -> LDL t Source
Obtains the LDL decomposition of a matrix in a compact data structure suitable for ldlSolve
.
Matrix functions
expm :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t Source
Matrix exponential. It uses a direct translation of Algorithm 11.3.1 in Golub & Val Loan, based on a scaled Pade approximation.
sqrtm :: (Field t, Numeric t) => Array F DIM2 t -> Array F DIM2 t Source
Matrix square root. Currently it uses a simple iterative algorithm described in Wikipedia. It only works with invertible matrices that have a real solution.
matFunc :: (Complex Double -> Complex Double) -> Array F DIM2 (Complex Double) -> Array F DIM2 (Complex Double) Source
matFuncS :: (Complex Double -> Complex Double) -> Array D DIM2 (Complex Double) -> Array F DIM2 (Complex Double) Source
matFuncSIO :: (Complex Double -> Complex Double) -> Array D DIM2 (Complex Double) -> IO (Array F DIM2 (Complex Double)) Source
matFuncP :: Monad m => (Complex Double -> Complex Double) -> Array D DIM2 (Complex Double) -> m (Array F DIM2 (Complex Double)) Source
matFuncPIO :: (Complex Double -> Complex Double) -> Array D DIM2 (Complex Double) -> IO (Array F DIM2 (Complex Double)) Source
Correlation and convolution
corr :: (Product t, Numeric t) => Array F DIM1 t -> Array F DIM1 t -> Array F DIM1 t Source
Correlation.
corrP :: (Product t, Numeric t, Monad m) => Array F DIM1 t -> Array D DIM1 t -> m (Array F DIM1 t) Source
conv :: (Product t, Numeric t) => Array F DIM1 t -> Array F DIM1 t -> Array F DIM1 t Source
Convolution - corr
with reversed kernel and padded input, equivalent to polynomial multiplication.
convP :: (Product t, Numeric t, Monad m) => Array F DIM1 t -> Array D DIM1 t -> m (Array F DIM1 t) Source
corrMin :: (Product t, Numeric t, RealElement t) => Array F DIM1 t -> Array F DIM1 t -> Array F DIM1 t Source
corrMinS :: (Product t, Numeric t, RealElement t) => Array F DIM1 t -> Array D DIM1 t -> Array F DIM1 t Source
corrMinSIO :: (Product t, Numeric t, RealElement t) => Array F DIM1 t -> Array D DIM1 t -> IO (Array F DIM1 t) Source
corrMinP :: (Product t, Numeric t, RealElement t, Monad m) => Array F DIM1 t -> Array D DIM1 t -> m (Array F DIM1 t) Source
corrMinPIO :: (Product t, Numeric t, RealElement t) => Array F DIM1 t -> Array D DIM1 t -> IO (Array F DIM1 t) Source
corr2 :: (Product t, Numeric t) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t Source
2D correlation (without padding).
corr2SIO :: (Product t, Numeric t) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
corr2P :: (Product t, Numeric t, Monad m) => Array F DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t) Source
corr2PIO :: (Product t, Numeric t) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
conv2 :: (Product t, Numeric t, Num (Vector t)) => Array F DIM2 t -> Array F DIM2 t -> Array F DIM2 t Source
2D convolution.
conv2S :: (Product t, Numeric t, Num (Vector t)) => Array F DIM2 t -> Array D DIM2 t -> Array F DIM2 t Source
conv2SIO :: (Product t, Numeric t, Num (Vector t)) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
conv2P :: (Product t, Numeric t, Num (Vector t), Monad m) => Array F DIM2 t -> Array D DIM2 t -> m (Array F DIM2 t) Source
conv2PIO :: (Product t, Numeric t, Num (Vector t)) => Array F DIM2 t -> Array D DIM2 t -> IO (Array F DIM2 t) Source
Random vectors and matrices
randomVector :: Seed -> RandDist -> Int -> Array F DIM1 Double Source
Pseudorandom vector of na given size. Usee randomIO
to get a random seed.
gaussianSample :: Seed -> Int -> Array F DIM1 Double -> Array F DIM2 Double -> Array F DIM2 Double Source
A matrix whose rows are pseudorandom samples from a multivariate Gaussian distribution.
uniformSample :: Seed -> Int -> [(Double, Double)] -> Array F DIM2 Double Source
A matrix whose rows are pseudorandom samples from a multivariate uniform distribution.
Misc
meanCov :: Array F DIM2 Double -> (Array F DIM1 Double, Array F DIM2 Double) Source
Compute mean vector and a covariance matrix of the rows of a matrix.
rowOuters :: Array F DIM2 Double -> Array F DIM2 Double -> Array F DIM2 Double Source
Outer product of the rows of the matrices.
sym :: Field t => Array F DIM2 t -> Herm t Source
Compute the complex Hermitian or real symmetric part of a square matrix ((x + tr x)/2).
mTm :: Field t => Array F DIM2 t -> Herm t Source
Compute the contraction tr x <> x of a general matrix.