-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | An accelerate library that adds dependently typed matrices.
--   
--   An accelerate library that adds dependently typed matrices. This
--   library adds the ability to do matrix manipulations with or without
--   dependent types to help line up the operations so as to prevent
--   runtime errors.
@package matrix-accelerate
@version 0.1.0.0


-- | This module contains functions for doing matrix math such as addition,
--   subtraction, and multiplication for both plain and dependently typed
--   matrices.
module Data.Array.Accelerate.Matrix

-- | Multiply two matrices together without dependent types.
mMul :: Num e => Acc (Matrix e) -> Acc (Matrix e) -> Acc (Matrix e)

-- | Multiply two dependently typed matrices together. |For example:
--   
--   @ data A = A data B = B data C = C
--   
--   let m1 = AccMat (use (fromList (Z:.10:.12) [0..] :: Matrix Int)) A B
--   let m2 = AccMat (use (fromList (Z:.12:.13) [0..] :: Matrix Int)) B C
--   let mResult = m1 <a>matMul</a> m2
matMul :: Num e => AccMat e a b -> AccMat e b c -> AccMat e a c

-- | Creat an identity matrix with the dimension provided
identMat :: Exp Int -> Acc (Matrix Int)

-- | Dependent type for plain matrices.
data Mat e a b

-- | Dependently typed plain matrix for passing to compiled functions.
[Mat] :: (Elt e, Num e) => Matrix e -> a -> b -> Mat e a b

-- | Dependent type for accelerate matrices.
data AccMat e a b

-- | Dependently typed accelerated matrix which forces two types to line
--   up.
[AccMat] :: (Elt e, Num e) => Acc (Matrix e) -> a -> b -> AccMat e a b

-- | Transpose a dependently typed matrix.
matTransp :: AccMat e a b -> AccMat e b a

-- | Add two dependently typed matrices.
matAdd :: Num e => AccMat e a b -> AccMat e a b -> AccMat e a b

-- | Add two matrices without dependent types.
mAdd :: Num e => Acc (Matrix e) -> Acc (Matrix e) -> Acc (Matrix e)

-- | Subtract one matrix from another without dependent types.
mSub :: Num e => Acc (Matrix e) -> Acc (Matrix e) -> Acc (Matrix e)

-- | Subtract one dependently typed matrix from another.
matSub :: Num e => AccMat e a b -> AccMat e a b -> AccMat e a b

-- | Change the type of a dependently typed matrix from AccMat to Mat.
useMat :: Mat e a b -> AccMat e a b

-- | Scale a dependently typed matrix.
matScale :: Num e => Exp e -> AccMat e a b -> AccMat e a b
