{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
module Numeric.LAPACK.Matrix.Array (
   Matrix(Array),
   ArrayMatrix,
   Array,
   OmniArray,
   PlainArray,

   Full,
   General,
   Tall,
   Wide,
   LiberalSquare,
   Square,
   SquareMeas,
   Quadratic,
   FullQuadratic,
   QuadraticMeas,

   plainShape,
   shape,
   extent,
   subBandsSingleton,
   superBandsSingleton,
   packTag,
   diagTag,

   asPacked,
   asUnpacked,
   requirePacking,

   reshape,
   mapShape,
   unwrap,
   toVector,
   fromVector,
   lift0,
   lift1,
   lift2,
   lift3,
   lift4,
   unlift1,
   unlift2,
   unliftRow,
   unliftColumn,
   unpackedToVector,
   liftUnpacked0,
   liftUnpacked1,
   liftUnpacked2,
   liftUnpacked3,
   liftOmni1,
   liftOmni2,

   Homogeneous, Scale, zero, negate, scaleReal, scale, scaleRealReal, (.*#),
   order, forceOrder, adaptOrder,
   Additive, add, (#+#),
   Subtractive, sub, (#-#),

   MapExtent, mapExtent,
   ) where

import qualified Numeric.LAPACK.Matrix.Plain.Class as ArrClass
import qualified Numeric.LAPACK.Matrix.Type as Matrix
import qualified Numeric.LAPACK.Matrix.BandedHermitian.Basic as BandedHermitian
import qualified Numeric.LAPACK.Matrix.Banded.Basic as Banded
import qualified Numeric.LAPACK.Matrix.Triangular.Basic as Triangular
import qualified Numeric.LAPACK.Matrix.Mosaic.Basic as Mosaic
import qualified Numeric.LAPACK.Matrix.Plain as Plain
import qualified Numeric.LAPACK.Matrix.Basic as Basic
import qualified Numeric.LAPACK.Matrix.Shape.Omni as Omni
import qualified Numeric.LAPACK.Matrix.Shape as MatrixShape
import qualified Numeric.LAPACK.Matrix.Layout.Private as Layout
import qualified Numeric.LAPACK.Matrix.Extent.Private as Extent
import qualified Numeric.LAPACK.Matrix.Extent.Strict as ExtentStrict
import qualified Numeric.LAPACK.Vector as Vector
import Numeric.LAPACK.Matrix.Plain.Format (formatArray)
import Numeric.LAPACK.Matrix.Shape.Omni (Omni, Arbitrary)
import Numeric.LAPACK.Matrix.Layout.Private (Filled, Bands, Packed, Unpacked)
import Numeric.LAPACK.Matrix.Extent.Private (Extent, Shape, Size, Big, Small)
import Numeric.LAPACK.Matrix.Type (Matrix)
import Numeric.LAPACK.Vector (Vector)
import Numeric.LAPACK.Scalar (RealOf)

import qualified Type.Data.Num.Unary as Unary
import qualified Type.Data.Bool as TBool
import Type.Data.Bool (True)

import qualified Numeric.Netlib.Class as Class

import qualified Control.DeepSeq as DeepSeq

import qualified Data.Array.Comfort.Storable.Unchecked as Array
import qualified Data.Array.Comfort.Storable as CheckedArray
import qualified Data.Array.Comfort.Shape as Shape
import Data.Function.HT (Id)

import Foreign.Storable (Storable)

import Prelude hiding (negate)


type OmniArray pack prop lower upper meas vert horiz height width a =
      Array.Array (Omni pack prop lower upper meas vert horiz height width) a

data Array pack property
data instance
      Matrix (Array pack prop) xl xu
         lower upper meas vert horiz height width a where
   Array ::
      OmniArray pack prop lower upper meas vert horiz height width a ->
      Matrix (Array pack prop) () () lower upper meas vert horiz height width a

deriving instance
   (Extent.Measure meas, Extent.C vert, Extent.C horiz,
    Shape.C height, Shape.C width, Storable a,
    Show height, Show width, Show a) =>
   Show (Matrix (Array pack prop) xl xu
            lower upper meas vert horiz height width a)

type ArrayMatrix pack property = Matrix (Array pack property) () ()
type UnpackedMatrix property = ArrayMatrix Unpacked property


type Full meas vert horiz height width =
         UnpackedMatrix Arbitrary Filled Filled meas vert horiz height width
type General height width = Full Size Big Big height width
type Tall height width = Full Size Big Small height width
type Wide height width = Full Size Small Big height width
type LiberalSquare height width = SquareMeas Size height width
type Square sh = SquareMeas Shape sh sh
type SquareMeas meas height width = Full meas Small Small height width

type Quadratic pack property lower upper sh =
         QuadraticMeas pack property lower upper Shape sh sh
type FullQuadratic pack property sh = Quadratic pack property Filled Filled sh

type QuadraticMeas pack property lower upper meas height width =
         ArrayMatrix pack property lower upper meas Small Small height width


instance Matrix.NFData (Array pack property) where
   rnf :: Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> ()
rnf (Array arr) = OmniArray pack property lower upper meas vert horiz height width a
-> ()
forall a. NFData a => a -> ()
DeepSeq.rnf OmniArray pack property lower upper meas vert horiz height width a
arr

instance Matrix.Box (Array pack property) where
   extent :: Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
extent (Array arr) = Omni pack property lower upper meas vert horiz height width
-> Extent meas vert horiz height width
forall meas vert horiz pack property lower upper height width.
(Measure meas, C vert, C horiz) =>
Omni pack property lower upper meas vert horiz height width
-> Extent meas vert horiz height width
Omni.extent (Omni pack property lower upper meas vert horiz height width
 -> Extent meas vert horiz height width)
-> Omni pack property lower upper meas vert horiz height width
-> Extent meas vert horiz height width
forall a b. (a -> b) -> a -> b
$ Array
  (Omni pack property lower upper meas vert horiz height width) a
-> Omni pack property lower upper meas vert horiz height width
forall sh a. Array sh a -> sh
Array.shape Array
  (Omni pack property lower upper meas vert horiz height width) a
arr

instance Matrix.Transpose (Array pack property) where
   transpose :: Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Matrix
     (Array pack property)
     xu
     xl
     upper
     lower
     meas
     horiz
     vert
     width
     height
     a
transpose a :: Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
a@(Array _) =
      case ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
shape Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a of
         Omni.Full Full meas vert horiz height width
_ -> (FullArray meas vert horiz height width a
 -> FullArray meas horiz vert width height a)
-> UnpackedMatrix
     property lower upper meas vert horiz height width a
-> UnpackedMatrix
     property upper lower meas horiz vert width height a
forall propertyA lowerA upperA propertyB lowerB upperB measA vertA
       horizA heightA widthA a measB vertB horizB heightB widthB b.
(Property propertyA, Strip lowerA, Strip upperA,
 Property propertyB, Strip lowerB, Strip upperB) =>
(FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
liftUnpacked1 FullArray meas vert horiz height width a
-> FullArray meas horiz vert width height a
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz) =>
Full meas vert horiz height width a
-> Full meas horiz vert width height a
Basic.transpose Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
UnpackedMatrix property lower upper meas vert horiz height width a
a
         Omni.UpperTriangular UpperTriangular height
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property upper lower meas horiz vert width height a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property upper lower meas horiz vert width height 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
lift1 PlainArray pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property upper lower meas horiz vert width height a
forall uplo pack mirror sh a.
UpLo uplo =>
Mosaic pack mirror uplo sh a
-> Mosaic pack mirror (TriTransposed uplo) sh a
Mosaic.transpose Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.LowerTriangular LowerTriangular height
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property upper lower meas horiz vert width height a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property upper lower meas horiz vert width height 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
lift1 PlainArray pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property upper lower meas horiz vert width height a
forall uplo pack mirror sh a.
UpLo uplo =>
Mosaic pack mirror uplo sh a
-> Mosaic pack mirror (TriTransposed uplo) sh a
Mosaic.transpose Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.Symmetric Symmetric height
_ -> Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
Matrix
  (Array pack property)
  xu
  xl
  upper
  lower
  meas
  horiz
  vert
  width
  height
  a
a
         Omni.Hermitian Hermitian height
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property upper lower meas horiz vert width height a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property upper lower meas horiz vert width height 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
lift1 PlainArray pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property upper lower meas horiz vert width height a
forall sh a. (C sh, Floating a) => Vector sh a -> Vector sh a
Vector.conjugate Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.Banded Banded sub super meas vert horiz height width
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property upper lower meas horiz vert width height a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property upper lower meas horiz vert width height 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
lift1 PlainArray pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property upper lower meas horiz vert width height a
forall meas vert horiz sub super height width a.
(Measure meas, C vert, C horiz) =>
Banded sub super meas vert horiz height width a
-> Banded super sub meas horiz vert width height a
Banded.transpose Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.UnitBandedTriangular BandedSquare sub super height
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property upper lower meas horiz vert width height a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property upper lower meas horiz vert width height 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
lift1 PlainArray pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property upper lower meas horiz vert width height a
forall meas vert horiz sub super height width a.
(Measure meas, C vert, C horiz) =>
Banded sub super meas vert horiz height width a
-> Banded super sub meas horiz vert width height a
Banded.transpose Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.BandedHermitian BandedHermitian offDiag height
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property upper lower meas horiz vert width height a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property upper lower meas horiz vert width height 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
lift1 PlainArray pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property upper lower meas horiz vert width height a
forall sh a. (C sh, Floating a) => Vector sh a -> Vector sh a
Vector.conjugate Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a


asPacked ::
   Id (ArrayMatrix Packed property lower upper meas vert horiz height width a)
asPacked :: Id
  (ArrayMatrix
     Packed property lower upper meas vert horiz height width a)
asPacked = Id
  (ArrayMatrix
     Packed property lower upper meas vert horiz height width a)
forall a. a -> a
id

asUnpacked ::
   Id (ArrayMatrix Unpacked property lower upper meas vert horiz height width a)
asUnpacked :: Id
  (ArrayMatrix
     Unpacked property lower upper meas vert horiz height width a)
asUnpacked = Id
  (ArrayMatrix
     Unpacked property lower upper meas vert horiz height width a)
forall a. a -> a
id

requirePacking ::
   Layout.PackingSingleton pack ->
   Id (ArrayMatrix pack property lower upper meas vert horiz height width a)
requirePacking :: PackingSingleton pack
-> Id
     (ArrayMatrix
        pack property lower upper meas vert horiz height width a)
requirePacking PackingSingleton pack
_ = Id
  (ArrayMatrix
     pack property lower upper meas vert horiz height width a)
forall a. a -> a
id


plainShape ::
   (Omni.ToPlain pack property lower upper meas vert horiz height width) =>
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   Omni.Plain pack property lower upper meas vert horiz height width
plainShape :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Plain pack property lower upper meas vert horiz height width
plainShape = Omni pack property lower upper meas vert horiz height width
-> Plain pack property lower upper meas vert horiz height width
forall pack property lower upper meas vert horiz height width.
ToPlain pack property lower upper meas vert horiz height width =>
Omni pack property lower upper meas vert horiz height width
-> Plain pack property lower upper meas vert horiz height width
Omni.toPlain (Omni pack property lower upper meas vert horiz height width
 -> Plain pack property lower upper meas vert horiz height width)
-> (ArrayMatrix
      pack property lower upper meas vert horiz height width a
    -> Omni pack property lower upper meas vert horiz height width)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> Plain pack property lower upper meas vert horiz height width
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
shape

shape ::
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   Omni pack property lower upper meas vert horiz height width
shape :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
shape (Array a) = Array
  (Omni pack property lower upper meas vert horiz height width) a
-> Omni pack property lower upper meas vert horiz height width
forall sh a. Array sh a -> sh
Array.shape Array
  (Omni pack property lower upper meas vert horiz height width) a
a

extent ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz) =>
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   Extent meas vert horiz height width
extent :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Extent meas vert horiz height width
extent = Omni pack property lower upper meas vert horiz height width
-> Extent meas vert horiz height width
forall meas vert horiz pack property lower upper height width.
(Measure meas, C vert, C horiz) =>
Omni pack property lower upper meas vert horiz height width
-> Extent meas vert horiz height width
Omni.extent (Omni pack property lower upper meas vert horiz height width
 -> Extent meas vert horiz height width)
-> (ArrayMatrix
      pack property lower upper meas vert horiz height width a
    -> Omni pack property lower upper meas vert horiz height width)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> Extent meas vert horiz height width
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
shape


subBandsSingleton ::
   (Unary.Natural sub) =>
   ArrayMatrix pack property
      (Layout.Bands sub) upper meas vert horiz height width a ->
   Unary.HeadSingleton sub
subBandsSingleton :: ArrayMatrix
  pack property (Bands sub) upper meas vert horiz height width a
-> HeadSingleton sub
subBandsSingleton ArrayMatrix
  pack property (Bands sub) upper meas vert horiz height width a
_ = HeadSingleton sub
forall n. Natural n => HeadSingleton n
Unary.headSingleton

superBandsSingleton ::
   (Unary.Natural super) =>
   ArrayMatrix pack property
      lower (Layout.Bands super) meas vert horiz height width a ->
   Unary.HeadSingleton super
superBandsSingleton :: ArrayMatrix
  pack property lower (Bands super) meas vert horiz height width a
-> HeadSingleton super
superBandsSingleton ArrayMatrix
  pack property lower (Bands super) meas vert horiz height width a
_ = HeadSingleton super
forall n. Natural n => HeadSingleton n
Unary.headSingleton


reshape ::
   (Extent.Measure measA, Extent.C vertA, Extent.C horizA) =>
   (Extent.Measure measB, Extent.C vertB, Extent.C horizB) =>
   (Shape.C heightA, Shape.C widthA) =>
   (Shape.C heightB, Shape.C widthB) =>
   Omni packB propB lowerB upperB measB vertB horizB heightB widthB ->
   ArrayMatrix packA propA lowerA upperA measA vertA horizA heightA widthA a ->
   ArrayMatrix packB propB lowerB upperB measB vertB horizB heightB widthB a
reshape :: Omni packB propB lowerB upperB measB vertB horizB heightB widthB
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB a
reshape = (OmniArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> OmniArray
      packB propB lowerB upperB measB vertB horizB heightB widthB a)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       a packB propB lowerB upperB measB vertB horizB heightB widthB b.
(OmniArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> OmniArray
      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
liftOmni1 ((OmniArray
    packA propA lowerA upperA measA vertA horizA heightA widthA a
  -> OmniArray
       packB propB lowerB upperB measB vertB horizB heightB widthB a)
 -> ArrayMatrix
      packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB a)
-> (Omni
      packB propB lowerB upperB measB vertB horizB heightB widthB
    -> OmniArray
         packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> OmniArray
         packB propB lowerB upperB measB vertB horizB heightB widthB a)
-> Omni packB propB lowerB upperB measB vertB horizB heightB widthB
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Omni packB propB lowerB upperB measB vertB horizB heightB widthB
-> OmniArray
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> OmniArray
     packB propB lowerB upperB measB vertB horizB heightB widthB a
forall sh0 sh1 a.
(C sh0, C sh1) =>
sh1 -> Array sh0 a -> Array sh1 a
CheckedArray.reshape

mapShape ::
   (Extent.Measure measA, Extent.C vertA, Extent.C horizA) =>
   (Extent.Measure measB, Extent.C vertB, Extent.C horizB) =>
   (Shape.C heightA, Shape.C widthA) =>
   (Shape.C heightB, Shape.C widthB) =>
   (Omni packA propA lowerA upperA measA vertA horizA heightA widthA ->
    Omni packB propB lowerB upperB measB vertB horizB heightB widthB) ->
   ArrayMatrix packA propA lowerA upperA measA vertA horizA heightA widthA a ->
   ArrayMatrix packB propB lowerB upperB measB vertB horizB heightB widthB a
mapShape :: (Omni packA propA lowerA upperA measA vertA horizA heightA widthA
 -> Omni
      packB propB lowerB upperB measB vertB horizB heightB widthB)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB a
mapShape = (OmniArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> OmniArray
      packB propB lowerB upperB measB vertB horizB heightB widthB a)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       a packB propB lowerB upperB measB vertB horizB heightB widthB b.
(OmniArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> OmniArray
      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
liftOmni1 ((OmniArray
    packA propA lowerA upperA measA vertA horizA heightA widthA a
  -> OmniArray
       packB propB lowerB upperB measB vertB horizB heightB widthB a)
 -> ArrayMatrix
      packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB a)
-> ((Omni
       packA propA lowerA upperA measA vertA horizA heightA widthA
     -> Omni
          packB propB lowerB upperB measB vertB horizB heightB widthB)
    -> OmniArray
         packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> OmniArray
         packB propB lowerB upperB measB vertB horizB heightB widthB a)
-> (Omni
      packA propA lowerA upperA measA vertA horizA heightA widthA
    -> Omni
         packB propB lowerB upperB measB vertB horizB heightB widthB)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Omni packA propA lowerA upperA measA vertA horizA heightA widthA
 -> Omni
      packB propB lowerB upperB measB vertB horizB heightB widthB)
-> OmniArray
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> OmniArray
     packB propB lowerB upperB measB vertB horizB heightB widthB a
forall sh0 sh1 a.
(C sh0, C sh1) =>
(sh0 -> sh1) -> Array sh0 a -> Array sh1 a
CheckedArray.mapShape


type PlainArray pack prop lower upper meas vert horiz height width =
   Array.Array (Omni.Plain pack prop lower upper meas vert horiz height width)

toVector ::
   (Omni.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
toVector :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper meas vert horiz height width a
toVector (Array a) = (Omni pack property lower upper meas vert horiz height width
 -> Plain pack property lower upper meas vert horiz height width)
-> Array
     (Omni pack property lower upper meas vert horiz height width) a
-> PlainArray
     pack property lower upper meas vert horiz height width a
forall sh0 sh1 a. (sh0 -> sh1) -> Array sh0 a -> Array sh1 a
Array.mapShape Omni pack property lower upper meas vert horiz height width
-> Plain pack property lower upper meas vert horiz height width
forall pack property lower upper meas vert horiz height width.
ToPlain pack property lower upper meas vert horiz height width =>
Omni pack property lower upper meas vert horiz height width
-> Plain pack property lower upper meas vert horiz height width
Omni.toPlain Array
  (Omni pack property lower upper meas vert horiz height width) a
a

unwrap ::
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   OmniArray pack property lower upper meas vert horiz height width a
unwrap :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> OmniArray
     pack property lower upper meas vert horiz height width a
unwrap (Array a) = OmniArray pack property lower upper meas vert horiz height width a
a

fromVector ::
   (Omni.FromPlain pack prop lower upper meas vert horiz height width) =>
   (Omni.Plain pack prop lower upper meas vert horiz height width ~ shape) =>
   (Extent.Measure meas, Extent.C vert, Extent.C horiz) =>
   (Shape.C height, Shape.C width, Class.Floating a) =>
   Array.Array shape a ->
   ArrayMatrix pack prop lower upper meas vert horiz height width a
fromVector :: Array shape a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
fromVector Array shape a
arr =
   let omni :: Omni pack prop lower upper meas vert horiz height width
omni = Plain pack prop lower upper meas vert horiz height width
-> Omni pack prop lower upper meas vert horiz height width
forall pack property lower upper meas vert horiz height width.
FromPlain pack property lower upper meas vert horiz height width =>
Plain pack property lower upper meas vert horiz height width
-> Omni pack property lower upper meas vert horiz height width
Omni.fromPlain (Plain pack prop lower upper meas vert horiz height width
 -> Omni pack prop lower upper meas vert horiz height width)
-> Plain pack prop lower upper meas vert horiz height width
-> Omni pack prop lower upper meas vert horiz height width
forall a b. (a -> b) -> a -> b
$ Array shape a -> shape
forall sh a. Array sh a -> sh
Array.shape Array shape a
arr
   in case Omni pack prop lower upper meas vert horiz height width
-> Array shape a -> Maybe String
forall pack property lower upper meas vert horiz height width shape
       a.
(Plain pack property lower upper meas vert horiz height width
 ~ shape,
 Measure meas, C vert, C horiz, C height, C width, Floating a) =>
Omni pack property lower upper meas vert horiz height width
-> Array shape a -> Maybe String
ArrClass.check Omni pack prop lower upper meas vert horiz height width
omni Array shape a
arr of
         Maybe String
Nothing -> OmniArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
forall pack prop lower upper meas vert horiz height width a.
OmniArray pack prop lower upper meas vert horiz height width a
-> Matrix
     (Array pack prop) () () lower upper meas vert horiz height width a
Array (OmniArray pack prop lower upper meas vert horiz height width a
 -> ArrayMatrix
      pack prop lower upper meas vert horiz height width a)
-> OmniArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
forall a b. (a -> b) -> a -> b
$ Omni pack prop lower upper meas vert horiz height width
-> Array shape a
-> OmniArray pack prop lower upper meas vert horiz height width a
forall sh1 sh0 a. sh1 -> Array sh0 a -> Array sh1 a
Array.reshape Omni pack prop lower upper meas vert horiz height width
omni Array shape a
arr
         Just String
msg -> String
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
forall a. HasCallStack => String -> a
error (String
 -> ArrayMatrix
      pack prop lower upper meas vert horiz height width a)
-> String
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
forall a b. (a -> b) -> a -> b
$ String
"Matrix.Array.fromVector: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
msg


{- |
'lift0' is a synonym for 'fromVector' but lacks the admissibility check.
You may thus fool the type tags.
This applies to the other lift functions, too.
-}
lift0 ::
   (Omni.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
lift0 :: PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
lift0 = OmniArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
forall pack prop lower upper meas vert horiz height width a.
OmniArray pack prop lower upper meas vert horiz height width a
-> Matrix
     (Array pack prop) () () lower upper meas vert horiz height width a
Array (OmniArray pack prop lower upper meas vert horiz height width a
 -> ArrayMatrix
      pack prop lower upper meas vert horiz height width a)
-> (PlainArray pack prop lower upper meas vert horiz height width a
    -> OmniArray pack prop lower upper meas vert horiz height width a)
-> PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Plain pack prop lower upper meas vert horiz height width
 -> Omni pack prop lower upper meas vert horiz height width)
-> PlainArray pack prop lower upper meas vert horiz height width a
-> OmniArray pack prop lower upper meas vert horiz height width a
forall sh0 sh1 a. (sh0 -> sh1) -> Array sh0 a -> Array sh1 a
Array.mapShape Plain pack prop lower upper meas vert horiz height width
-> Omni pack prop lower upper meas vert horiz height width
forall pack property lower upper meas vert horiz height width.
FromPlain pack property lower upper meas vert horiz height width =>
Plain pack property lower upper meas vert horiz height width
-> Omni pack property lower upper meas vert horiz height width
Omni.fromPlain

lift1 ::
   (Omni.ToPlain packA propA lowerA upperA measA vertA horizA heightA widthA) =>
   (Omni.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
lift1 :: (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
lift1 PlainArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
f = PlainArray
  packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
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
lift0 (PlainArray
   packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> (ArrayMatrix
      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
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PlainArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
f (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
    -> PlainArray
         packA propA lowerA upperA measA vertA horizA heightA widthA a)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArrayMatrix
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA 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
toVector

lift2 ::
   (Omni.ToPlain packA propA lowerA upperA measA vertA horizA heightA widthA) =>
   (Omni.ToPlain packB propB lowerB upperB measB vertB horizB heightB widthB) =>
   (Omni.FromPlain packC propC lowerC upperC measC vertC horizC heightC widthC)
                                                                              =>
   (PlainArray packA propA lowerA upperA measA vertA horizA heightA widthA a ->
    PlainArray packB propB lowerB upperB measB vertB horizB heightB widthB b ->
    PlainArray packC propC lowerC upperC measC vertC horizC heightC widthC c) ->
   ArrayMatrix packA propA lowerA upperA measA vertA horizA heightA widthA a ->
   ArrayMatrix packB propB lowerB upperB measB vertB horizB heightB widthB b ->
   ArrayMatrix packC propC lowerC upperC measC vertC horizC heightC widthC c
lift2 :: (PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
lift2 PlainArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
f = (PlainArray
   packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
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
lift1 ((PlainArray
    packB propB lowerB upperB measB vertB horizB heightB widthB b
  -> PlainArray
       packC propC lowerC upperC measC vertC horizC heightC widthC c)
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> ArrayMatrix
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> (ArrayMatrix
      packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> PlainArray
         packB propB lowerB upperB measB vertB horizB heightB widthB b
    -> PlainArray
         packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PlainArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
f (PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> (ArrayMatrix
      packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> PlainArray
         packA propA lowerA upperA measA vertA horizA heightA widthA a)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArrayMatrix
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA 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
toVector

lift3 ::
   (Omni.ToPlain packA propA lowerA upperA measA vertA horizA heightA widthA) =>
   (Omni.ToPlain packB propB lowerB upperB measB vertB horizB heightB widthB) =>
   (Omni.ToPlain packC propC lowerC upperC measC vertC horizC heightC widthC) =>
   (Omni.FromPlain packD propD lowerD upperD measD vertD horizD heightD widthD)
                                                                              =>
   (PlainArray packA propA lowerA upperA measA vertA horizA heightA widthA a ->
    PlainArray packB propB lowerB upperB measB vertB horizB heightB widthB b ->
    PlainArray packC propC lowerC upperC measC vertC horizC heightC widthC c ->
    PlainArray packD propD lowerD upperD measD vertD horizD heightD widthD d) ->
   ArrayMatrix packA propA lowerA upperA measA vertA horizA heightA widthA a ->
   ArrayMatrix packB propB lowerB upperB measB vertB horizB heightB widthB b ->
   ArrayMatrix packC propC lowerC upperC measC vertC horizC heightC widthC c ->
   ArrayMatrix packD propD lowerD upperD measD vertD horizD heightD widthD d
lift3 :: (PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c
 -> PlainArray
      packD propD lowerD upperD measD vertD horizD heightD widthD d)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> ArrayMatrix
     packD propD lowerD upperD measD vertD horizD heightD widthD d
lift3 PlainArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> PlainArray
     packD propD lowerD upperD measD vertD horizD heightD widthD d
f = (PlainArray
   packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c
 -> PlainArray
      packD propD lowerD upperD measD vertD horizD heightD widthD d)
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> ArrayMatrix
     packD propD lowerD upperD measD vertD horizD heightD widthD d
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB packC
       propC lowerC upperC measC vertC horizC heightC widthC a b c.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 ToPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB,
 FromPlain
   packC propC lowerC upperC measC vertC horizC heightC widthC) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
lift2 ((PlainArray
    packB propB lowerB upperB measB vertB horizB heightB widthB b
  -> PlainArray
       packC propC lowerC upperC measC vertC horizC heightC widthC c
  -> PlainArray
       packD propD lowerD upperD measD vertD horizD heightD widthD d)
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> ArrayMatrix
      packC propC lowerC upperC measC vertC horizC heightC widthC c
 -> ArrayMatrix
      packD propD lowerD upperD measD vertD horizD heightD widthD d)
-> (ArrayMatrix
      packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> PlainArray
         packB propB lowerB upperB measB vertB horizB heightB widthB b
    -> PlainArray
         packC propC lowerC upperC measC vertC horizC heightC widthC c
    -> PlainArray
         packD propD lowerD upperD measD vertD horizD heightD widthD d)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> ArrayMatrix
     packD propD lowerD upperD measD vertD horizD heightD widthD d
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PlainArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> PlainArray
     packD propD lowerD upperD measD vertD horizD heightD widthD d
f (PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c
 -> PlainArray
      packD propD lowerD upperD measD vertD horizD heightD widthD d)
-> (ArrayMatrix
      packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> PlainArray
         packA propA lowerA upperA measA vertA horizA heightA widthA a)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> PlainArray
     packD propD lowerD upperD measD vertD horizD heightD widthD d
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArrayMatrix
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA 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
toVector

lift4 ::
   (Omni.ToPlain packA propA lowerA upperA measA vertA horizA heightA widthA) =>
   (Omni.ToPlain packB propB lowerB upperB measB vertB horizB heightB widthB) =>
   (Omni.ToPlain packC propC lowerC upperC measC vertC horizC heightC widthC) =>
   (Omni.ToPlain packD propD lowerD upperD measD vertD horizD heightD widthD) =>
   (Omni.FromPlain packE propE lowerE upperE measE vertE horizE heightE widthE)
                                                                              =>
   (PlainArray packA propA lowerA upperA measA vertA horizA heightA widthA a ->
    PlainArray packB propB lowerB upperB measB vertB horizB heightB widthB b ->
    PlainArray packC propC lowerC upperC measC vertC horizC heightC widthC c ->
    PlainArray packD propD lowerD upperD measD vertD horizD heightD widthD d ->
    PlainArray packE propE lowerE upperE measE vertE horizE heightE widthE e) ->
   ArrayMatrix packA propA lowerA upperA measA vertA horizA heightA widthA a ->
   ArrayMatrix packB propB lowerB upperB measB vertB horizB heightB widthB b ->
   ArrayMatrix packC propC lowerC upperC measC vertC horizC heightC widthC c ->
   ArrayMatrix packD propD lowerD upperD measD vertD horizD heightD widthD d ->
   ArrayMatrix packE propE lowerE upperE measE vertE horizE heightE widthE e
lift4 :: (PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c
 -> PlainArray
      packD propD lowerD upperD measD vertD horizD heightD widthD d
 -> PlainArray
      packE propE lowerE upperE measE vertE horizE heightE widthE e)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> ArrayMatrix
     packD propD lowerD upperD measD vertD horizD heightD widthD d
-> ArrayMatrix
     packE propE lowerE upperE measE vertE horizE heightE widthE e
lift4 PlainArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> PlainArray
     packD propD lowerD upperD measD vertD horizD heightD widthD d
-> PlainArray
     packE propE lowerE upperE measE vertE horizE heightE widthE e
f = (PlainArray
   packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c
 -> PlainArray
      packD propD lowerD upperD measD vertD horizD heightD widthD d
 -> PlainArray
      packE propE lowerE upperE measE vertE horizE heightE widthE e)
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> ArrayMatrix
     packD propD lowerD upperD measD vertD horizD heightD widthD d
-> ArrayMatrix
     packE propE lowerE upperE measE vertE horizE heightE widthE e
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB packC
       propC lowerC upperC measC vertC horizC heightC widthC packD propD
       lowerD upperD measD vertD horizD heightD widthD a b c d.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 ToPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB,
 ToPlain
   packC propC lowerC upperC measC vertC horizC heightC widthC,
 FromPlain
   packD propD lowerD upperD measD vertD horizD heightD widthD) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c
 -> PlainArray
      packD propD lowerD upperD measD vertD horizD heightD widthD d)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> ArrayMatrix
     packD propD lowerD upperD measD vertD horizD heightD widthD d
lift3 ((PlainArray
    packB propB lowerB upperB measB vertB horizB heightB widthB b
  -> PlainArray
       packC propC lowerC upperC measC vertC horizC heightC widthC c
  -> PlainArray
       packD propD lowerD upperD measD vertD horizD heightD widthD d
  -> PlainArray
       packE propE lowerE upperE measE vertE horizE heightE widthE e)
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> ArrayMatrix
      packC propC lowerC upperC measC vertC horizC heightC widthC c
 -> ArrayMatrix
      packD propD lowerD upperD measD vertD horizD heightD widthD d
 -> ArrayMatrix
      packE propE lowerE upperE measE vertE horizE heightE widthE e)
-> (ArrayMatrix
      packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> PlainArray
         packB propB lowerB upperB measB vertB horizB heightB widthB b
    -> PlainArray
         packC propC lowerC upperC measC vertC horizC heightC widthC c
    -> PlainArray
         packD propD lowerD upperD measD vertD horizD heightD widthD d
    -> PlainArray
         packE propE lowerE upperE measE vertE horizE heightE widthE e)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> ArrayMatrix
     packD propD lowerD upperD measD vertD horizD heightD widthD d
-> ArrayMatrix
     packE propE lowerE upperE measE vertE horizE heightE widthE e
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PlainArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> PlainArray
     packD propD lowerD upperD measD vertD horizD heightD widthD d
-> PlainArray
     packE propE lowerE upperE measE vertE horizE heightE widthE e
f (PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c
 -> PlainArray
      packD propD lowerD upperD measD vertD horizD heightD widthD d
 -> PlainArray
      packE propE lowerE upperE measE vertE horizE heightE widthE e)
-> (ArrayMatrix
      packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> PlainArray
         packA propA lowerA upperA measA vertA horizA heightA widthA a)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> PlainArray
     packD propD lowerD upperD measD vertD horizD heightD widthD d
-> PlainArray
     packE propE lowerE upperE measE vertE horizE heightE widthE e
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArrayMatrix
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA 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
toVector


unlift1 ::
   (Omni.FromPlain packA propA lowerA upperA measA vertA horizA heightA widthA)
                                                                              =>
   (Omni.ToPlain packB propB lowerB upperB measB vertB horizB heightB widthB) =>
   (ArrayMatrix packA propA lowerA upperA measA vertA horizA heightA widthA a ->
    ArrayMatrix packB propB lowerB upperB measB vertB horizB heightB widthB b) ->
   (PlainArray packA propA lowerA upperA measA vertA horizA heightA widthA a ->
    PlainArray packB propB lowerB upperB measB vertB horizB heightB widthB b)
unlift1 :: (ArrayMatrix
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
unlift1 ArrayMatrix
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
f = ArrayMatrix
  packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
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
toVector (ArrayMatrix
   packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> (PlainArray
      packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> ArrayMatrix
         packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArrayMatrix
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
f (ArrayMatrix
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> (PlainArray
      packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> ArrayMatrix
         packA propA lowerA upperA measA vertA horizA heightA widthA a)
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PlainArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA 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
lift0

unlift2 ::
   (Omni.FromPlain packA propA lowerA upperA measA vertA horizA heightA widthA,
    Omni.FromPlain packB propB lowerB upperB measB vertB horizB heightB widthB)
                                                                              =>
   (Omni.ToPlain packC propC lowerC upperC measC vertC horizC heightC widthC) =>
   (ArrayMatrix packA propA lowerA upperA measA vertA horizA heightA widthA a ->
    ArrayMatrix packB propB lowerB upperB measB vertB horizB heightB widthB b ->
    ArrayMatrix packC propC lowerC upperC measC vertC horizC heightC widthC c) ->
   (PlainArray packA propA lowerA upperA measA vertA horizA heightA widthA a ->
    PlainArray packB propB lowerB upperB measB vertB horizB heightB widthB b ->
    PlainArray packC propC lowerC upperC measC vertC horizC heightC widthC c)
unlift2 :: (ArrayMatrix
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> ArrayMatrix
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
unlift2 ArrayMatrix
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
f = (ArrayMatrix
   packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> ArrayMatrix
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(FromPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 ToPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(ArrayMatrix
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
unlift1 ((ArrayMatrix
    packB propB lowerB upperB measB vertB horizB heightB widthB b
  -> ArrayMatrix
       packC propC lowerC upperC measC vertC horizC heightC widthC c)
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> (PlainArray
      packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> ArrayMatrix
         packB propB lowerB upperB measB vertB horizB heightB widthB b
    -> ArrayMatrix
         packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> PlainArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArrayMatrix
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
f (ArrayMatrix
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> ArrayMatrix
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> (PlainArray
      packA propA lowerA upperA measA vertA horizA heightA widthA a
    -> ArrayMatrix
         packA propA lowerA upperA measA vertA horizA heightA widthA a)
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PlainArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA 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
lift0


type FullArray meas vert horiz height width =
      Array.Array (Layout.Full meas vert horiz height width)

unpackedToVector ::
   (Omni.Property property, Omni.Strip lower, Omni.Strip upper) =>
   UnpackedMatrix property lower upper meas vert horiz height width a ->
   FullArray meas vert horiz height width a
unpackedToVector :: UnpackedMatrix property lower upper meas vert horiz height width a
-> FullArray meas vert horiz height width a
unpackedToVector = (Omni Unpacked property lower upper meas vert horiz height width
 -> Full meas vert horiz height width)
-> Array
     (Omni Unpacked property lower upper meas vert horiz height width) a
-> FullArray meas vert horiz height width a
forall sh0 sh1 a. (sh0 -> sh1) -> Array sh0 a -> Array sh1 a
Array.mapShape Omni Unpacked property lower upper meas vert horiz height width
-> Full meas vert horiz height width
forall property lower upper meas vert horiz height width.
(Property property, Strip lower, Strip upper) =>
Omni Unpacked property lower upper meas vert horiz height width
-> Full meas vert horiz height width
Omni.toFull (Array
   (Omni Unpacked property lower upper meas vert horiz height width) a
 -> FullArray meas vert horiz height width a)
-> (UnpackedMatrix
      property lower upper meas vert horiz height width a
    -> Array
         (Omni Unpacked property lower upper meas vert horiz height width)
         a)
-> UnpackedMatrix
     property lower upper meas vert horiz height width a
-> FullArray meas vert horiz height width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UnpackedMatrix property lower upper meas vert horiz height width a
-> Array
     (Omni Unpacked property lower upper meas vert horiz height width) a
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> OmniArray
     pack property lower upper meas vert horiz height width a
unwrap

liftUnpacked0 ::
   (Omni.Property propertyA, Omni.Strip lowerA, Omni.Strip upperA) =>
   (FullArray measA vertA horizA heightA widthA a) ->
   UnpackedMatrix propertyA lowerA upperA measA vertA horizA heightA widthA a
liftUnpacked0 :: FullArray measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
liftUnpacked0 = OmniArray
  Unpacked
  propertyA
  lowerA
  upperA
  measA
  vertA
  horizA
  heightA
  widthA
  a
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
forall pack prop lower upper meas vert horiz height width a.
OmniArray pack prop lower upper meas vert horiz height width a
-> Matrix
     (Array pack prop) () () lower upper meas vert horiz height width a
Array (OmniArray
   Unpacked
   propertyA
   lowerA
   upperA
   measA
   vertA
   horizA
   heightA
   widthA
   a
 -> UnpackedMatrix
      propertyA lowerA upperA measA vertA horizA heightA widthA a)
-> (FullArray measA vertA horizA heightA widthA a
    -> OmniArray
         Unpacked
         propertyA
         lowerA
         upperA
         measA
         vertA
         horizA
         heightA
         widthA
         a)
-> FullArray measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Full measA vertA horizA heightA widthA
 -> Omni
      Unpacked propertyA lowerA upperA measA vertA horizA heightA widthA)
-> FullArray measA vertA horizA heightA widthA a
-> OmniArray
     Unpacked
     propertyA
     lowerA
     upperA
     measA
     vertA
     horizA
     heightA
     widthA
     a
forall sh0 sh1 a. (sh0 -> sh1) -> Array sh0 a -> Array sh1 a
Array.mapShape Full measA vertA horizA heightA widthA
-> Omni
     Unpacked propertyA lowerA upperA measA vertA horizA heightA widthA
forall property lower upper meas vert horiz height width.
(Property property, Strip lower, Strip upper) =>
Full meas vert horiz height width
-> Omni Unpacked property lower upper meas vert horiz height width
Omni.fromFull

liftUnpacked1 ::
   (Omni.Property propertyA, Omni.Strip lowerA, Omni.Strip upperA) =>
   (Omni.Property propertyB, Omni.Strip lowerB, Omni.Strip upperB) =>
   (FullArray measA vertA horizA heightA widthA a ->
    FullArray measB vertB horizB heightB widthB b) ->
   UnpackedMatrix propertyA lowerA upperA measA vertA horizA heightA widthA a ->
   UnpackedMatrix propertyB lowerB upperB measB vertB horizB heightB widthB b
liftUnpacked1 :: (FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
liftUnpacked1 FullArray measA vertA horizA heightA widthA a
-> FullArray measB vertB horizB heightB widthB b
f = FullArray measB vertB horizB heightB widthB b
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
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
liftUnpacked0 (FullArray measB vertB horizB heightB widthB b
 -> UnpackedMatrix
      propertyB lowerB upperB measB vertB horizB heightB widthB b)
-> (UnpackedMatrix
      propertyA lowerA upperA measA vertA horizA heightA widthA a
    -> FullArray measB vertB horizB heightB widthB b)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FullArray measA vertA horizA heightA widthA a
-> FullArray measB vertB horizB heightB widthB b
f (FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b)
-> (UnpackedMatrix
      propertyA lowerA upperA measA vertA horizA heightA widthA a
    -> FullArray measA vertA horizA heightA widthA a)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> FullArray measB vertB horizB heightB widthB b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UnpackedMatrix
  propertyA lowerA upperA measA vertA horizA heightA widthA a
-> FullArray measA vertA horizA heightA widthA a
forall property lower upper meas vert horiz height width a.
(Property property, Strip lower, Strip upper) =>
UnpackedMatrix property lower upper meas vert horiz height width a
-> FullArray meas vert horiz height width a
unpackedToVector

liftUnpacked2 ::
   (Omni.Property propertyA, Omni.Strip lowerA, Omni.Strip upperA) =>
   (Omni.Property propertyB, Omni.Strip lowerB, Omni.Strip upperB) =>
   (Omni.Property propertyC, Omni.Strip lowerC, Omni.Strip upperC) =>
   (FullArray measA vertA horizA heightA widthA a ->
    FullArray measB vertB horizB heightB widthB b ->
    FullArray measC vertC horizC heightC widthC c) ->
   UnpackedMatrix propertyA lowerA upperA measA vertA horizA heightA widthA a ->
   UnpackedMatrix propertyB lowerB upperB measB vertB horizB heightB widthB b ->
   UnpackedMatrix propertyC lowerC upperC measC vertC horizC heightC widthC c
liftUnpacked2 :: (FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b
 -> FullArray measC vertC horizC heightC widthC c)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
-> UnpackedMatrix
     propertyC lowerC upperC measC vertC horizC heightC widthC c
liftUnpacked2 FullArray measA vertA horizA heightA widthA a
-> FullArray measB vertB horizB heightB widthB b
-> FullArray measC vertC horizC heightC widthC c
f = (FullArray measB vertB horizB heightB widthB b
 -> FullArray measC vertC horizC heightC widthC c)
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
-> UnpackedMatrix
     propertyC lowerC upperC measC vertC horizC heightC widthC c
forall propertyA lowerA upperA propertyB lowerB upperB measA vertA
       horizA heightA widthA a measB vertB horizB heightB widthB b.
(Property propertyA, Strip lowerA, Strip upperA,
 Property propertyB, Strip lowerB, Strip upperB) =>
(FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
liftUnpacked1 ((FullArray measB vertB horizB heightB widthB b
  -> FullArray measC vertC horizC heightC widthC c)
 -> UnpackedMatrix
      propertyB lowerB upperB measB vertB horizB heightB widthB b
 -> UnpackedMatrix
      propertyC lowerC upperC measC vertC horizC heightC widthC c)
-> (UnpackedMatrix
      propertyA lowerA upperA measA vertA horizA heightA widthA a
    -> FullArray measB vertB horizB heightB widthB b
    -> FullArray measC vertC horizC heightC widthC c)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
-> UnpackedMatrix
     propertyC lowerC upperC measC vertC horizC heightC widthC c
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FullArray measA vertA horizA heightA widthA a
-> FullArray measB vertB horizB heightB widthB b
-> FullArray measC vertC horizC heightC widthC c
f (FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b
 -> FullArray measC vertC horizC heightC widthC c)
-> (UnpackedMatrix
      propertyA lowerA upperA measA vertA horizA heightA widthA a
    -> FullArray measA vertA horizA heightA widthA a)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> FullArray measB vertB horizB heightB widthB b
-> FullArray measC vertC horizC heightC widthC c
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UnpackedMatrix
  propertyA lowerA upperA measA vertA horizA heightA widthA a
-> FullArray measA vertA horizA heightA widthA a
forall property lower upper meas vert horiz height width a.
(Property property, Strip lower, Strip upper) =>
UnpackedMatrix property lower upper meas vert horiz height width a
-> FullArray meas vert horiz height width a
unpackedToVector

liftUnpacked3 ::
   (Omni.Property propertyA, Omni.Strip lowerA, Omni.Strip upperA) =>
   (Omni.Property propertyB, Omni.Strip lowerB, Omni.Strip upperB) =>
   (Omni.Property propertyC, Omni.Strip lowerC, Omni.Strip upperC) =>
   (Omni.Property propertyD, Omni.Strip lowerD, Omni.Strip upperD) =>
   (FullArray measA vertA horizA heightA widthA a ->
    FullArray measB vertB horizB heightB widthB b ->
    FullArray measC vertC horizC heightC widthC c ->
    FullArray measD vertD horizD heightD widthD d) ->
   UnpackedMatrix propertyA lowerA upperA measA vertA horizA heightA widthA a ->
   UnpackedMatrix propertyB lowerB upperB measB vertB horizB heightB widthB b ->
   UnpackedMatrix propertyC lowerC upperC measC vertC horizC heightC widthC c ->
   UnpackedMatrix propertyD lowerD upperD measD vertD horizD heightD widthD d
liftUnpacked3 :: (FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b
 -> FullArray measC vertC horizC heightC widthC c
 -> FullArray measD vertD horizD heightD widthD d)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
-> UnpackedMatrix
     propertyC lowerC upperC measC vertC horizC heightC widthC c
-> UnpackedMatrix
     propertyD lowerD upperD measD vertD horizD heightD widthD d
liftUnpacked3 FullArray measA vertA horizA heightA widthA a
-> FullArray measB vertB horizB heightB widthB b
-> FullArray measC vertC horizC heightC widthC c
-> FullArray measD vertD horizD heightD widthD d
f = (FullArray measB vertB horizB heightB widthB b
 -> FullArray measC vertC horizC heightC widthC c
 -> FullArray measD vertD horizD heightD widthD d)
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
-> UnpackedMatrix
     propertyC lowerC upperC measC vertC horizC heightC widthC c
-> UnpackedMatrix
     propertyD lowerD upperD measD vertD horizD heightD widthD d
forall propertyA lowerA upperA propertyB lowerB upperB propertyC
       lowerC upperC measA vertA horizA heightA widthA a measB vertB
       horizB heightB widthB b measC vertC horizC heightC widthC c.
(Property propertyA, Strip lowerA, Strip upperA,
 Property propertyB, Strip lowerB, Strip upperB, Property propertyC,
 Strip lowerC, Strip upperC) =>
(FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b
 -> FullArray measC vertC horizC heightC widthC c)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
-> UnpackedMatrix
     propertyC lowerC upperC measC vertC horizC heightC widthC c
liftUnpacked2 ((FullArray measB vertB horizB heightB widthB b
  -> FullArray measC vertC horizC heightC widthC c
  -> FullArray measD vertD horizD heightD widthD d)
 -> UnpackedMatrix
      propertyB lowerB upperB measB vertB horizB heightB widthB b
 -> UnpackedMatrix
      propertyC lowerC upperC measC vertC horizC heightC widthC c
 -> UnpackedMatrix
      propertyD lowerD upperD measD vertD horizD heightD widthD d)
-> (UnpackedMatrix
      propertyA lowerA upperA measA vertA horizA heightA widthA a
    -> FullArray measB vertB horizB heightB widthB b
    -> FullArray measC vertC horizC heightC widthC c
    -> FullArray measD vertD horizD heightD widthD d)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
-> UnpackedMatrix
     propertyC lowerC upperC measC vertC horizC heightC widthC c
-> UnpackedMatrix
     propertyD lowerD upperD measD vertD horizD heightD widthD d
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FullArray measA vertA horizA heightA widthA a
-> FullArray measB vertB horizB heightB widthB b
-> FullArray measC vertC horizC heightC widthC c
-> FullArray measD vertD horizD heightD widthD d
f (FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b
 -> FullArray measC vertC horizC heightC widthC c
 -> FullArray measD vertD horizD heightD widthD d)
-> (UnpackedMatrix
      propertyA lowerA upperA measA vertA horizA heightA widthA a
    -> FullArray measA vertA horizA heightA widthA a)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> FullArray measB vertB horizB heightB widthB b
-> FullArray measC vertC horizC heightC widthC c
-> FullArray measD vertD horizD heightD widthD d
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UnpackedMatrix
  propertyA lowerA upperA measA vertA horizA heightA widthA a
-> FullArray measA vertA horizA heightA widthA a
forall property lower upper meas vert horiz height width a.
(Property property, Strip lower, Strip upper) =>
UnpackedMatrix property lower upper meas vert horiz height width a
-> FullArray meas vert horiz height width a
unpackedToVector


unliftRow ::
   Layout.Order ->
   (General () height0 a -> General () height1 b) ->
   Vector height0 a -> Vector height1 b
unliftRow :: Order
-> (General () height0 a -> General () height1 b)
-> Vector height0 a
-> Vector height1 b
unliftRow Order
order_ = Order
-> (General () height0 a -> General () height1 b)
-> Vector height0 a
-> Vector height1 b
forall height0 a height1 b.
Order
-> (General () height0 a -> General () height1 b)
-> Vector height0 a
-> Vector height1 b
Basic.unliftRow Order
order_ ((General () height0 a -> General () height1 b)
 -> Vector height0 a -> Vector height1 b)
-> ((General () height0 a -> General () height1 b)
    -> General () height0 a -> General () height1 b)
-> (General () height0 a -> General () height1 b)
-> Vector height0 a
-> Vector height1 b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (General () height0 a -> General () height1 b)
-> General () height0 a -> General () height1 b
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(FromPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 ToPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(ArrayMatrix
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
unlift1

unliftColumn ::
   Layout.Order ->
   (General height0 () a -> General height1 () b) ->
   Vector height0 a -> Vector height1 b
unliftColumn :: Order
-> (General height0 () a -> General height1 () b)
-> Vector height0 a
-> Vector height1 b
unliftColumn Order
order_ = Order
-> (General height0 () a -> General height1 () b)
-> Vector height0 a
-> Vector height1 b
forall height0 a height1 b.
Order
-> (General height0 () a -> General height1 () b)
-> Vector height0 a
-> Vector height1 b
Basic.unliftColumn Order
order_ ((General height0 () a -> General height1 () b)
 -> Vector height0 a -> Vector height1 b)
-> ((General height0 () a -> General height1 () b)
    -> General height0 () a -> General height1 () b)
-> (General height0 () a -> General height1 () b)
-> Vector height0 a
-> Vector height1 b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (General height0 () a -> General height1 () b)
-> General height0 () a -> General height1 () b
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(FromPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 ToPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(ArrayMatrix
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> PlainArray
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> PlainArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
unlift1


instance Matrix.FormatMatrix (Array pack property) where
   formatMatrix :: String
-> Matrix
     (Array pack property)
     xl
     xu
     lower
     upper
     meas
     vert
     horiz
     height
     width
     a
-> out
formatMatrix String
fmt a :: Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
a@(Array _) =
      case ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
shape Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a of
         Omni.Full Full meas vert horiz height width
fullShape ->
            String -> Array (Full meas vert horiz height width) a -> out
forall sh a out.
(FormatArray sh, Floating a, Output out) =>
String -> Array sh a -> out
formatArray String
fmt (Array (Full meas vert horiz height width) a -> out)
-> Array (Full meas vert horiz height width) a -> out
forall a b. (a -> b) -> a -> b
$ Full meas vert horiz height width
-> Array
     (Omni pack property lower upper meas vert horiz height width) a
-> Array (Full meas vert horiz height width) a
forall sh1 sh0 a. sh1 -> Array sh0 a -> Array sh1 a
Array.reshape Full meas vert horiz height width
fullShape (Array
   (Omni pack property lower upper meas vert horiz height width) a
 -> Array (Full meas vert horiz height width) a)
-> Array
     (Omni pack property lower upper meas vert horiz height width) a
-> Array (Full meas vert horiz height width) a
forall a b. (a -> b) -> a -> b
$ ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Array
     (Omni pack property lower upper meas vert horiz height width) a
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> OmniArray
     pack property lower upper meas vert horiz height width a
unwrap Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.UpperTriangular UpperTriangular height
_ -> String -> Array (UpperTriangular height) a -> out
forall sh a out.
(FormatArray sh, Floating a, Output out) =>
String -> Array sh a -> out
formatArray String
fmt (Array (UpperTriangular height) a -> out)
-> Array (UpperTriangular height) a -> out
forall a b. (a -> b) -> a -> b
$ ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper 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
toVector Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.LowerTriangular LowerTriangular height
_ -> String -> Array (LowerTriangular height) a -> out
forall sh a out.
(FormatArray sh, Floating a, Output out) =>
String -> Array sh a -> out
formatArray String
fmt (Array (LowerTriangular height) a -> out)
-> Array (LowerTriangular height) a -> out
forall a b. (a -> b) -> a -> b
$ ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper 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
toVector Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.Symmetric Symmetric height
_ -> String -> Array (Symmetric height) a -> out
forall sh a out.
(FormatArray sh, Floating a, Output out) =>
String -> Array sh a -> out
formatArray String
fmt (Array (Symmetric height) a -> out)
-> Array (Symmetric height) a -> out
forall a b. (a -> b) -> a -> b
$ ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper 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
toVector Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.Hermitian Hermitian height
_ -> String -> Array (Hermitian height) a -> out
forall sh a out.
(FormatArray sh, Floating a, Output out) =>
String -> Array sh a -> out
formatArray String
fmt (Array (Hermitian height) a -> out)
-> Array (Hermitian height) a -> out
forall a b. (a -> b) -> a -> b
$ ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper 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
toVector Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.Banded Banded sub super meas vert horiz height width
_ -> String
-> Array (Banded sub super meas vert horiz height width) a -> out
forall sh a out.
(FormatArray sh, Floating a, Output out) =>
String -> Array sh a -> out
formatArray String
fmt (Array (Banded sub super meas vert horiz height width) a -> out)
-> Array (Banded sub super meas vert horiz height width) a -> out
forall a b. (a -> b) -> a -> b
$ ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper 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
toVector Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.UnitBandedTriangular BandedSquare sub super height
_ -> String -> Array (BandedSquare sub super height) a -> out
forall sh a out.
(FormatArray sh, Floating a, Output out) =>
String -> Array sh a -> out
formatArray String
fmt (Array (BandedSquare sub super height) a -> out)
-> Array (BandedSquare sub super height) a -> out
forall a b. (a -> b) -> a -> b
$ ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper 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
toVector Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
         Omni.BandedHermitian BandedHermitian offDiag height
_ -> String -> Array (BandedHermitian offDiag height) a -> out
forall sh a out.
(FormatArray sh, Floating a, Output out) =>
String -> Array sh a -> out
formatArray String
fmt (Array (BandedHermitian offDiag height) a -> out)
-> Array (BandedHermitian offDiag height) a -> out
forall a b. (a -> b) -> a -> b
$ ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper 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
toVector Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
ArrayMatrix
  pack property lower upper meas vert horiz height width a
a


packTag ::
   (Layout.Packing pack) =>
   ArrayMatrix pack diag lower upper meas vert horiz height width a ->
   Layout.PackingSingleton pack
packTag :: ArrayMatrix pack diag lower upper meas vert horiz height width a
-> PackingSingleton pack
packTag ArrayMatrix pack diag lower upper meas vert horiz height width a
_ = PackingSingleton pack
forall pack. Packing pack => PackingSingleton pack
Layout.autoPacking

diagTag ::
   (Omni.TriDiag diag) =>
   ArrayMatrix pack diag lower upper meas vert horiz height width a ->
   Omni.DiagSingleton diag
diagTag :: ArrayMatrix pack diag lower upper meas vert horiz height width a
-> DiagSingleton diag
diagTag ArrayMatrix pack diag lower upper meas vert horiz height width a
_ = DiagSingleton diag
forall diag. TriDiag diag => DiagSingleton diag
Omni.autoDiag

instance
   (Layout.Packing pack, Omni.TriDiag diag, xl ~ (), xu ~ ()) =>
      Matrix.MultiplySame (Array pack diag) xl xu where
   multiplySame :: matrix -> matrix -> matrix
multiplySame matrix
a =
      case Omni pack diag lower upper meas vert horiz sh sh
-> Power pack diag lower upper meas vert horiz sh sh
forall pack property lower upper meas vert horiz height width.
(Packing pack, Property property, PowerStrip lower,
 PowerStrip upper, Measure meas, C vert, C horiz) =>
Omni pack property lower upper meas vert horiz height width
-> Power pack property lower upper meas vert horiz height width
Omni.powerSingleton (Omni pack diag lower upper meas vert horiz sh sh
 -> Power pack diag lower upper meas vert horiz sh sh)
-> Omni pack diag lower upper meas vert horiz sh sh
-> Power pack diag lower upper meas vert horiz sh sh
forall a b. (a -> b) -> a -> b
$ ArrayMatrix pack diag lower upper meas vert horiz sh sh a
-> Omni pack diag lower upper meas vert horiz sh sh
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
shape matrix
ArrayMatrix pack diag lower upper meas vert horiz sh sh a
a of
         Power pack diag lower upper meas vert horiz sh sh
Omni.PowerIdentity -> \matrix
b ->
            if Quadratic (Array pack Unit) () () (Bands U0) (Bands U0) sh a -> sh
forall typ xl xu lower upper sh a.
Box typ =>
Quadratic typ xl xu lower upper sh a -> sh
Matrix.squareSize matrix
Quadratic (Array pack Unit) () () (Bands U0) (Bands U0) sh a
a sh -> sh -> Bool
forall a. Eq a => a -> a -> Bool
== Quadratic (Array pack Unit) () () (Bands U0) (Bands U0) sh a -> sh
forall typ xl xu lower upper sh a.
Box typ =>
Quadratic typ xl xu lower upper sh a -> sh
Matrix.squareSize matrix
Quadratic (Array pack Unit) () () (Bands U0) (Bands U0) sh a
b
               then matrix
b
               else String -> matrix
forall a. HasCallStack => String -> a
error String
"multiplySame Identity: shape mismatch"
         Power pack diag lower upper meas vert horiz sh sh
Omni.PowerUpperTriangular ->
            (PlainArray pack diag (Bands U0) Filled Shape Small Small sh sh a
 -> PlainArray pack diag (Bands U0) Filled Shape Small Small sh sh a
 -> PlainArray
      pack diag (Bands U0) Filled Shape Small Small sh sh a)
-> ArrayMatrix
     pack diag (Bands U0) Filled Shape Small Small sh sh a
-> ArrayMatrix
     pack diag (Bands U0) Filled Shape Small Small sh sh a
-> ArrayMatrix
     pack diag (Bands U0) Filled Shape Small Small sh sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB packC
       propC lowerC upperC measC vertC horizC heightC widthC a b c.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 ToPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB,
 FromPlain
   packC propC lowerC upperC measC vertC horizC heightC widthC) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
lift2 (DiagSingleton diag
-> TriangularP pack Upper sh a
-> TriangularP pack Upper sh a
-> TriangularP pack Upper sh a
forall pack uplo diag sh a.
(Packing pack, UpLo uplo, TriDiag diag, C sh, Eq sh, Floating a) =>
DiagSingleton diag
-> TriangularP pack uplo sh a
-> TriangularP pack uplo sh a
-> TriangularP pack uplo sh a
Triangular.multiply (DiagSingleton diag
 -> TriangularP pack Upper sh a
 -> TriangularP pack Upper sh a
 -> TriangularP pack Upper sh a)
-> DiagSingleton diag
-> TriangularP pack Upper sh a
-> TriangularP pack Upper sh a
-> TriangularP pack Upper sh a
forall a b. (a -> b) -> a -> b
$ ArrayMatrix pack diag (Bands U0) Filled Shape Small Small sh sh a
-> DiagSingleton diag
forall diag pack lower upper meas vert horiz height width a.
TriDiag diag =>
ArrayMatrix pack diag lower upper meas vert horiz height width a
-> DiagSingleton diag
diagTag matrix
ArrayMatrix pack diag (Bands U0) Filled Shape Small Small sh sh a
a) matrix
ArrayMatrix pack diag (Bands U0) Filled Shape Small Small sh sh a
a
         Power pack diag lower upper meas vert horiz sh sh
Omni.PowerLowerTriangular ->
            (PlainArray pack diag Filled (Bands U0) Shape Small Small sh sh a
 -> PlainArray pack diag Filled (Bands U0) Shape Small Small sh sh a
 -> PlainArray
      pack diag Filled (Bands U0) Shape Small Small sh sh a)
-> ArrayMatrix
     pack diag Filled (Bands U0) Shape Small Small sh sh a
-> ArrayMatrix
     pack diag Filled (Bands U0) Shape Small Small sh sh a
-> ArrayMatrix
     pack diag Filled (Bands U0) Shape Small Small sh sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB packC
       propC lowerC upperC measC vertC horizC heightC widthC a b c.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 ToPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB,
 FromPlain
   packC propC lowerC upperC measC vertC horizC heightC widthC) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
lift2 (DiagSingleton diag
-> TriangularP pack Lower sh a
-> TriangularP pack Lower sh a
-> TriangularP pack Lower sh a
forall pack uplo diag sh a.
(Packing pack, UpLo uplo, TriDiag diag, C sh, Eq sh, Floating a) =>
DiagSingleton diag
-> TriangularP pack uplo sh a
-> TriangularP pack uplo sh a
-> TriangularP pack uplo sh a
Triangular.multiply (DiagSingleton diag
 -> TriangularP pack Lower sh a
 -> TriangularP pack Lower sh a
 -> TriangularP pack Lower sh a)
-> DiagSingleton diag
-> TriangularP pack Lower sh a
-> TriangularP pack Lower sh a
-> TriangularP pack Lower sh a
forall a b. (a -> b) -> a -> b
$ ArrayMatrix pack diag Filled (Bands U0) Shape Small Small sh sh a
-> DiagSingleton diag
forall diag pack lower upper meas vert horiz height width a.
TriDiag diag =>
ArrayMatrix pack diag lower upper meas vert horiz height width a
-> DiagSingleton diag
diagTag matrix
ArrayMatrix pack diag Filled (Bands U0) Shape Small Small sh sh a
a) matrix
ArrayMatrix pack diag Filled (Bands U0) Shape Small Small sh sh a
a
         Power pack diag lower upper meas vert horiz sh sh
Omni.PowerDiagonal ->
            case (ArrayMatrix pack diag (Bands U0) (Bands U0) meas vert horiz sh sh a
-> DiagSingleton diag
forall diag pack lower upper meas vert horiz height width a.
TriDiag diag =>
ArrayMatrix pack diag lower upper meas vert horiz height width a
-> DiagSingleton diag
diagTag matrix
ArrayMatrix pack diag (Bands U0) (Bands U0) meas vert horiz sh sh a
a, ArrayMatrix pack diag (Bands U0) (Bands U0) meas vert horiz sh sh a
-> Omni pack diag (Bands U0) (Bands U0) meas vert horiz sh sh
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
shape matrix
ArrayMatrix pack diag (Bands U0) (Bands U0) meas vert horiz sh sh a
a) of
               (DiagSingleton diag
MatrixShape.Unit, Omni.UnitBandedTriangular BandedSquare sub super sh
_) ->
                  (PlainArray
   Packed Unit (Bands U0) (Bands U0) Shape Small Small sh sh a
 -> PlainArray
      Packed Unit (Bands U0) (Bands U0) Shape Small Small sh sh a
 -> PlainArray
      Packed Unit (Bands U0) (Bands U0) Shape Small Small sh sh a)
-> ArrayMatrix
     Packed Unit (Bands U0) (Bands U0) Shape Small Small sh sh a
-> ArrayMatrix
     Packed Unit (Bands U0) (Bands U0) Shape Small Small sh sh a
-> ArrayMatrix
     Packed Unit (Bands U0) (Bands U0) Shape Small Small sh sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB packC
       propC lowerC upperC measC vertC horizC heightC widthC a b c.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 ToPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB,
 FromPlain
   packC propC lowerC upperC measC vertC horizC heightC widthC) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
lift2 PlainArray
  Packed Unit (Bands U0) (Bands U0) Shape Small Small sh sh a
-> PlainArray
     Packed Unit (Bands U0) (Bands U0) Shape Small Small sh sh a
-> PlainArray
     Packed Unit (Bands U0) (Bands U0) Shape Small Small sh sh a
forall subA superA subB superB subC superC meas vert horiz height
       width fuse a.
(Natural subA, Natural superA, Natural subB, Natural superB,
 (subA :+: subB) ~ subC, (superA :+: superB) ~ superC, Measure meas,
 C vert, C horiz, C height, C width, C fuse, Eq fuse, Floating a) =>
Banded subA superA meas vert horiz height fuse a
-> Banded subB superB meas vert horiz fuse width a
-> Banded subC superC meas vert horiz height width a
Banded.multiply matrix
ArrayMatrix
  Packed Unit (Bands U0) (Bands U0) Shape Small Small sh sh a
a
               (DiagSingleton diag
MatrixShape.Arbitrary, Omni.Banded Banded sub super meas vert horiz sh sh
_) ->
                  (PlainArray
   Packed Arbitrary (Bands U0) (Bands U0) meas vert horiz sh sh a
 -> PlainArray
      Packed Arbitrary (Bands U0) (Bands U0) meas vert horiz sh sh a
 -> PlainArray
      Packed Arbitrary (Bands U0) (Bands U0) meas vert horiz sh sh a)
-> ArrayMatrix
     Packed Arbitrary (Bands U0) (Bands U0) meas vert horiz sh sh a
-> ArrayMatrix
     Packed Arbitrary (Bands U0) (Bands U0) meas vert horiz sh sh a
-> ArrayMatrix
     Packed Arbitrary (Bands U0) (Bands U0) meas vert horiz sh sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB packC
       propC lowerC upperC measC vertC horizC heightC widthC a b c.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 ToPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB,
 FromPlain
   packC propC lowerC upperC measC vertC horizC heightC widthC) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> PlainArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
lift2 PlainArray
  Packed Arbitrary (Bands U0) (Bands U0) meas vert horiz sh sh a
-> PlainArray
     Packed Arbitrary (Bands U0) (Bands U0) meas vert horiz sh sh a
-> PlainArray
     Packed Arbitrary (Bands U0) (Bands U0) meas vert horiz sh sh a
forall subA superA subB superB subC superC meas vert horiz height
       width fuse a.
(Natural subA, Natural superA, Natural subB, Natural superB,
 (subA :+: subB) ~ subC, (superA :+: superB) ~ superC, Measure meas,
 C vert, C horiz, C height, C width, C fuse, Eq fuse, Floating a) =>
Banded subA superA meas vert horiz height fuse a
-> Banded subB superB meas vert horiz fuse width a
-> Banded subC superC meas vert horiz height width a
Banded.multiply matrix
ArrayMatrix
  Packed Arbitrary (Bands U0) (Bands U0) meas vert horiz sh sh a
a
               (DiagSingleton diag
_, Omni.Full Full meas vert horiz sh sh
_) -> (FullArray meas vert horiz sh sh a
 -> FullArray meas vert horiz sh sh a
 -> FullArray meas vert horiz sh sh a)
-> UnpackedMatrix
     diag (Bands U0) (Bands U0) meas vert horiz sh sh a
-> UnpackedMatrix
     diag (Bands U0) (Bands U0) meas vert horiz sh sh a
-> UnpackedMatrix
     diag (Bands U0) (Bands U0) meas vert horiz sh sh a
forall propertyA lowerA upperA propertyB lowerB upperB propertyC
       lowerC upperC measA vertA horizA heightA widthA a measB vertB
       horizB heightB widthB b measC vertC horizC heightC widthC c.
(Property propertyA, Strip lowerA, Strip upperA,
 Property propertyB, Strip lowerB, Strip upperB, Property propertyC,
 Strip lowerC, Strip upperC) =>
(FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b
 -> FullArray measC vertC horizC heightC widthC c)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
-> UnpackedMatrix
     propertyC lowerC upperC measC vertC horizC heightC widthC c
liftUnpacked2 FullArray meas vert horiz sh sh a
-> FullArray meas vert horiz sh sh a
-> FullArray meas vert horiz sh sh a
forall meas vert horiz height fuse width a.
(Measure meas, C vert, C horiz, C height, C fuse, Eq fuse, C width,
 Floating a) =>
Full meas vert horiz height fuse a
-> Full meas vert horiz fuse width a
-> Full meas vert horiz height width a
Basic.multiply matrix
UnpackedMatrix diag (Bands U0) (Bands U0) meas vert horiz sh sh a
a
         Power pack diag lower upper meas vert horiz sh sh
Omni.PowerSymmetric ->
            case ArrayMatrix pack Symmetric Filled Filled Shape Small Small sh sh a
-> DiagSingleton Symmetric
forall diag pack lower upper meas vert horiz height width a.
TriDiag diag =>
ArrayMatrix pack diag lower upper meas vert horiz height width a
-> DiagSingleton diag
diagTag matrix
ArrayMatrix pack Symmetric Filled Filled Shape Small Small sh sh a
a of DiagSingleton Symmetric
_ -> String -> matrix -> matrix
forall a. HasCallStack => String -> a
error String
"Symmetric forbidden"
         Power pack diag lower upper meas vert horiz sh sh
Omni.PowerHermitian ->
            case ArrayMatrix
  pack
  (Hermitian neg zero pos)
  Filled
  Filled
  Shape
  Small
  Small
  sh
  sh
  a
-> DiagSingleton (Hermitian neg zero pos)
forall diag pack lower upper meas vert horiz height width a.
TriDiag diag =>
ArrayMatrix pack diag lower upper meas vert horiz height width a
-> DiagSingleton diag
diagTag matrix
ArrayMatrix
  pack
  (Hermitian neg zero pos)
  Filled
  Filled
  Shape
  Small
  Small
  sh
  sh
  a
a of DiagSingleton (Hermitian neg zero pos)
_ -> String -> matrix -> matrix
forall a. HasCallStack => String -> a
error String
"Hermitian forbidden"
         Power pack diag lower upper meas vert horiz sh sh
Omni.PowerFull -> (FullArray meas vert horiz sh sh a
 -> FullArray meas vert horiz sh sh a
 -> FullArray meas vert horiz sh sh a)
-> UnpackedMatrix diag lower upper meas vert horiz sh sh a
-> UnpackedMatrix diag lower upper meas vert horiz sh sh a
-> UnpackedMatrix diag lower upper meas vert horiz sh sh a
forall propertyA lowerA upperA propertyB lowerB upperB propertyC
       lowerC upperC measA vertA horizA heightA widthA a measB vertB
       horizB heightB widthB b measC vertC horizC heightC widthC c.
(Property propertyA, Strip lowerA, Strip upperA,
 Property propertyB, Strip lowerB, Strip upperB, Property propertyC,
 Strip lowerC, Strip upperC) =>
(FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b
 -> FullArray measC vertC horizC heightC widthC c)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
-> UnpackedMatrix
     propertyC lowerC upperC measC vertC horizC heightC widthC c
liftUnpacked2 FullArray meas vert horiz sh sh a
-> FullArray meas vert horiz sh sh a
-> FullArray meas vert horiz sh sh a
forall meas vert horiz height fuse width a.
(Measure meas, C vert, C horiz, C height, C fuse, Eq fuse, C width,
 Floating a) =>
Full meas vert horiz height fuse a
-> Full meas vert horiz fuse width a
-> Full meas vert horiz height width a
Basic.multiply matrix
UnpackedMatrix diag lower upper meas vert horiz sh sh a
a


{-
ToDo: implement using Array.Omni.identityOrderAux.
however, we must prevent module cycle

instance
   (meas ~ Extent.Shape, vert ~ Extent.Small, horiz ~ Extent.Small,
    height ~ width, Shape.Static width) =>
      Matrix.StaticIdentity
         (Array pack property lower upper meas vert horiz height width) where
   staticIdentity =
      OmniBasic.identityOrder Layout.RowMajor Shape.static
-}


class (Omni.Property property) => Homogeneous property where
instance Homogeneous Arbitrary where
instance Homogeneous Omni.Symmetric where
instance (zero ~ True, neg ~ pos, TBool.C pos) =>
         Homogeneous (Omni.Hermitian neg zero pos) where

zero ::
   (Homogeneous property) =>
   (Extent.Measure meas, Extent.C vert, Extent.C horiz) =>
   (Shape.C height, Shape.C width, Class.Floating a) =>
   Omni pack property lower upper meas vert horiz height width ->
   ArrayMatrix pack property lower upper meas vert horiz height width a
zero :: Omni pack property lower upper meas vert horiz height width
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
zero = OmniArray pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall pack prop lower upper meas vert horiz height width a.
OmniArray pack prop lower upper meas vert horiz height width a
-> Matrix
     (Array pack prop) () () lower upper meas vert horiz height width a
Array (OmniArray pack property lower upper meas vert horiz height width a
 -> ArrayMatrix
      pack property lower upper meas vert horiz height width a)
-> (Omni pack property lower upper meas vert horiz height width
    -> OmniArray
         pack property lower upper meas vert horiz height width a)
-> Omni pack property lower upper meas vert horiz height width
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Omni pack property lower upper meas vert horiz height width
-> OmniArray
     pack property lower upper meas vert horiz height width a
forall sh a. (C sh, Floating a) => sh -> Vector sh a
Vector.zero

negate ::
   (Homogeneous property) =>
   (Extent.Measure meas, Extent.C vert, Extent.C horiz) =>
   (Shape.C height, Shape.C width, Class.Floating a) =>
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a
negate :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
negate (Array a) = OmniArray pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall pack prop lower upper meas vert horiz height width a.
OmniArray pack prop lower upper meas vert horiz height width a
-> Matrix
     (Array pack prop) () () lower upper meas vert horiz height width a
Array (OmniArray pack property lower upper meas vert horiz height width a
 -> ArrayMatrix
      pack property lower upper meas vert horiz height width a)
-> OmniArray
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall a b. (a -> b) -> a -> b
$ OmniArray pack property lower upper meas vert horiz height width a
-> OmniArray
     pack property lower upper meas vert horiz height width a
forall sh a. (C sh, Floating a) => Vector sh a -> Vector sh a
Vector.negate OmniArray pack property lower upper meas vert horiz height width a
a

scaleReal ::
   (Homogeneous property) =>
   (Extent.Measure meas, Extent.C vert, Extent.C horiz) =>
   (Shape.C height, Shape.C width, Class.Floating a) =>
   RealOf a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a
scaleReal :: RealOf a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
scaleReal RealOf a
a (Array v) = OmniArray pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall pack prop lower upper meas vert horiz height width a.
OmniArray pack prop lower upper meas vert horiz height width a
-> Matrix
     (Array pack prop) () () lower upper meas vert horiz height width a
Array (OmniArray pack property lower upper meas vert horiz height width a
 -> ArrayMatrix
      pack property lower upper meas vert horiz height width a)
-> OmniArray
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall a b. (a -> b) -> a -> b
$ RealOf a
-> OmniArray
     pack property lower upper meas vert horiz height width a
-> OmniArray
     pack property lower upper meas vert horiz height width a
forall sh a.
(C sh, Floating a) =>
RealOf a -> Vector sh a -> Vector sh a
Vector.scaleReal RealOf a
a OmniArray pack property lower upper meas vert horiz height width a
v

newtype ScaleReal f a = ScaleReal {ScaleReal f a -> a -> f a -> f a
getScaleReal :: a -> f a -> f a}

scaleRealReal ::
   (Homogeneous property) =>
   (Extent.Measure meas, Extent.C vert, Extent.C horiz) =>
   (Shape.C height, Shape.C width, Class.Real a) =>
   a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a
scaleRealReal :: a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
scaleRealReal =
   ScaleReal
  (Matrix
     (Array pack property)
     ()
     ()
     lower
     upper
     meas
     vert
     horiz
     height
     width)
  a
-> a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall (f :: * -> *) a. ScaleReal f a -> a -> f a -> f a
getScaleReal (ScaleReal
   (Matrix
      (Array pack property)
      ()
      ()
      lower
      upper
      meas
      vert
      horiz
      height
      width)
   a
 -> a
 -> ArrayMatrix
      pack property lower upper meas vert horiz height width a
 -> ArrayMatrix
      pack property lower upper meas vert horiz height width a)
-> ScaleReal
     (Matrix
        (Array pack property)
        ()
        ()
        lower
        upper
        meas
        vert
        horiz
        height
        width)
     a
-> a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall a b. (a -> b) -> a -> b
$ ScaleReal
  (Matrix
     (Array pack property)
     ()
     ()
     lower
     upper
     meas
     vert
     horiz
     height
     width)
  Float
-> ScaleReal
     (Matrix
        (Array pack property)
        ()
        ()
        lower
        upper
        meas
        vert
        horiz
        height
        width)
     Double
-> ScaleReal
     (Matrix
        (Array pack property)
        ()
        ()
        lower
        upper
        meas
        vert
        horiz
        height
        width)
     a
forall a (f :: * -> *). Real a => f Float -> f Double -> f a
Class.switchReal ((Float
 -> Matrix
      (Array pack property)
      ()
      ()
      lower
      upper
      meas
      vert
      horiz
      height
      width
      Float
 -> Matrix
      (Array pack property)
      ()
      ()
      lower
      upper
      meas
      vert
      horiz
      height
      width
      Float)
-> ScaleReal
     (Matrix
        (Array pack property)
        ()
        ()
        lower
        upper
        meas
        vert
        horiz
        height
        width)
     Float
forall (f :: * -> *) a. (a -> f a -> f a) -> ScaleReal f a
ScaleReal Float
-> Matrix
     (Array pack property)
     ()
     ()
     lower
     upper
     meas
     vert
     horiz
     height
     width
     Float
-> Matrix
     (Array pack property)
     ()
     ()
     lower
     upper
     meas
     vert
     horiz
     height
     width
     Float
forall property meas vert horiz height width a pack lower upper.
(Homogeneous property, Measure meas, C vert, C horiz, C height,
 C width, Floating a) =>
RealOf a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
scaleReal) ((Double
 -> Matrix
      (Array pack property)
      ()
      ()
      lower
      upper
      meas
      vert
      horiz
      height
      width
      Double
 -> Matrix
      (Array pack property)
      ()
      ()
      lower
      upper
      meas
      vert
      horiz
      height
      width
      Double)
-> ScaleReal
     (Matrix
        (Array pack property)
        ()
        ()
        lower
        upper
        meas
        vert
        horiz
        height
        width)
     Double
forall (f :: * -> *) a. (a -> f a -> f a) -> ScaleReal f a
ScaleReal Double
-> Matrix
     (Array pack property)
     ()
     ()
     lower
     upper
     meas
     vert
     horiz
     height
     width
     Double
-> Matrix
     (Array pack property)
     ()
     ()
     lower
     upper
     meas
     vert
     horiz
     height
     width
     Double
forall property meas vert horiz height width a pack lower upper.
(Homogeneous property, Measure meas, C vert, C horiz, C height,
 C width, Floating a) =>
RealOf a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
scaleReal)


class (Homogeneous property) => Scale property where
instance Scale Arbitrary where
instance Scale Omni.Symmetric where

scale, (.*#) ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz) =>
   (Scale property, Shape.C height, Shape.C width, Class.Floating a) =>
   a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a
scale :: a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
scale a
a (Array v) = OmniArray pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall pack prop lower upper meas vert horiz height width a.
OmniArray pack prop lower upper meas vert horiz height width a
-> Matrix
     (Array pack prop) () () lower upper meas vert horiz height width a
Array (OmniArray pack property lower upper meas vert horiz height width a
 -> ArrayMatrix
      pack property lower upper meas vert horiz height width a)
-> OmniArray
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall a b. (a -> b) -> a -> b
$ a
-> OmniArray
     pack property lower upper meas vert horiz height width a
-> OmniArray
     pack property lower upper meas vert horiz height width a
forall sh a. (C sh, Floating a) => a -> Vector sh a -> Vector sh a
Vector.scale a
a OmniArray pack property lower upper meas vert horiz height width a
v
.*# :: a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
(.*#) = a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall meas vert horiz property height width a pack lower upper.
(Measure meas, C vert, C horiz, Scale property, C height, C width,
 Floating a) =>
a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
scale

infixl 7 .*#


order ::
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   Layout.Order
order :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Order
order = Omni pack property lower upper meas vert horiz height width
-> Order
forall pack property lower upper meas vert horiz height width.
Omni pack property lower upper meas vert horiz height width
-> Order
Omni.order (Omni pack property lower upper meas vert horiz height width
 -> Order)
-> (ArrayMatrix
      pack property lower upper meas vert horiz height width a
    -> Omni pack property lower upper meas vert horiz height width)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> Order
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
shape

forceOrder ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz) =>
   (Shape.C height, Shape.C width, Class.Floating a) =>
   Layout.Order ->
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a
forceOrder :: Order
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forceOrder Order
order_ ArrayMatrix
  pack property lower upper meas vert horiz height width a
a =
   case ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
shape ArrayMatrix
  pack property lower upper meas vert horiz height width a
a of
      Omni.UpperTriangular UpperTriangular height
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property lower upper meas vert horiz height width a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper 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
lift1 (Order
-> Mosaic NoMirror Upper height a -> Mosaic NoMirror Upper height a
forall uplo sh a mirror.
(UpLo uplo, C sh, Floating a) =>
Order -> Mosaic mirror uplo sh a -> Mosaic mirror uplo sh a
Triangular.forceOrder Order
order_) ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
      Omni.LowerTriangular LowerTriangular height
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property lower upper meas vert horiz height width a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper 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
lift1 (Order
-> Mosaic NoMirror Lower height a -> Mosaic NoMirror Lower height a
forall uplo sh a mirror.
(UpLo uplo, C sh, Floating a) =>
Order -> Mosaic mirror uplo sh a -> Mosaic mirror uplo sh a
Triangular.forceOrder Order
order_) ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
      Omni.Full Full meas vert horiz height width
_ -> (FullArray meas vert horiz height width a
 -> FullArray meas vert horiz height width a)
-> UnpackedMatrix
     property lower upper meas vert horiz height width a
-> UnpackedMatrix
     property lower upper meas vert horiz height width a
forall propertyA lowerA upperA propertyB lowerB upperB measA vertA
       horizA heightA widthA a measB vertB horizB heightB widthB b.
(Property propertyA, Strip lowerA, Strip upperA,
 Property propertyB, Strip lowerB, Strip upperB) =>
(FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
liftUnpacked1 (Order
-> FullArray meas vert horiz height width a
-> FullArray 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) =>
Order
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
Basic.forceOrder Order
order_) ArrayMatrix
  pack property lower upper meas vert horiz height width a
UnpackedMatrix property lower upper meas vert horiz height width a
a
      Omni.Symmetric Symmetric height
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property lower upper meas vert horiz height width a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper 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
lift1 (Order
-> Mosaic SimpleMirror Upper height a
-> Mosaic SimpleMirror Upper height a
forall uplo sh a mirror.
(UpLo uplo, C sh, Floating a) =>
Order -> Mosaic mirror uplo sh a -> Mosaic mirror uplo sh a
Triangular.forceOrder Order
order_) ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
      Omni.Hermitian Hermitian height
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property lower upper meas vert horiz height width a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper 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
lift1 (Order
-> Mosaic ConjugateMirror Upper height a
-> Mosaic ConjugateMirror Upper height a
forall uplo sh a mirror.
(UpLo uplo, C sh, Floating a) =>
Order -> Mosaic mirror uplo sh a -> Mosaic mirror uplo sh a
Triangular.forceOrder Order
order_) ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
      Omni.Banded Banded sub super meas vert horiz height width
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property lower upper meas vert horiz height width a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper 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
lift1 (Order
-> Banded sub super meas vert horiz height width a
-> Banded sub super meas vert horiz height width a
forall sub super meas vert horiz height width a.
(Natural sub, Natural super, Measure meas, C vert, C horiz,
 C height, C width, Floating a) =>
Order
-> Banded sub super meas vert horiz height width a
-> Banded sub super meas vert horiz height width a
Banded.forceOrder Order
order_) ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
      Omni.BandedHermitian BandedHermitian offDiag height
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property lower upper meas vert horiz height width a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper 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
lift1 (Order
-> BandedHermitian offDiag height a
-> BandedHermitian offDiag height a
forall offDiag size a.
(Natural offDiag, C size, Floating a) =>
Order
-> BandedHermitian offDiag size a -> BandedHermitian offDiag size a
BandedHermitian.forceOrder Order
order_) ArrayMatrix
  pack property lower upper meas vert horiz height width a
a
      Omni.UnitBandedTriangular BandedSquare sub super height
_ -> (PlainArray
   pack property lower upper meas vert horiz height width a
 -> PlainArray
      pack property lower upper meas vert horiz height width a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper 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
lift1 (Order
-> Banded sub super Shape Small Small height height a
-> Banded sub super Shape Small Small height height a
forall sub super meas vert horiz height width a.
(Natural sub, Natural super, Measure meas, C vert, C horiz,
 C height, C width, Floating a) =>
Order
-> Banded sub super meas vert horiz height width a
-> Banded sub super meas vert horiz height width a
Banded.forceOrder Order
order_) ArrayMatrix
  pack property lower upper meas vert horiz height width a
a

{- |
@adaptOrder x y@ contains the data of @y@ with the layout of @x@.
-}
adaptOrder ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz) =>
   (Shape.C height, Shape.C width, Class.Floating a) =>
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a
adaptOrder :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
adaptOrder = Order
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall meas vert horiz height width a pack property lower upper.
(Measure meas, C vert, C horiz, C height, C width, Floating a) =>
Order
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forceOrder (Order
 -> ArrayMatrix
      pack property lower upper meas vert horiz height width a
 -> ArrayMatrix
      pack property lower upper meas vert horiz height width a)
-> (ArrayMatrix
      pack property lower upper meas vert horiz height width a
    -> Order)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Order
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Order
order


class (Omni.Property property) => Additive property where
instance Additive Arbitrary where
instance Additive Omni.Symmetric where
instance (TBool.C neg, TBool.C zero, TBool.C pos) =>
            Additive (Omni.Hermitian neg zero pos) where

class (Additive property) => Subtractive property where
instance Subtractive Arbitrary where
instance Subtractive Omni.Symmetric where
instance (TBool.C neg, TBool.C zero, neg ~ pos) =>
            Subtractive (Omni.Hermitian neg zero pos) where

infixl 6 #+#, #-#, `add`, `sub`

add, (#+#) ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz) =>
   (Additive property,
    Shape.C height, Eq height, Shape.C width, Eq width, Class.Floating a) =>
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a
add :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
add ArrayMatrix
  pack property lower upper meas vert horiz height width a
a ArrayMatrix
  pack property lower upper meas vert horiz height width a
b = (OmniArray pack property lower upper meas vert horiz height width a
 -> OmniArray
      pack property lower upper meas vert horiz height width a
 -> OmniArray
      pack property lower upper meas vert horiz height width a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       a packB propB lowerB upperB measB vertB horizB heightB widthB b
       packC propC lowerC upperC measC vertC horizC heightC widthC c.
(OmniArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> OmniArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> OmniArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
liftOmni2 OmniArray pack property lower upper meas vert horiz height width a
-> OmniArray
     pack property lower upper meas vert horiz height width a
-> OmniArray
     pack property lower upper meas vert horiz height width a
forall sh a.
(C sh, Eq sh, Floating a) =>
Vector sh a -> Vector sh a -> Vector sh a
Vector.add (ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall meas vert horiz height width a pack property lower upper.
(Measure meas, C vert, C horiz, C height, C width, Floating a) =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
adaptOrder ArrayMatrix
  pack property lower upper meas vert horiz height width a
b ArrayMatrix
  pack property lower upper meas vert horiz height width a
a) ArrayMatrix
  pack property lower upper meas vert horiz height width a
b

sub, (#-#) ::
   (Extent.Measure meas, Extent.C vert, Extent.C horiz) =>
   (Subtractive property,
    Shape.C height, Eq height, Shape.C width, Eq width, Class.Floating a) =>
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   ArrayMatrix pack property lower upper meas vert horiz height width a
sub :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
sub ArrayMatrix
  pack property lower upper meas vert horiz height width a
a ArrayMatrix
  pack property lower upper meas vert horiz height width a
b = (OmniArray pack property lower upper meas vert horiz height width a
 -> OmniArray
      pack property lower upper meas vert horiz height width a
 -> OmniArray
      pack property lower upper meas vert horiz height width a)
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       a packB propB lowerB upperB measB vertB horizB heightB widthB b
       packC propC lowerC upperC measC vertC horizC heightC widthC c.
(OmniArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> OmniArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> OmniArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
liftOmni2 OmniArray pack property lower upper meas vert horiz height width a
-> OmniArray
     pack property lower upper meas vert horiz height width a
-> OmniArray
     pack property lower upper meas vert horiz height width a
forall sh a.
(C sh, Eq sh, Floating a) =>
Vector sh a -> Vector sh a -> Vector sh a
Vector.sub (ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall meas vert horiz height width a pack property lower upper.
(Measure meas, C vert, C horiz, C height, C width, Floating a) =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
adaptOrder ArrayMatrix
  pack property lower upper meas vert horiz height width a
b ArrayMatrix
  pack property lower upper meas vert horiz height width a
a) ArrayMatrix
  pack property lower upper meas vert horiz height width a
b

#+# :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
(#+#) = ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall meas vert horiz property height width a pack lower upper.
(Measure meas, C vert, C horiz, Additive property, C height,
 Eq height, C width, Eq width, Floating a) =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
add
#-# :: ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
(#-#) = ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
forall meas vert horiz property height width a pack lower upper.
(Measure meas, C vert, C horiz, Subtractive property, C height,
 Eq height, C width, Eq width, Floating a) =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
sub


liftOmni1 ::
   (OmniArray packA propA lowerA upperA measA vertA horizA heightA widthA a ->
    OmniArray 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
liftOmni1 :: (OmniArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> OmniArray
      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
liftOmni1 OmniArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> OmniArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
f (Array a) = OmniArray
  packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
forall pack prop lower upper meas vert horiz height width a.
OmniArray pack prop lower upper meas vert horiz height width a
-> Matrix
     (Array pack prop) () () lower upper meas vert horiz height width a
Array (OmniArray
   packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> ArrayMatrix
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> OmniArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
forall a b. (a -> b) -> a -> b
$ OmniArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> OmniArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
f OmniArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
a

liftOmni2 ::
   (OmniArray packA propA lowerA upperA measA vertA horizA heightA widthA a ->
    OmniArray packB propB lowerB upperB measB vertB horizB heightB widthB b ->
    OmniArray packC propC lowerC upperC measC vertC horizC heightC widthC c)
   ->
   ArrayMatrix packA propA lowerA upperA measA vertA horizA heightA widthA a ->
   ArrayMatrix packB propB lowerB upperB measB vertB horizB heightB widthB b ->
   ArrayMatrix packC propC lowerC upperC measC vertC horizC heightC widthC c
liftOmni2 :: (OmniArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> OmniArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> OmniArray
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
liftOmni2 OmniArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> OmniArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> OmniArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
f (Array a) (Array b) = OmniArray
  packC propC lowerC upperC measC vertC horizC heightC widthC c
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
forall pack prop lower upper meas vert horiz height width a.
OmniArray pack prop lower upper meas vert horiz height width a
-> Matrix
     (Array pack prop) () () lower upper meas vert horiz height width a
Array (OmniArray
   packC propC lowerC upperC measC vertC horizC heightC widthC c
 -> ArrayMatrix
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> OmniArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> ArrayMatrix
     packC propC lowerC upperC measC vertC horizC heightC widthC c
forall a b. (a -> b) -> a -> b
$ OmniArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
-> OmniArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> OmniArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
f OmniArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
a OmniArray
  packB propB lowerB upperB measB vertB horizB heightB widthB b
b



instance Matrix.ToQuadratic (Array pack property) where
   heightToQuadratic :: QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
-> Quadratic (Array pack property) xl xu lower upper height a
heightToQuadratic a :: QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
a@(Array _) =
      case ArrayMatrix
  pack property lower upper meas Small Small height width a
-> Omni pack property lower upper meas Small Small height width
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
shape QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
ArrayMatrix
  pack property lower upper meas Small Small height width a
a of
         Omni.Full Full meas Small Small height width
_ ->
            ((QuadraticMeas
   (Array pack property) xl xu lower upper meas height width a
 -> UnpackedMatrix
      property lower upper Shape Small Small height height a)
-> QuadraticMeas
     (Array pack property) xl xu lower upper meas height width a
-> UnpackedMatrix
     property lower upper Shape Small Small height height a
forall a b. (a -> b) -> a -> b
$QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
a) ((QuadraticMeas
    (Array pack property) xl xu lower upper meas height width a
  -> UnpackedMatrix
       property lower upper Shape Small Small height height a)
 -> UnpackedMatrix
      property lower upper Shape Small Small height height a)
-> (QuadraticMeas
      (Array pack property) xl xu lower upper meas height width a
    -> UnpackedMatrix
         property lower upper Shape Small Small height height a)
-> UnpackedMatrix
     property lower upper Shape Small Small height height a
forall a b. (a -> b) -> a -> b
$ (FullArray meas Small Small height width a
 -> FullArray Shape Small Small height height a)
-> UnpackedMatrix
     property lower upper meas Small Small height width a
-> UnpackedMatrix
     property lower upper Shape Small Small height height a
forall propertyA lowerA upperA propertyB lowerB upperB measA vertA
       horizA heightA widthA a measB vertB horizB heightB widthB b.
(Property propertyA, Strip lowerA, Strip upperA,
 Property propertyB, Strip lowerB, Strip upperB) =>
(FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
liftUnpacked1 ((FullArray meas Small Small height width a
  -> FullArray Shape Small Small height height a)
 -> UnpackedMatrix
      property lower upper meas Small Small height width a
 -> UnpackedMatrix
      property lower upper Shape Small Small height height a)
-> (FullArray meas Small Small height width a
    -> FullArray Shape Small Small height height a)
-> UnpackedMatrix
     property lower upper meas Small Small height width a
-> UnpackedMatrix
     property lower upper Shape Small Small height height a
forall a b. (a -> b) -> a -> b
$ (Extent meas Small Small height width
 -> Extent Shape Small Small height height)
-> FullArray meas Small Small height width a
-> FullArray Shape Small Small height height a
forall measA vertA horizA heightA widthA measB vertB horizB heightB
       widthB a.
(Extent measA vertA horizA heightA widthA
 -> Extent measB vertB horizB heightB widthB)
-> Full measA vertA horizA heightA widthA a
-> Full measB vertB horizB heightB widthB a
Basic.mapExtent ((Extent meas Small Small height width
  -> Extent Shape Small Small height height)
 -> FullArray meas Small Small height width a
 -> FullArray Shape Small Small height height a)
-> (Extent meas Small Small height width
    -> Extent Shape Small Small height height)
-> FullArray meas Small Small height width a
-> FullArray Shape Small Small height height a
forall a b. (a -> b) -> a -> b
$
               height -> Extent Shape Small Small height height
forall sh. sh -> Square sh
Extent.square (height -> Extent Shape Small Small height height)
-> (Extent meas Small Small height width -> height)
-> Extent meas Small Small height width
-> Extent Shape Small Small height height
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Extent meas Small Small height width -> height
forall meas vert horiz height width.
(Measure meas, C vert, C horiz) =>
Extent meas vert horiz height width -> height
Extent.height
         Omni.UpperTriangular UpperTriangular height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper height a
a
         Omni.LowerTriangular LowerTriangular height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper height a
a
         Omni.Symmetric Symmetric height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper height a
a
         Omni.Hermitian Hermitian height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper height a
a
         Omni.Banded Banded sub super meas Small Small height width
_ ->
            ((QuadraticMeas
   (Array pack property) xl xu lower upper meas height width a
 -> ArrayMatrix
      pack property lower upper Shape Small Small height height a)
-> QuadraticMeas
     (Array pack property) xl xu lower upper meas height width a
-> ArrayMatrix
     pack property lower upper Shape Small Small height height a
forall a b. (a -> b) -> a -> b
$QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
a) ((QuadraticMeas
    (Array pack property) xl xu lower upper meas height width a
  -> ArrayMatrix
       pack property lower upper Shape Small Small height height a)
 -> ArrayMatrix
      pack property lower upper Shape Small Small height height a)
-> (QuadraticMeas
      (Array pack property) xl xu lower upper meas height width a
    -> ArrayMatrix
         pack property lower upper Shape Small Small height height a)
-> ArrayMatrix
     pack property lower upper Shape Small Small height height a
forall a b. (a -> b) -> a -> b
$ (PlainArray
   pack property lower upper meas Small Small height width a
 -> PlainArray
      pack property lower upper Shape Small Small height height a)
-> ArrayMatrix
     pack property lower upper meas Small Small height width a
-> ArrayMatrix
     pack property lower upper Shape Small Small height height 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
lift1 ((PlainArray
    pack property lower upper meas Small Small height width a
  -> PlainArray
       pack property lower upper Shape Small Small height height a)
 -> ArrayMatrix
      pack property lower upper meas Small Small height width a
 -> ArrayMatrix
      pack property lower upper Shape Small Small height height a)
-> (PlainArray
      pack property lower upper meas Small Small height width a
    -> PlainArray
         pack property lower upper Shape Small Small height height a)
-> ArrayMatrix
     pack property lower upper meas Small Small height width a
-> ArrayMatrix
     pack property lower upper Shape Small Small height height a
forall a b. (a -> b) -> a -> b
$ (Extent meas Small Small height width
 -> Extent Shape Small Small height height)
-> Banded sub super meas Small Small height width a
-> Banded sub super Shape Small Small height height a
forall vertA horizA vertB horizB measA heightA widthA measB heightB
       widthB sub super a.
(C vertA, C horizA, C vertB, C horizB) =>
(Extent measA vertA horizA heightA widthA
 -> Extent measB vertB horizB heightB widthB)
-> Banded sub super measA vertA horizA heightA widthA a
-> Banded sub super measB vertB horizB heightB widthB a
Banded.mapExtentSizes ((Extent meas Small Small height width
  -> Extent Shape Small Small height height)
 -> Banded sub super meas Small Small height width a
 -> Banded sub super Shape Small Small height height a)
-> (Extent meas Small Small height width
    -> Extent Shape Small Small height height)
-> Banded sub super meas Small Small height width a
-> Banded sub super Shape Small Small height height a
forall a b. (a -> b) -> a -> b
$ height -> Extent Shape Small Small height height
forall sh. sh -> Square sh
Extent.square (height -> Extent Shape Small Small height height)
-> (Extent meas Small Small height width -> height)
-> Extent meas Small Small height width
-> Extent Shape Small Small height height
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Extent meas Small Small height width -> height
forall meas vert horiz height width.
(Measure meas, C vert, C horiz) =>
Extent meas vert horiz height width -> height
Extent.height
         Omni.UnitBandedTriangular BandedSquare sub super height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper height a
a
         Omni.BandedHermitian BandedHermitian offDiag height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper height a
a
   widthToQuadratic :: QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
-> Quadratic (Array pack property) xl xu lower upper width a
widthToQuadratic a :: QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
a@(Array _) =
      case ArrayMatrix
  pack property lower upper meas Small Small height width a
-> Omni pack property lower upper meas Small Small height width
forall pack property lower upper meas vert horiz height width a.
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> Omni pack property lower upper meas vert horiz height width
shape QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
ArrayMatrix
  pack property lower upper meas Small Small height width a
a of
         Omni.Full Full meas Small Small height width
_ ->
            ((QuadraticMeas
   (Array pack property) xl xu lower upper meas height width a
 -> UnpackedMatrix
      property lower upper Shape Small Small width width a)
-> QuadraticMeas
     (Array pack property) xl xu lower upper meas height width a
-> UnpackedMatrix
     property lower upper Shape Small Small width width a
forall a b. (a -> b) -> a -> b
$QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
a) ((QuadraticMeas
    (Array pack property) xl xu lower upper meas height width a
  -> UnpackedMatrix
       property lower upper Shape Small Small width width a)
 -> UnpackedMatrix
      property lower upper Shape Small Small width width a)
-> (QuadraticMeas
      (Array pack property) xl xu lower upper meas height width a
    -> UnpackedMatrix
         property lower upper Shape Small Small width width a)
-> UnpackedMatrix
     property lower upper Shape Small Small width width a
forall a b. (a -> b) -> a -> b
$ (FullArray meas Small Small height width a
 -> FullArray Shape Small Small width width a)
-> UnpackedMatrix
     property lower upper meas Small Small height width a
-> UnpackedMatrix
     property lower upper Shape Small Small width width a
forall propertyA lowerA upperA propertyB lowerB upperB measA vertA
       horizA heightA widthA a measB vertB horizB heightB widthB b.
(Property propertyA, Strip lowerA, Strip upperA,
 Property propertyB, Strip lowerB, Strip upperB) =>
(FullArray measA vertA horizA heightA widthA a
 -> FullArray measB vertB horizB heightB widthB b)
-> UnpackedMatrix
     propertyA lowerA upperA measA vertA horizA heightA widthA a
-> UnpackedMatrix
     propertyB lowerB upperB measB vertB horizB heightB widthB b
liftUnpacked1 ((FullArray meas Small Small height width a
  -> FullArray Shape Small Small width width a)
 -> UnpackedMatrix
      property lower upper meas Small Small height width a
 -> UnpackedMatrix
      property lower upper Shape Small Small width width a)
-> (FullArray meas Small Small height width a
    -> FullArray Shape Small Small width width a)
-> UnpackedMatrix
     property lower upper meas Small Small height width a
-> UnpackedMatrix
     property lower upper Shape Small Small width width a
forall a b. (a -> b) -> a -> b
$ (Extent meas Small Small height width
 -> Extent Shape Small Small width width)
-> FullArray meas Small Small height width a
-> FullArray Shape Small Small width width a
forall measA vertA horizA heightA widthA measB vertB horizB heightB
       widthB a.
(Extent measA vertA horizA heightA widthA
 -> Extent measB vertB horizB heightB widthB)
-> Full measA vertA horizA heightA widthA a
-> Full measB vertB horizB heightB widthB a
Basic.mapExtent ((Extent meas Small Small height width
  -> Extent Shape Small Small width width)
 -> FullArray meas Small Small height width a
 -> FullArray Shape Small Small width width a)
-> (Extent meas Small Small height width
    -> Extent Shape Small Small width width)
-> FullArray meas Small Small height width a
-> FullArray Shape Small Small width width a
forall a b. (a -> b) -> a -> b
$
               width -> Extent Shape Small Small width width
forall sh. sh -> Square sh
Extent.square (width -> Extent Shape Small Small width width)
-> (Extent meas Small Small height width -> width)
-> Extent meas Small Small height width
-> Extent Shape Small Small width width
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Extent meas Small Small height width -> width
forall meas vert horiz height width.
(Measure meas, C vert, C horiz) =>
Extent meas vert horiz height width -> width
Extent.width
         Omni.UpperTriangular UpperTriangular height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper width a
a
         Omni.LowerTriangular LowerTriangular height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper width a
a
         Omni.Symmetric Symmetric height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper width a
a
         Omni.Hermitian Hermitian height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper width a
a
         Omni.Banded Banded sub super meas Small Small height width
_ ->
            ((QuadraticMeas
   (Array pack property) xl xu lower upper meas height width a
 -> ArrayMatrix
      pack property lower upper Shape Small Small width width a)
-> QuadraticMeas
     (Array pack property) xl xu lower upper meas height width a
-> ArrayMatrix
     pack property lower upper Shape Small Small width width a
forall a b. (a -> b) -> a -> b
$QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
a) ((QuadraticMeas
    (Array pack property) xl xu lower upper meas height width a
  -> ArrayMatrix
       pack property lower upper Shape Small Small width width a)
 -> ArrayMatrix
      pack property lower upper Shape Small Small width width a)
-> (QuadraticMeas
      (Array pack property) xl xu lower upper meas height width a
    -> ArrayMatrix
         pack property lower upper Shape Small Small width width a)
-> ArrayMatrix
     pack property lower upper Shape Small Small width width a
forall a b. (a -> b) -> a -> b
$ (PlainArray
   pack property lower upper meas Small Small height width a
 -> PlainArray
      pack property lower upper Shape Small Small width width a)
-> ArrayMatrix
     pack property lower upper meas Small Small height width a
-> ArrayMatrix
     pack property lower upper Shape Small Small width 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
lift1 ((PlainArray
    pack property lower upper meas Small Small height width a
  -> PlainArray
       pack property lower upper Shape Small Small width width a)
 -> ArrayMatrix
      pack property lower upper meas Small Small height width a
 -> ArrayMatrix
      pack property lower upper Shape Small Small width width a)
-> (PlainArray
      pack property lower upper meas Small Small height width a
    -> PlainArray
         pack property lower upper Shape Small Small width width a)
-> ArrayMatrix
     pack property lower upper meas Small Small height width a
-> ArrayMatrix
     pack property lower upper Shape Small Small width width a
forall a b. (a -> b) -> a -> b
$ (Extent meas Small Small height width
 -> Extent Shape Small Small width width)
-> Banded sub super meas Small Small height width a
-> Banded sub super Shape Small Small width width a
forall vertA horizA vertB horizB measA heightA widthA measB heightB
       widthB sub super a.
(C vertA, C horizA, C vertB, C horizB) =>
(Extent measA vertA horizA heightA widthA
 -> Extent measB vertB horizB heightB widthB)
-> Banded sub super measA vertA horizA heightA widthA a
-> Banded sub super measB vertB horizB heightB widthB a
Banded.mapExtentSizes ((Extent meas Small Small height width
  -> Extent Shape Small Small width width)
 -> Banded sub super meas Small Small height width a
 -> Banded sub super Shape Small Small width width a)
-> (Extent meas Small Small height width
    -> Extent Shape Small Small width width)
-> Banded sub super meas Small Small height width a
-> Banded sub super Shape Small Small width width a
forall a b. (a -> b) -> a -> b
$ width -> Extent Shape Small Small width width
forall sh. sh -> Square sh
Extent.square (width -> Extent Shape Small Small width width)
-> (Extent meas Small Small height width -> width)
-> Extent meas Small Small height width
-> Extent Shape Small Small width width
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Extent meas Small Small height width -> width
forall meas vert horiz height width.
(Measure meas, C vert, C horiz) =>
Extent meas vert horiz height width -> width
Extent.width
         Omni.UnitBandedTriangular BandedSquare sub super height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper width a
a
         Omni.BandedHermitian BandedHermitian offDiag height
_ -> QuadraticMeas
  (Array pack property) xl xu lower upper meas height width a
Quadratic (Array pack property) xl xu lower upper width a
a


instance
   (MapExtent pack property lower upper, xl ~ (), xu ~ ()) =>
      Matrix.MapExtent (Array pack property) xl xu lower upper where
   mapExtent :: Map measA vertA horizA measB vertB horizB height width
-> Matrix
     (Array pack property)
     xl
     xu
     lower
     upper
     measA
     vertA
     horizA
     height
     width
     a
-> Matrix
     (Array pack property)
     xl
     xu
     lower
     upper
     measB
     vertB
     horizB
     height
     width
     a
mapExtent = Map measA vertA horizA measB vertB horizB height width
-> Matrix
     (Array pack property)
     xl
     xu
     lower
     upper
     measA
     vertA
     horizA
     height
     width
     a
-> Matrix
     (Array pack property)
     xl
     xu
     lower
     upper
     measB
     vertB
     horizB
     height
     width
     a
forall pack property lower upper measA vertA horizA measB vertB
       horizB height width a.
(MapExtent pack property lower upper, Measure measA, C vertA,
 C horizA, Measure measB, C vertB, C horizB) =>
Map measA vertA horizA measB vertB horizB height width
-> ArrayMatrix
     pack property lower upper measA vertA horizA height width a
-> ArrayMatrix
     pack property lower upper measB vertB horizB height width a
mapExtent

class MapExtent pack property lower upper where
   mapExtent ::
      (Extent.Measure measA, Extent.C vertA, Extent.C horizA) =>
      (Extent.Measure measB, Extent.C vertB, Extent.C horizB) =>
      ExtentStrict.Map measA vertA horizA measB vertB horizB height width ->
      ArrayMatrix pack property lower upper measA vertA horizA height width a ->
      ArrayMatrix pack property lower upper measB vertB horizB height width a

instance MapExtent Unpacked Arbitrary Filled Filled where
   mapExtent :: Map measA vertA horizA measB vertB horizB height width
-> ArrayMatrix
     Unpacked Arbitrary Filled Filled measA vertA horizA height width a
-> ArrayMatrix
     Unpacked Arbitrary Filled Filled measB vertB horizB height width a
mapExtent = (Array (Full measA vertA horizA height width) a
 -> Array (Full measB vertB horizB height width) a)
-> ArrayMatrix
     Unpacked Arbitrary Filled Filled measA vertA horizA height width a
-> ArrayMatrix
     Unpacked Arbitrary Filled Filled measB vertB horizB 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
lift1 ((Array (Full measA vertA horizA height width) a
  -> Array (Full measB vertB horizB height width) a)
 -> ArrayMatrix
      Unpacked Arbitrary Filled Filled measA vertA horizA height width a
 -> ArrayMatrix
      Unpacked Arbitrary Filled Filled measB vertB horizB height width a)
-> (Map measA vertA horizA measB vertB horizB height width
    -> Array (Full measA vertA horizA height width) a
    -> Array (Full measB vertB horizB height width) a)
-> Map measA vertA horizA measB vertB horizB height width
-> ArrayMatrix
     Unpacked Arbitrary Filled Filled measA vertA horizA height width a
-> ArrayMatrix
     Unpacked Arbitrary Filled Filled measB vertB horizB height width a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Map measA vertA horizA measB vertB horizB height width
-> Array (Full measA vertA horizA height width) a
-> Array (Full measB vertB horizB height width) a
forall measA vertA horizA measB vertB horizB height width a.
(Measure measA, C vertA, C horizA, Measure measB, C vertB,
 C horizB) =>
Map measA vertA horizA measB vertB horizB height width
-> Full measA vertA horizA height width a
-> Full measB vertB horizB height width a
Plain.mapExtent (Map measA vertA horizA measB vertB horizB height width
 -> Array (Full measA vertA horizA height width) a
 -> Array (Full measB vertB horizB height width) a)
-> (Map measA vertA horizA measB vertB horizB height width
    -> Map measA vertA horizA measB vertB horizB height width)
-> Map measA vertA horizA measB vertB horizB height width
-> Array (Full measA vertA horizA height width) a
-> Array (Full measB vertB horizB height width) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Map measA vertA horizA measB vertB horizB height width
-> Map measA vertA horizA measB vertB horizB height width
forall measA vertA horizA measB vertB horizB height width.
Map measA vertA horizA measB vertB horizB height width
-> Map measA vertA horizA measB vertB horizB height width
ExtentStrict.apply

instance
   (Unary.Natural sub, Unary.Natural super) =>
      MapExtent Packed Arbitrary (Bands sub) (Bands super) where
   mapExtent :: Map measA vertA horizA measB vertB horizB height width
-> ArrayMatrix
     Packed
     Arbitrary
     (Bands sub)
     (Bands super)
     measA
     vertA
     horizA
     height
     width
     a
-> ArrayMatrix
     Packed
     Arbitrary
     (Bands sub)
     (Bands super)
     measB
     vertB
     horizB
     height
     width
     a
mapExtent = (Array (Banded sub super measA vertA horizA height width) a
 -> Array (Banded sub super measB vertB horizB height width) a)
-> ArrayMatrix
     Packed
     Arbitrary
     (Bands sub)
     (Bands super)
     measA
     vertA
     horizA
     height
     width
     a
-> ArrayMatrix
     Packed
     Arbitrary
     (Bands sub)
     (Bands super)
     measB
     vertB
     horizB
     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
lift1 ((Array (Banded sub super measA vertA horizA height width) a
  -> Array (Banded sub super measB vertB horizB height width) a)
 -> ArrayMatrix
      Packed
      Arbitrary
      (Bands sub)
      (Bands super)
      measA
      vertA
      horizA
      height
      width
      a
 -> ArrayMatrix
      Packed
      Arbitrary
      (Bands sub)
      (Bands super)
      measB
      vertB
      horizB
      height
      width
      a)
-> (Map measA vertA horizA measB vertB horizB height width
    -> Array (Banded sub super measA vertA horizA height width) a
    -> Array (Banded sub super measB vertB horizB height width) a)
-> Map measA vertA horizA measB vertB horizB height width
-> ArrayMatrix
     Packed
     Arbitrary
     (Bands sub)
     (Bands super)
     measA
     vertA
     horizA
     height
     width
     a
-> ArrayMatrix
     Packed
     Arbitrary
     (Bands sub)
     (Bands super)
     measB
     vertB
     horizB
     height
     width
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Map measA vertA horizA measB vertB horizB height width
-> Array (Banded sub super measA vertA horizA height width) a
-> Array (Banded sub super measB vertB horizB height width) a
forall vertA horizA vertB horizB measA measB height width sub super
       a.
(C vertA, C horizA, C vertB, C horizB) =>
Map measA vertA horizA measB vertB horizB height width
-> Banded sub super measA vertA horizA height width a
-> Banded sub super measB vertB horizB height width a
Banded.mapExtent (Map measA vertA horizA measB vertB horizB height width
 -> Array (Banded sub super measA vertA horizA height width) a
 -> Array (Banded sub super measB vertB horizB height width) a)
-> (Map measA vertA horizA measB vertB horizB height width
    -> Map measA vertA horizA measB vertB horizB height width)
-> Map measA vertA horizA measB vertB horizB height width
-> Array (Banded sub super measA vertA horizA height width) a
-> Array (Banded sub super measB vertB horizB height width) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Map measA vertA horizA measB vertB horizB height width
-> Map measA vertA horizA measB vertB horizB height width
forall measA vertA horizA measB vertB horizB height width.
Map measA vertA horizA measB vertB horizB height width
-> Map measA vertA horizA measB vertB horizB height width
ExtentStrict.apply