{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Data.Array.Shaped.MatMul(matMul) where
import GHC.TypeLits
import Data.Array.Convert
import Data.Array.Shaped
import qualified Data.Array.ShapedS.MatMul as S
import Numeric.LinearAlgebra as N

matMul :: forall m n o a .
          (N.Numeric a, KnownNat m, KnownNat n, KnownNat o) =>
          Array [m, n] a -> Array [n, o] a -> Array [m, o] a
matMul :: Array '[m, n] a -> Array '[n, o] a -> Array '[m, o] a
matMul Array '[m, n] a
x Array '[n, o] a
y = Array '[m, o] a -> Array '[m, o] a
forall a b. Convert a b => a -> b
convert (Array '[m, o] a -> Array '[m, o] a)
-> Array '[m, o] a -> Array '[m, o] a
forall a b. (a -> b) -> a -> b
$ Array '[m, n] a -> Array '[n, o] a -> Array '[m, o] a
forall (m :: Nat) (n :: Nat) (o :: Nat) a.
(Numeric a, KnownNat m, KnownNat n, KnownNat o) =>
Array '[m, n] a -> Array '[n, o] a -> Array '[m, o] a
S.matMul (Array '[m, n] a -> Array '[m, n] a
forall a b. Convert a b => a -> b
convert Array '[m, n] a
x) (Array '[n, o] a -> Array '[n, o] a
forall a b. Convert a b => a -> b
convert Array '[n, o] a
y)