{-# LANGUAGE TypeFamilies #-}
module Numeric.LAPACK.Linear.LowerUpper (
   LowerUpper,
   Plain.Tall,
   Plain.Wide,
   Plain.Square,
   Plain.LiberalSquare,
   Plain.Transposition(..),
   Plain.Conjugation(..),
   Plain.Inversion(..),
   Plain.mapExtent,
   fromMatrix,
   toMatrix,
   solve,
   multiplyFull,

   Plain.determinant,

   extractP,
   multiplyP,

   extractL,
   wideExtractL,
   wideMultiplyL,
   wideSolveL,

   extractU,
   tallExtractU,
   tallMultiplyU,
   tallSolveU,

   Plain.caseTallWide,
   ) where

import qualified Numeric.LAPACK.Linear.Plain as Plain
import Numeric.LAPACK.Linear.Plain (LowerUpper)

import qualified Numeric.LAPACK.Matrix.Array.Unpacked as Unpacked
import qualified Numeric.LAPACK.Matrix.Array.Mosaic as Tri
import qualified Numeric.LAPACK.Matrix.Array.Private as ArrMatrix
import qualified Numeric.LAPACK.Matrix.Extent.Private as Extent
import qualified Numeric.LAPACK.Matrix.Permutation as PermMatrix
import qualified Numeric.LAPACK.Matrix as Matrix
import qualified Numeric.LAPACK.Shape as ExtShape
import Numeric.LAPACK.Matrix.Array.Private (Full)
import Numeric.LAPACK.Matrix.Modifier (Transposition, Conjugation, Inversion)

import qualified Numeric.Netlib.Class as Class

import qualified Data.Array.Comfort.Shape as Shape


{- |
@LowerUpper.fromMatrix a@
computes the LU decomposition of matrix @a@ with row pivotisation.

You can reconstruct @a@ from @lu@ depending on whether @a@ is tall or wide.

> LU.multiplyP NonInverted lu $ LU.extractL lu ##*# LU.tallExtractU lu
> LU.multiplyP NonInverted lu $ LU.wideExtractL lu #*## LU.extractU lu
-}
fromMatrix ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz,
    Shape.C height, Shape.C width, Class.Floating a) =>
   Full meas vert horiz height width a ->
   LowerUpper meas vert horiz height width a
fromMatrix :: Full meas vert horiz height width a
-> LowerUpper meas vert horiz height width a
fromMatrix = Full meas vert horiz height width a
-> LowerUpper meas vert horiz height width a
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz, C height, C width, Floating a) =>
Full meas vert horiz height width a
-> LowerUpper meas vert horiz height width a
Plain.fromMatrix (Full meas vert horiz height width a
 -> LowerUpper meas vert horiz height width a)
-> (Full meas vert horiz height width a
    -> Full meas vert horiz height width a)
-> Full meas vert horiz height width a
-> LowerUpper meas vert horiz height width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Full meas vert horiz height width a
-> Full meas vert horiz height width a
forall pack property lower upper meas vert horiz height width a.
ToPlain pack property lower upper meas vert horiz height width =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper meas vert horiz height width a
ArrMatrix.toVector

solve ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz,
    Eq height, Shape.C height, Shape.C width, Class.Floating a) =>
   Plain.Square height a ->
   Full meas vert horiz height width a ->
   Full meas vert horiz height width a
solve :: Square height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
solve = (Array (Full meas vert horiz height width) a
 -> Array (Full meas vert horiz height width) a)
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 ((Array (Full meas vert horiz height width) a
  -> Array (Full meas vert horiz height width) a)
 -> Full meas vert horiz height width a
 -> Full meas vert horiz height width a)
-> (Square height a
    -> Array (Full meas vert horiz height width) a
    -> Array (Full meas vert horiz height width) a)
-> Square height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Square height a
-> Array (Full meas vert horiz height width) a
-> Array (Full meas vert horiz height width) a
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz, Eq height, C height, C width,
 Floating a) =>
Square height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
Plain.solve


extractP ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz,
    ExtShape.Permutable height, Shape.C width) =>
   Inversion -> LowerUpper meas vert horiz height width a ->
   Matrix.Permutation height a
extractP :: Inversion
-> LowerUpper meas vert horiz height width a
-> Permutation height a
extractP Inversion
inverted = Permutation height -> Permutation height a
forall sh a. C sh => Permutation sh -> Permutation sh a
PermMatrix.fromPermutation (Permutation height -> Permutation height a)
-> (LowerUpper meas vert horiz height width a
    -> Permutation height)
-> LowerUpper meas vert horiz height width a
-> Permutation height a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Inversion
-> LowerUpper meas vert horiz height width a -> Permutation height
forall meas vert horiz height width lower upper a.
(Measure meas, C vert, C horiz, C height, C width) =>
Inversion
-> LowerUpperFlex lower upper meas vert horiz height width a
-> Permutation height
Plain.extractP Inversion
inverted

multiplyP ::
   (Extent.Measure measA, Extent.C vertA, Extent.C horizA,
    Extent.Measure measB, Extent.C vertB, Extent.C horizB,
    Eq height, ExtShape.Permutable height, Shape.C widthA, Shape.C widthB,
    Class.Floating a) =>
   Inversion ->
   LowerUpper measA vertA horizA height widthA a ->
   Full measB vertB horizB height widthB a ->
   Full measB vertB horizB height widthB a
multiplyP :: Inversion
-> LowerUpper measA vertA horizA height widthA a
-> Full measB vertB horizB height widthB a
-> Full measB vertB horizB height widthB a
multiplyP Inversion
inverted = (Array (Full measB vertB horizB height widthB) a
 -> Array (Full measB vertB horizB height widthB) a)
-> Full measB vertB horizB height widthB a
-> Full measB vertB horizB height widthB a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 ((Array (Full measB vertB horizB height widthB) a
  -> Array (Full measB vertB horizB height widthB) a)
 -> Full measB vertB horizB height widthB a
 -> Full measB vertB horizB height widthB a)
-> (LowerUpper measA vertA horizA height widthA a
    -> Array (Full measB vertB horizB height widthB) a
    -> Array (Full measB vertB horizB height widthB) a)
-> LowerUpper measA vertA horizA height widthA a
-> Full measB vertB horizB height widthB a
-> Full measB vertB horizB height widthB a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Inversion
-> LowerUpper measA vertA horizA height widthA a
-> Array (Full measB vertB horizB height widthB) a
-> Array (Full measB vertB horizB height widthB) a
forall measA vertA horizA measB vertB horizB height widthA widthB a
       lower upper.
(Measure measA, C vertA, C horizA, Measure measB, C vertB,
 C horizB, Eq height, C height, C widthA, C widthB, Floating a) =>
Inversion
-> LowerUpperFlex lower upper measA vertA horizA height widthA a
-> Full measB vertB horizB height widthB a
-> Full measB vertB horizB height widthB a
Plain.multiplyP Inversion
inverted



extractL ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz,
    ExtShape.Permutable height, ExtShape.Permutable width, Class.Floating a) =>
   LowerUpper meas vert horiz height width a ->
   Unpacked.LowerTrapezoid meas vert horiz height width a
extractL :: LowerUpper meas vert horiz height width a
-> LowerTrapezoid meas vert horiz height width a
extractL = FullArray meas vert horiz height width a
-> LowerTrapezoid meas vert horiz height width a
forall propertyA lowerA upperA measA vertA horizA heightA widthA a.
(Property propertyA, Strip lowerA, Strip upperA) =>
FullArray measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
ArrMatrix.liftUnpacked0 (FullArray meas vert horiz height width a
 -> LowerTrapezoid meas vert horiz height width a)
-> (LowerUpper meas vert horiz height width a
    -> FullArray meas vert horiz height width a)
-> LowerUpper meas vert horiz height width a
-> LowerTrapezoid meas vert horiz height width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LowerUpper meas vert horiz height width a
-> FullArray meas vert horiz height width a
forall meas vert horiz height width a lower upper.
(Measure meas, C vert, C horiz, C height, C width, Floating a) =>
LowerUpperFlex lower upper meas vert horiz height width a
-> Full meas vert horiz height width a
Plain.extractL

wideExtractL ::
   (Extent.Measure meas, Extent.C horiz,
    ExtShape.Permutable height, Shape.C width, Class.Floating a) =>
   LowerUpper meas Extent.Small horiz height width a -> Tri.UnitLower height a
wideExtractL :: LowerUpper meas Small horiz height width a -> UnitLower height a
wideExtractL = Array (LowerTriangularP Packed height) a -> UnitLower height a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (Array (LowerTriangularP Packed height) a -> UnitLower height a)
-> (LowerUpper meas Small horiz height width a
    -> Array (LowerTriangularP Packed height) a)
-> LowerUpper meas Small horiz height width a
-> UnitLower height a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LowerUpper meas Small horiz height width a
-> Array (LowerTriangularP Packed height) a
forall meas horiz height width a lower upper.
(Measure meas, C horiz, C height, C width, Floating a) =>
LowerUpperFlex lower upper meas Small horiz height width a
-> Lower height a
Plain.wideExtractL

{- |
@wideMultiplyL transposed lu a@ multiplies the square part of @lu@
containing the lower triangular matrix with @a@.

> wideMultiplyL NonTransposed lu a == wideExtractL lu #*## a
> wideMultiplyL Transposed lu a == Tri.transpose (wideExtractL lu) #*## a
-}
wideMultiplyL ::
   (Extent.Measure measA, Extent.C horizA,
    Extent.Measure meas, Extent.C vert, Extent.C horiz,
    ExtShape.Permutable height, Eq height,
    Shape.C widthA, Shape.C widthB, Class.Floating a) =>
   Transposition ->
   LowerUpper measA Extent.Small horizA height widthA a ->
   Full meas vert horiz height widthB a ->
   Full meas vert horiz height widthB a
wideMultiplyL :: Transposition
-> LowerUpper measA Small horizA height widthA a
-> Full meas vert horiz height widthB a
-> Full meas vert horiz height widthB a
wideMultiplyL Transposition
transposed = (Array (Full meas vert horiz height widthB) a
 -> Array (Full meas vert horiz height widthB) a)
-> Full meas vert horiz height widthB a
-> Full meas vert horiz height widthB a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 ((Array (Full meas vert horiz height widthB) a
  -> Array (Full meas vert horiz height widthB) a)
 -> Full meas vert horiz height widthB a
 -> Full meas vert horiz height widthB a)
-> (LowerUpper measA Small horizA height widthA a
    -> Array (Full meas vert horiz height widthB) a
    -> Array (Full meas vert horiz height widthB) a)
-> LowerUpper measA Small horizA height widthA a
-> Full meas vert horiz height widthB a
-> Full meas vert horiz height widthB a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Transposition
-> LowerUpper measA Small horizA height widthA a
-> Array (Full meas vert horiz height widthB) a
-> Array (Full meas vert horiz height widthB) a
forall measA horizA meas vert horiz height widthA widthB a lower
       upper.
(Measure measA, C horizA, Measure meas, C vert, C horiz, C height,
 Eq height, C widthA, C widthB, Floating a) =>
Transposition
-> LowerUpperFlex lower upper measA Small horizA height widthA a
-> Full meas vert horiz height widthB a
-> Full meas vert horiz height widthB a
Plain.wideMultiplyL Transposition
transposed

wideSolveL ::
   (Extent.Measure measA, Extent.C horizA,
    Extent.Measure meas, Extent.C vert, Extent.C horiz,
    ExtShape.Permutable height, Eq height, Shape.C width, Shape.C nrhs,
    Class.Floating a) =>
   Transposition -> Conjugation ->
   LowerUpper measA Extent.Small horizA height width a ->
   Full meas vert horiz height nrhs a -> Full meas vert horiz height nrhs a
wideSolveL :: Transposition
-> Conjugation
-> LowerUpper measA Small horizA height width a
-> Full meas vert horiz height nrhs a
-> Full meas vert horiz height nrhs a
wideSolveL Transposition
transposed Conjugation
conjugated =
   (Array (Full meas vert horiz height nrhs) a
 -> Array (Full meas vert horiz height nrhs) a)
-> Full meas vert horiz height nrhs a
-> Full meas vert horiz height nrhs a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 ((Array (Full meas vert horiz height nrhs) a
  -> Array (Full meas vert horiz height nrhs) a)
 -> Full meas vert horiz height nrhs a
 -> Full meas vert horiz height nrhs a)
-> (LowerUpper measA Small horizA height width a
    -> Array (Full meas vert horiz height nrhs) a
    -> Array (Full meas vert horiz height nrhs) a)
-> LowerUpper measA Small horizA height width a
-> Full meas vert horiz height nrhs a
-> Full meas vert horiz height nrhs a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Transposition
-> Conjugation
-> LowerUpper measA Small horizA height width a
-> Array (Full meas vert horiz height nrhs) a
-> Array (Full meas vert horiz height nrhs) a
forall measA horizA meas vert horiz height width nrhs a lower
       upper.
(Measure measA, C horizA, Measure meas, C vert, C horiz, C height,
 Eq height, C width, C nrhs, Floating a) =>
Transposition
-> Conjugation
-> LowerUpperFlex lower upper measA Small horizA height width a
-> Full meas vert horiz height nrhs a
-> Full meas vert horiz height nrhs a
Plain.wideSolveL Transposition
transposed Conjugation
conjugated


extractU ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz,
    ExtShape.Permutable height, ExtShape.Permutable width, Class.Floating a) =>
   LowerUpper meas vert horiz height width a ->
   Unpacked.UpperTrapezoid meas vert horiz height width a
extractU :: LowerUpper meas vert horiz height width a
-> UpperTrapezoid meas vert horiz height width a
extractU = FullArray meas vert horiz height width a
-> UpperTrapezoid meas vert horiz height width a
forall propertyA lowerA upperA measA vertA horizA heightA widthA a.
(Property propertyA, Strip lowerA, Strip upperA) =>
FullArray measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
ArrMatrix.liftUnpacked0 (FullArray meas vert horiz height width a
 -> UpperTrapezoid meas vert horiz height width a)
-> (LowerUpper meas vert horiz height width a
    -> FullArray meas vert horiz height width a)
-> LowerUpper meas vert horiz height width a
-> UpperTrapezoid meas vert horiz height width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LowerUpper meas vert horiz height width a
-> FullArray meas vert horiz height width a
forall meas vert horiz height width a lower upper.
(Measure meas, C vert, C horiz, C height, C width, Floating a) =>
LowerUpperFlex lower upper meas vert horiz height width a
-> Full meas vert horiz height width a
Plain.extractU

tallExtractU ::
   (Extent.Measure meas, Extent.C vert,
    Shape.C height, ExtShape.Permutable width, Class.Floating a) =>
   LowerUpper meas vert Extent.Small height width a -> Tri.Upper width a
tallExtractU :: LowerUpper meas vert Small height width a -> Upper width a
tallExtractU = Array (UpperTriangularP Packed width) a -> Upper width a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (Array (UpperTriangularP Packed width) a -> Upper width a)
-> (LowerUpper meas vert Small height width a
    -> Array (UpperTriangularP Packed width) a)
-> LowerUpper meas vert Small height width a
-> Upper width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LowerUpper meas vert Small height width a
-> Array (UpperTriangularP Packed width) a
forall meas vert height width a lower upper.
(Measure meas, C vert, C height, C width, Floating a) =>
LowerUpperFlex lower upper meas vert Small height width a
-> Upper width a
Plain.tallExtractU

{- |
@tallMultiplyU transposed lu a@ multiplies the square part of @lu@
containing the upper triangular matrix with @a@.

> tallMultiplyU NonTransposed lu a == tallExtractU lu #*## a
> tallMultiplyU Transposed lu a == Tri.transpose (tallExtractU lu) #*## a
-}
tallMultiplyU ::
   (Extent.Measure measA, Extent.C vertA,
    Extent.Measure meas, Extent.C vert, Extent.C horiz,
    ExtShape.Permutable height, Eq height,
    Shape.C heightA, Shape.C widthB, Class.Floating a) =>
   Transposition ->
   LowerUpper measA vertA Extent.Small heightA height a ->
   Full meas vert horiz height widthB a ->
   Full meas vert horiz height widthB a
tallMultiplyU :: Transposition
-> LowerUpper measA vertA Small heightA height a
-> Full meas vert horiz height widthB a
-> Full meas vert horiz height widthB a
tallMultiplyU Transposition
transposed = (Array (Full meas vert horiz height widthB) a
 -> Array (Full meas vert horiz height widthB) a)
-> Full meas vert horiz height widthB a
-> Full meas vert horiz height widthB a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 ((Array (Full meas vert horiz height widthB) a
  -> Array (Full meas vert horiz height widthB) a)
 -> Full meas vert horiz height widthB a
 -> Full meas vert horiz height widthB a)
-> (LowerUpper measA vertA Small heightA height a
    -> Array (Full meas vert horiz height widthB) a
    -> Array (Full meas vert horiz height widthB) a)
-> LowerUpper measA vertA Small heightA height a
-> Full meas vert horiz height widthB a
-> Full meas vert horiz height widthB a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Transposition
-> LowerUpper measA vertA Small heightA height a
-> Array (Full meas vert horiz height widthB) a
-> Array (Full meas vert horiz height widthB) a
forall measA vertA meas vert horiz height heightA widthB a lower
       upper.
(Measure measA, C vertA, Measure meas, C vert, C horiz, C height,
 Eq height, C heightA, C widthB, Floating a) =>
Transposition
-> LowerUpperFlex lower upper measA vertA Small heightA height a
-> Full meas vert horiz height widthB a
-> Full meas vert horiz height widthB a
Plain.tallMultiplyU Transposition
transposed

tallSolveU ::
   (Extent.Measure measA, Extent.C vertA,
    Extent.Measure meas, Extent.C vert, Extent.C horiz,
    Shape.C height, ExtShape.Permutable width, Eq width, Shape.C nrhs,
    Class.Floating a) =>
   Transposition -> Conjugation ->
   LowerUpper measA vertA Extent.Small height width a ->
   Full meas vert horiz width nrhs a -> Full meas vert horiz width nrhs a
tallSolveU :: Transposition
-> Conjugation
-> LowerUpper measA vertA Small height width a
-> Full meas vert horiz width nrhs a
-> Full meas vert horiz width nrhs a
tallSolveU Transposition
transposed Conjugation
conjugated =
   (Array (Full meas vert horiz width nrhs) a
 -> Array (Full meas vert horiz width nrhs) a)
-> Full meas vert horiz width nrhs a
-> Full meas vert horiz width nrhs a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 ((Array (Full meas vert horiz width nrhs) a
  -> Array (Full meas vert horiz width nrhs) a)
 -> Full meas vert horiz width nrhs a
 -> Full meas vert horiz width nrhs a)
-> (LowerUpper measA vertA Small height width a
    -> Array (Full meas vert horiz width nrhs) a
    -> Array (Full meas vert horiz width nrhs) a)
-> LowerUpper measA vertA Small height width a
-> Full meas vert horiz width nrhs a
-> Full meas vert horiz width nrhs a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Transposition
-> Conjugation
-> LowerUpper measA vertA Small height width a
-> Array (Full meas vert horiz width nrhs) a
-> Array (Full meas vert horiz width nrhs) a
forall measA vertA meas vert horiz height width nrhs a lower upper.
(Measure measA, C vertA, Measure meas, C vert, C horiz, C height,
 C width, Eq width, C nrhs, Floating a) =>
Transposition
-> Conjugation
-> LowerUpperFlex lower upper measA vertA Small height width a
-> Full meas vert horiz width nrhs a
-> Full meas vert horiz width nrhs a
Plain.tallSolveU Transposition
transposed Conjugation
conjugated



toMatrix ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz,
    Shape.C height, Eq height, Shape.C width, Eq width, Class.Floating a) =>
   LowerUpper meas vert horiz height width a ->
   Full meas vert horiz height width a
toMatrix :: LowerUpper meas vert horiz height width a
-> Full meas vert horiz height width a
toMatrix = Array (Full meas vert horiz height width) a
-> Full meas vert horiz height width a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (Array (Full meas vert horiz height width) a
 -> Full meas vert horiz height width a)
-> (LowerUpper meas vert horiz height width a
    -> Array (Full meas vert horiz height width) a)
-> LowerUpper meas vert horiz height width a
-> Full meas vert horiz height width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LowerUpper meas vert horiz height width a
-> Array (Full meas vert horiz height width) a
forall meas vert horiz height width a lower upper.
(Measure meas, C vert, C horiz, C height, Eq height, C width,
 Eq width, Floating a) =>
LowerUpperFlex lower upper meas vert horiz height width a
-> Full meas vert horiz height width a
Plain.toMatrix


multiplyFull ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz,
    Shape.C height, Eq height, Shape.C width, Shape.C fuse, Eq fuse,
    Class.Floating a) =>
   LowerUpper meas vert horiz height fuse a ->
   Full meas vert horiz fuse width a ->
   Full meas vert horiz height width a
multiplyFull :: LowerUpper meas vert horiz height fuse a
-> Full meas vert horiz fuse width a
-> Full meas vert horiz height width a
multiplyFull = (Array (Full meas vert horiz fuse width) a
 -> Array (Full meas vert horiz height width) a)
-> Full meas vert horiz fuse width a
-> Full meas vert horiz height width a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 ((Array (Full meas vert horiz fuse width) a
  -> Array (Full meas vert horiz height width) a)
 -> Full meas vert horiz fuse width a
 -> Full meas vert horiz height width a)
-> (LowerUpper meas vert horiz height fuse a
    -> Array (Full meas vert horiz fuse width) a
    -> Array (Full meas vert horiz height width) a)
-> LowerUpper meas vert horiz height fuse a
-> Full meas vert horiz fuse width a
-> Full meas vert horiz height width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LowerUpper meas vert horiz height fuse a
-> Array (Full meas vert horiz fuse width) a
-> Array (Full meas vert horiz height width) a
forall meas vert horiz height width fuse a lower upper.
(Measure meas, C vert, C horiz, C height, C width, C fuse, Eq fuse,
 Floating a) =>
LowerUpperFlex lower upper meas vert horiz height fuse a
-> Full meas vert horiz fuse width a
-> Full meas vert horiz height width a
Plain.multiplyFull