module Numeric.LAPACK.Matrix.Array.Basic where

import qualified Numeric.LAPACK.Matrix.Array as ArrMatrix
import qualified Numeric.LAPACK.Matrix.Basic as Basic
import qualified Numeric.LAPACK.Matrix.Extent as Extent
import Numeric.LAPACK.Matrix.Array (Full)


transpose ::
   (Extent.C vert, Extent.C horiz) =>
   Full vert horiz height width a -> Full horiz vert width height a
transpose :: Full vert horiz height width a -> Full horiz vert width height a
transpose = (Array (Full vert horiz height width) a
 -> Array (Full horiz vert width height) a)
-> Full vert horiz height width a -> Full horiz vert width height a
forall shA a shB b.
(Array shA a -> Array shB b)
-> ArrayMatrix shA a -> ArrayMatrix shB b
ArrMatrix.lift1 Array (Full vert horiz height width) a
-> Array (Full horiz vert width height) a
forall vert horiz height width a.
(C vert, C horiz) =>
Full vert horiz height width a -> Full horiz vert width height a
Basic.transpose

swapMultiply ::
   (Extent.C vertA, Extent.C vertB, Extent.C horizA, Extent.C horizB) =>
   (matrix ->
    Full horizA vertA widthA heightA a ->
    Full horizB vertB widthB heightB a) ->
   Full vertA horizA heightA widthA a ->
   matrix ->
   Full vertB horizB heightB widthB a
swapMultiply :: (matrix
 -> Full horizA vertA widthA heightA a
 -> Full horizB vertB widthB heightB a)
-> Full vertA horizA heightA widthA a
-> matrix
-> Full vertB horizB heightB widthB a
swapMultiply matrix
-> Full horizA vertA widthA heightA a
-> Full horizB vertB widthB heightB a
multiplyTrans Full vertA horizA heightA widthA a
a matrix
b = Full horizB vertB widthB heightB a
-> Full vertB horizB heightB widthB a
forall vert horiz height width a.
(C vert, C horiz) =>
Full vert horiz height width a -> Full horiz vert width height a
transpose (Full horizB vertB widthB heightB a
 -> Full vertB horizB heightB widthB a)
-> Full horizB vertB widthB heightB a
-> Full vertB horizB heightB widthB a
forall a b. (a -> b) -> a -> b
$ matrix
-> Full horizA vertA widthA heightA a
-> Full horizB vertB widthB heightB a
multiplyTrans matrix
b (Full horizA vertA widthA heightA a
 -> Full horizB vertB widthB heightB a)
-> Full horizA vertA widthA heightA a
-> Full horizB vertB widthB heightB a
forall a b. (a -> b) -> a -> b
$ Full vertA horizA heightA widthA a
-> Full horizA vertA widthA heightA a
forall vert horiz height width a.
(C vert, C horiz) =>
Full vert horiz height width a -> Full horiz vert width height a
transpose Full vertA horizA heightA widthA a
a