{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
module Numeric.LAPACK.Matrix.Array.Private (
   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.Private 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.Format as ArrFormat
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.Shape.Omni (Omni, Arbitrary)
import Numeric.LAPACK.Matrix.Layout.Private
         (Filled, Bands, GetBands, Packed, Unpacked)
import Numeric.LAPACK.Matrix.Extent.Private (Extent, Shape, Size, Big, Small)
import Numeric.LAPACK.Matrix.Type.Private (Matrix)
import Numeric.LAPACK.Vector (Vector)
import Numeric.LAPACK.Scalar (RealOf, conjugate)

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 GHC.Exts (Constraint)

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 :: forall meas vert horiz height width a xl xu lower upper.
(Measure meas, C vert, C horiz, NFData height, NFData width,
 NFData a) =>
Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> ()
rnf (Array OmniArray pack property lower upper meas vert horiz height width a
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
   type BoxExtra (Array pack property) extra = extra ~ ()
   extent :: forall xl xu meas vert horiz lower upper height width a.
(BoxExtra (Array pack property) xl,
 BoxExtra (Array pack property) xu, Measure meas, C vert,
 C horiz) =>
Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
extent (Array OmniArray pack property lower upper meas vert horiz height width a
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
$ OmniArray 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 OmniArray pack property lower upper meas vert horiz height width a
arr

instance Matrix.Transpose (Array pack property) where
   type TransposeExtra (Array pack property) extra = extra ~ ()
   transpose :: forall xl xu meas vert horiz height width a lower upper.
(TransposeExtra (Array pack property) xl,
 TransposeExtra (Array pack property) xu, Measure meas, C vert,
 C horiz, C height, C width, Floating a) =>
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 OmniArray pack property lower upper meas vert horiz height width 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 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 Mosaic Packed NoMirror Upper height a
-> Mosaic Packed NoMirror (TriTransposed Upper) height a
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 Mosaic Packed NoMirror Lower height a
-> Mosaic Packed NoMirror (TriTransposed Lower) height a
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 HermitianP Packed 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 Vector (HermitianP Packed height) a
-> Vector (HermitianP Packed height) a
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 Banded sub super meas vert horiz height width a
-> Banded super sub meas horiz vert width height a
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 Banded sub super Shape Small Small height height a
-> Banded super sub Shape Small Small height height a
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 Vector (BandedHermitian offDiag height) a
-> Vector (BandedHermitian offDiag height) a
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 :: forall property lower upper meas vert horiz height width a.
Id
  (ArrayMatrix
     Packed property lower upper meas vert horiz height width a)
asPacked = ArrayMatrix
  Packed property lower upper meas vert horiz height width a
-> 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 :: forall property lower upper meas vert horiz height width a.
Id
  (ArrayMatrix
     Unpacked property lower upper meas vert horiz height width a)
asUnpacked = ArrayMatrix
  Unpacked property lower upper meas vert horiz height width a
-> 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 :: forall pack property lower upper meas vert horiz height width a.
PackingSingleton pack
-> Id
     (ArrayMatrix
        pack property lower upper meas vert horiz height width a)
requirePacking PackingSingleton pack
_ = ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> 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 :: 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
-> 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 :: 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 (Array OmniArray pack property lower upper meas vert horiz height width a
a) = OmniArray 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 OmniArray 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 :: forall meas vert horiz pack property lower upper height width a.
(Measure meas, C vert, C horiz) =>
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
      (Bands sub) upper meas vert horiz height width a ->
   Unary.HeadSingleton sub
subBandsSingleton :: forall sub pack property upper meas vert horiz height width a.
Natural sub =>
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 (Bands super) meas vert horiz height width a ->
   Unary.HeadSingleton super
superBandsSingleton :: forall super pack property lower meas vert horiz height width a.
Natural super =>
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 :: forall measA vertA horizA measB vertB horizB heightA widthA heightB
       widthB packB propB lowerB upperB packA propA lowerA upperA a.
(Measure measA, C vertA, C horizA, Measure measB, C vertB,
 C horizB, C heightA, C widthA, C heightB, 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 = (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 :: forall measA vertA horizA measB vertB horizB heightA widthA heightB
       widthB packA propA lowerA upperA packB propB lowerB upperB a.
(Measure measA, C vertA, C horizA, Measure measB, C vertB,
 C horizB, C heightA, C widthA, C heightB, 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 = (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 :: 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 (Array OmniArray pack property lower upper meas vert horiz height width a
a) = (Omni pack property lower upper meas vert horiz height width
 -> Plain pack property lower upper meas vert horiz height width)
-> OmniArray
     pack property lower upper meas vert horiz height width a
-> Array
     (Plain 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 OmniArray 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 :: 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 (Array OmniArray pack property lower upper meas vert horiz height width a
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 :: forall pack prop lower upper meas vert horiz height width shape a.
(FromPlain pack prop lower upper meas vert horiz height width,
 Plain pack prop lower upper meas vert horiz height width ~ shape,
 Measure meas, C vert, C horiz, C height, C width, Floating a) =>
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 :: 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 = 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)
-> (Array
      (Plain pack prop lower upper meas vert horiz height width) a
    -> OmniArray pack prop lower upper meas vert horiz height width a)
-> Array
     (Plain 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)
-> Array
     (Plain 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 :: 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
  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 :: 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
  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 :: 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
  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 :: 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 packE propE lowerE
       upperE measE vertE horizE heightE widthE a b c d e.
(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,
 ToPlain
   packD propD lowerD upperD measD vertD horizD heightD widthD,
 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
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 :: 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
  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
-> Array
     (Plain 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
 -> Array
      (Plain packB propB lowerB upperB measB vertB horizB heightB widthB)
      b)
-> (Array
      (Plain packA propA lowerA upperA measA vertA horizA heightA widthA)
      a
    -> ArrayMatrix
         packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> Array
     (Plain packA propA lowerA upperA measA vertA horizA heightA widthA)
     a
-> Array
     (Plain 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)
-> (Array
      (Plain packA propA lowerA upperA measA vertA horizA heightA widthA)
      a
    -> ArrayMatrix
         packA propA lowerA upperA measA vertA horizA heightA widthA a)
-> Array
     (Plain 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
. Array
  (Plain 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 :: 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.
(FromPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB,
 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
f = (ArrayMatrix
   packB propB lowerB upperB measB vertB horizB heightB widthB b
 -> ArrayMatrix
      packC propC lowerC upperC measC vertC horizC heightC widthC c)
-> Array
     (Plain packB propB lowerB upperB measB vertB horizB heightB widthB)
     b
-> Array
     (Plain 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)
 -> Array
      (Plain packB propB lowerB upperB measB vertB horizB heightB widthB)
      b
 -> Array
      (Plain packC propC lowerC upperC measC vertC horizC heightC widthC)
      c)
-> (Array
      (Plain 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)
-> Array
     (Plain packA propA lowerA upperA measA vertA horizA heightA widthA)
     a
-> Array
     (Plain packB propB lowerB upperB measB vertB horizB heightB widthB)
     b
-> Array
     (Plain 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)
-> (Array
      (Plain packA propA lowerA upperA measA vertA horizA heightA widthA)
      a
    -> ArrayMatrix
         packA propA lowerA upperA measA vertA horizA heightA widthA a)
-> Array
     (Plain 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
. Array
  (Plain 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 :: 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 = (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
-> Array (Full 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
 -> Array (Full 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
-> Array (Full 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 :: 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 = OmniArray
  Unpacked
  propertyA
  lowerA
  upperA
  measA
  vertA
  horizA
  heightA
  widthA
  a
-> Matrix
     (Array Unpacked 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
 -> Matrix
      (Array Unpacked 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
-> Matrix
     (Array Unpacked 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 :: 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 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 :: 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 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 :: forall propertyA lowerA upperA propertyB lowerB upperB propertyC
       lowerC upperC propertyD lowerD upperD measA vertA horizA heightA
       widthA a measB vertB horizB heightB widthB b measC vertC horizC
       heightC widthC c measD vertD horizD heightD widthD d.
(Property propertyA, Strip lowerA, Strip upperA,
 Property propertyB, Strip lowerB, Strip upperB, Property propertyC,
 Strip lowerC, Strip upperC, Property propertyD, Strip lowerD,
 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
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 :: forall height0 a height1 b.
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
(General () height0 a -> General () height1 b)
-> PlainArray
     Unpacked Arbitrary Filled Filled Size Big Big () height0 a
-> PlainArray
     Unpacked Arbitrary Filled Filled Size Big Big () 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 :: forall height0 a height1 b.
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
(General height0 () a -> General height1 () b)
-> PlainArray
     Unpacked Arbitrary Filled Filled Size Big Big height0 () a
-> PlainArray
     Unpacked Arbitrary Filled Filled Size Big Big 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.Format (Array pack property) where
   type FormatExtra (Array pack property) extra = ()
   format :: forall xl xu meas vert horiz height width a out lower upper.
(FormatExtra (Array pack property) xl,
 FormatExtra (Array pack property) xu, Measure meas, C vert,
 C horiz, C height, C width, Floating a, Output out) =>
Config
-> Matrix
     (Array pack property)
     xl
     xu
     lower
     upper
     meas
     vert
     horiz
     height
     width
     a
-> out
format = Config
-> Matrix
     (Array pack property)
     xl
     xu
     lower
     upper
     meas
     vert
     horiz
     height
     width
     a
-> out
forall typ xl xu meas vert horiz height width a out lower upper.
(Layout typ, LayoutExtra typ xl, LayoutExtra typ xu, Measure meas,
 C vert, C horiz, C height, C width, Floating a, Output out) =>
Config
-> Matrix typ xl xu lower upper meas vert horiz height width a
-> out
Matrix.formatWithLayout

instance Matrix.Layout (Array pack property) where
   type LayoutExtra (Array pack property) extra = ()
   layout :: forall xl xu meas vert horiz height width a lower upper.
(LayoutExtra (Array pack property) xl,
 LayoutExtra (Array pack property) xu, Measure meas, C vert,
 C horiz, C height, C width, Floating a) =>
Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Array (height, width) (Separator, Maybe (Style, a))
layout a :: Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
a@(Array OmniArray pack property lower upper meas vert horiz height width 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 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 ->
            Extent meas vert horiz height width
-> [[a]] -> Array (height, width) (Separator, Maybe (Style, a))
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz, C height, C width) =>
Extent meas vert horiz height width
-> [[a]] -> Array (height, width) (Separator, Maybe (Style, a))
ArrFormat.arrayFromList2 (Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
forall typ xl xu meas vert horiz lower upper height width a.
(Box typ, BoxExtra typ xl, BoxExtra typ xu, Measure meas, C vert,
 C horiz) =>
Matrix typ xl xu lower upper meas vert horiz height width a
-> Extent meas vert horiz height width
forall xl xu meas vert horiz lower upper height width a.
(BoxExtra (Array pack property) xl,
 BoxExtra (Array pack property) xu, Measure meas, C vert,
 C horiz) =>
Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
Matrix.extent Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
a) ([[a]] -> Array (height, width) (Separator, Maybe (Style, a)))
-> [[a]] -> Array (height, width) (Separator, Maybe (Style, a))
forall a b. (a -> b) -> a -> b
$
            Full meas vert horiz height width a -> [[a]]
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz, C height, C width, Floating a) =>
Full meas vert horiz height width a -> [[a]]
ArrFormat.layoutFull (Full meas vert horiz height width a -> [[a]])
-> Full meas vert horiz height width a -> [[a]]
forall a b. (a -> b) -> a -> b
$ Full meas vert horiz height width
-> OmniArray
     pack property lower upper meas vert horiz height width a
-> 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 (OmniArray pack property lower upper meas vert horiz height width a
 -> Full meas vert horiz height width a)
-> OmniArray
     pack property lower upper meas vert horiz height width a
-> 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
-> OmniArray
     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
_ ->
            Extent meas vert horiz height width
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz, C height, C width) =>
Extent meas vert horiz height width
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
ArrFormat.incompleteArrayFromList2 (Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
forall typ xl xu meas vert horiz lower upper height width a.
(Box typ, BoxExtra typ xl, BoxExtra typ xu, Measure meas, C vert,
 C horiz) =>
Matrix typ xl xu lower upper meas vert horiz height width a
-> Extent meas vert horiz height width
forall xl xu meas vert horiz lower upper height width a.
(BoxExtra (Array pack property) xl,
 BoxExtra (Array pack property) xu, Measure meas, C vert,
 C horiz) =>
Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
Matrix.extent Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
a) ([[Maybe a]]
 -> Array (height, width) (Separator, Maybe (Style, a)))
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
forall a b. (a -> b) -> a -> b
$
            Array (UpperTriangular height) a -> [[Maybe a]]
forall uplo size a.
(UpLo uplo, C size, Floating a) =>
Array (Triangular uplo size) a -> [[Maybe a]]
ArrFormat.layoutTriangular (Array (UpperTriangular height) a -> [[Maybe a]])
-> Array (UpperTriangular height) a -> [[Maybe a]]
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
_ ->
            Extent meas vert horiz height width
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz, C height, C width) =>
Extent meas vert horiz height width
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
ArrFormat.incompleteArrayFromList2 (Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
forall typ xl xu meas vert horiz lower upper height width a.
(Box typ, BoxExtra typ xl, BoxExtra typ xu, Measure meas, C vert,
 C horiz) =>
Matrix typ xl xu lower upper meas vert horiz height width a
-> Extent meas vert horiz height width
forall xl xu meas vert horiz lower upper height width a.
(BoxExtra (Array pack property) xl,
 BoxExtra (Array pack property) xu, Measure meas, C vert,
 C horiz) =>
Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
Matrix.extent Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
a) ([[Maybe a]]
 -> Array (height, width) (Separator, Maybe (Style, a)))
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
forall a b. (a -> b) -> a -> b
$
            Array (LowerTriangular height) a -> [[Maybe a]]
forall uplo size a.
(UpLo uplo, C size, Floating a) =>
Array (Triangular uplo size) a -> [[Maybe a]]
ArrFormat.layoutTriangular (Array (LowerTriangular height) a -> [[Maybe a]])
-> Array (LowerTriangular height) a -> [[Maybe a]]
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
_ ->
            Extent meas vert horiz height width
-> [[a]] -> Array (height, width) (Separator, Maybe (Style, a))
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz, C height, C width) =>
Extent meas vert horiz height width
-> [[a]] -> Array (height, width) (Separator, Maybe (Style, a))
ArrFormat.splitArrayFromList2 (Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
forall typ xl xu meas vert horiz lower upper height width a.
(Box typ, BoxExtra typ xl, BoxExtra typ xu, Measure meas, C vert,
 C horiz) =>
Matrix typ xl xu lower upper meas vert horiz height width a
-> Extent meas vert horiz height width
forall xl xu meas vert horiz lower upper height width a.
(BoxExtra (Array pack property) xl,
 BoxExtra (Array pack property) xu, Measure meas, C vert,
 C horiz) =>
Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
Matrix.extent Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
a) ([[a]] -> Array (height, width) (Separator, Maybe (Style, a)))
-> [[a]] -> Array (height, width) (Separator, Maybe (Style, a))
forall a b. (a -> b) -> a -> b
$
            (a -> a) -> Array (Symmetric height) a -> [[a]]
forall size a mirror.
(C size, Floating a) =>
(a -> a) -> Array (Mosaic Packed mirror Upper size) a -> [[a]]
ArrFormat.layoutMirrored a -> a
forall a. a -> a
id (Array (Symmetric height) a -> [[a]])
-> Array (Symmetric height) a -> [[a]]
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
_ ->
            Extent meas vert horiz height width
-> [[a]] -> Array (height, width) (Separator, Maybe (Style, a))
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz, C height, C width) =>
Extent meas vert horiz height width
-> [[a]] -> Array (height, width) (Separator, Maybe (Style, a))
ArrFormat.splitArrayFromList2 (Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
forall typ xl xu meas vert horiz lower upper height width a.
(Box typ, BoxExtra typ xl, BoxExtra typ xu, Measure meas, C vert,
 C horiz) =>
Matrix typ xl xu lower upper meas vert horiz height width a
-> Extent meas vert horiz height width
forall xl xu meas vert horiz lower upper height width a.
(BoxExtra (Array pack property) xl,
 BoxExtra (Array pack property) xu, Measure meas, C vert,
 C horiz) =>
Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
Matrix.extent Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
a) ([[a]] -> Array (height, width) (Separator, Maybe (Style, a)))
-> [[a]] -> Array (height, width) (Separator, Maybe (Style, a))
forall a b. (a -> b) -> a -> b
$
            (a -> a) -> Array (Hermitian height) a -> [[a]]
forall size a mirror.
(C size, Floating a) =>
(a -> a) -> Array (Mosaic Packed mirror Upper size) a -> [[a]]
ArrFormat.layoutMirrored a -> a
forall a. Floating a => a -> a
conjugate (Array (Hermitian height) a -> [[a]])
-> Array (Hermitian height) a -> [[a]]
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
_ ->
            Extent meas vert horiz height width
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz, C height, C width) =>
Extent meas vert horiz height width
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
ArrFormat.incompleteArrayFromList2 (Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
forall typ xl xu meas vert horiz lower upper height width a.
(Box typ, BoxExtra typ xl, BoxExtra typ xu, Measure meas, C vert,
 C horiz) =>
Matrix typ xl xu lower upper meas vert horiz height width a
-> Extent meas vert horiz height width
forall xl xu meas vert horiz lower upper height width a.
(BoxExtra (Array pack property) xl,
 BoxExtra (Array pack property) xu, Measure meas, C vert,
 C horiz) =>
Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
Matrix.extent Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
a) ([[Maybe a]]
 -> Array (height, width) (Separator, Maybe (Style, a)))
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
forall a b. (a -> b) -> a -> b
$
            Array (Banded sub super meas vert horiz height width) a
-> [[Maybe 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) =>
Array (Banded sub super meas vert horiz height width) a
-> [[Maybe a]]
ArrFormat.layoutBanded (Array (Banded sub super meas vert horiz height width) a
 -> [[Maybe a]])
-> Array (Banded sub super meas vert horiz height width) a
-> [[Maybe a]]
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
_ ->
            Extent meas vert horiz height width
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz, C height, C width) =>
Extent meas vert horiz height width
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
ArrFormat.incompleteArrayFromList2 (Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
forall typ xl xu meas vert horiz lower upper height width a.
(Box typ, BoxExtra typ xl, BoxExtra typ xu, Measure meas, C vert,
 C horiz) =>
Matrix typ xl xu lower upper meas vert horiz height width a
-> Extent meas vert horiz height width
forall xl xu meas vert horiz lower upper height width a.
(BoxExtra (Array pack property) xl,
 BoxExtra (Array pack property) xu, Measure meas, C vert,
 C horiz) =>
Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
Matrix.extent Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
a) ([[Maybe a]]
 -> Array (height, width) (Separator, Maybe (Style, a)))
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
forall a b. (a -> b) -> a -> b
$
            Array (BandedSquare sub super height) a -> [[Maybe 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) =>
Array (Banded sub super meas vert horiz height width) a
-> [[Maybe a]]
ArrFormat.layoutBanded (Array (BandedSquare sub super height) a -> [[Maybe a]])
-> Array (BandedSquare sub super height) a -> [[Maybe a]]
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
_ ->
            Extent meas vert horiz height width
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
forall meas vert horiz height width a.
(Measure meas, C vert, C horiz, C height, C width) =>
Extent meas vert horiz height width
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
ArrFormat.incompleteSplitArrayFromList2 (Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
forall typ xl xu meas vert horiz lower upper height width a.
(Box typ, BoxExtra typ xl, BoxExtra typ xu, Measure meas, C vert,
 C horiz) =>
Matrix typ xl xu lower upper meas vert horiz height width a
-> Extent meas vert horiz height width
forall xl xu meas vert horiz lower upper height width a.
(BoxExtra (Array pack property) xl,
 BoxExtra (Array pack property) xu, Measure meas, C vert,
 C horiz) =>
Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Extent meas vert horiz height width
Matrix.extent Matrix
  (Array pack property)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
a) ([[Maybe a]]
 -> Array (height, width) (Separator, Maybe (Style, a)))
-> [[Maybe a]]
-> Array (height, width) (Separator, Maybe (Style, a))
forall a b. (a -> b) -> a -> b
$
            Array (BandedHermitian offDiag height) a -> [[Maybe a]]
forall offDiag sh a.
(Natural offDiag, C sh, Floating a) =>
Array (BandedHermitian offDiag sh) a -> [[Maybe a]]
ArrFormat.layoutBandedHermitian (Array (BandedHermitian offDiag height) a -> [[Maybe a]])
-> Array (BandedHermitian offDiag height) a -> [[Maybe a]]
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 :: forall pack diag lower upper meas vert horiz height width a.
Packing pack =>
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 :: 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 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) =>
      Matrix.MultiplySame (Array pack diag) where
   type MultiplySameExtra (Array pack diag) extra = extra ~ ()
   multiplySame :: forall matrix xl xu lower upper meas vert horiz sh a.
(matrix
 ~ Matrix
     (Array pack diag) xl xu lower upper meas vert horiz sh sh a,
 MultiplySameExtra (Array pack diag) xl,
 MultiplySameExtra (Array pack diag) xu, PowerStrip lower,
 PowerStrip upper, Measure meas, C vert, C horiz, C sh, Eq sh,
 Floating a) =>
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, BoxExtra typ xl, BoxExtra typ xu) =>
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, BoxExtra typ xl, BoxExtra typ xu) =>
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 Banded U0 U0 Shape Small Small sh sh a
-> Banded U0 U0 Shape Small Small sh sh a
-> Banded (U0 :+: U0) (U0 :+: 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
-> 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 Banded U0 U0 meas vert horiz sh sh a
-> Banded U0 U0 meas vert horiz sh sh a
-> Banded (U0 :+: U0) (U0 :+: 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
-> 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 :: 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) =>
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
-> Matrix
     (Array 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
 -> Matrix
      (Array 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
-> Matrix
     (Array 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 :: 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) =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
negate (Array OmniArray pack property lower upper meas vert horiz height width a
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 :: 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 RealOf a
a (Array OmniArray pack property lower upper meas vert horiz height width a
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 {forall (f :: * -> *) a. 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 :: forall property meas vert horiz height width a pack lower upper.
(Homogeneous property, Measure meas, C vert, C horiz, C height,
 C width, 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 =
   ScaleReal
  (Matrix
     (Array pack property)
     ()
     ()
     lower
     upper
     meas
     vert
     horiz
     height
     width)
  a
-> a
-> Matrix
     (Array pack property)
     ()
     ()
     lower
     upper
     meas
     vert
     horiz
     height
     width
     a
-> Matrix
     (Array 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
 -> Matrix
      (Array pack property)
      ()
      ()
      lower
      upper
      meas
      vert
      horiz
      height
      width
      a
 -> Matrix
      (Array pack property)
      ()
      ()
      lower
      upper
      meas
      vert
      horiz
      height
      width
      a)
-> ScaleReal
     (Matrix
        (Array pack property)
        ()
        ()
        lower
        upper
        meas
        vert
        horiz
        height
        width)
     a
-> a
-> Matrix
     (Array pack property)
     ()
     ()
     lower
     upper
     meas
     vert
     horiz
     height
     width
     a
-> Matrix
     (Array 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
forall (f :: * -> *). 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
RealOf 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
RealOf 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 :: 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 a
a (Array OmniArray pack property lower upper meas vert horiz height width a
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


order ::
   ArrayMatrix pack property lower upper meas vert horiz height width a ->
   Layout.Order
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 = 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 :: 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
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 :: 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 = 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 :: 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
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 :: 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 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


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 :: 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 b
f (Array OmniArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
a) = OmniArray
  packB propB lowerB upperB measB vertB horizB heightB widthB b
-> Matrix
     (Array 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
 -> Matrix
      (Array packB propB)
      ()
      ()
      lowerB
      upperB
      measB
      vertB
      horizB
      heightB
      widthB
      b)
-> OmniArray
     packB propB lowerB upperB measB vertB horizB heightB widthB b
-> Matrix
     (Array 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 :: 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
  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 OmniArray
  packA propA lowerA upperA measA vertA horizA heightA widthA a
a) (Array OmniArray
  packB propB lowerB upperB measB vertB horizB heightB widthB b
b) = OmniArray
  packC propC lowerC upperC measC vertC horizC heightC widthC c
-> Matrix
     (Array 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
 -> Matrix
      (Array packC propC)
      ()
      ()
      lowerC
      upperC
      measC
      vertC
      horizC
      heightC
      widthC
      c)
-> OmniArray
     packC propC lowerC upperC measC vertC horizC heightC widthC c
-> Matrix
     (Array 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 :: forall meas xl xu lower upper height width a.
Measure meas =>
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 OmniArray pack property lower upper meas Small Small height width a
_) =
      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
 -> Quadratic (Array pack property) xl xu lower upper height a)
-> QuadraticMeas
     (Array pack property) xl xu lower upper meas height width a
-> Quadratic (Array pack property) xl xu lower upper 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
  -> Quadratic (Array pack property) xl xu lower upper height a)
 -> Quadratic (Array pack property) xl xu lower upper height a)
-> (QuadraticMeas
      (Array pack property) xl xu lower upper meas height width a
    -> Quadratic (Array pack property) xl xu lower upper height a)
-> Quadratic (Array pack property) xl xu lower upper 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
 -> Quadratic (Array pack property) xl xu lower upper height a)
-> QuadraticMeas
     (Array pack property) xl xu lower upper meas height width a
-> Quadratic (Array pack property) xl xu lower upper 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
  -> Quadratic (Array pack property) xl xu lower upper height a)
 -> Quadratic (Array pack property) xl xu lower upper height a)
-> (QuadraticMeas
      (Array pack property) xl xu lower upper meas height width a
    -> Quadratic (Array pack property) xl xu lower upper height a)
-> Quadratic (Array pack property) xl xu lower upper 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 :: forall meas xl xu lower upper height width a.
Measure meas =>
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 OmniArray pack property lower upper meas Small Small height width a
_) =
      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
 -> Quadratic (Array pack property) xl xu lower upper width a)
-> QuadraticMeas
     (Array pack property) xl xu lower upper meas height width a
-> Quadratic (Array pack property) xl xu lower upper 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
  -> Quadratic (Array pack property) xl xu lower upper width a)
 -> Quadratic (Array pack property) xl xu lower upper width a)
-> (QuadraticMeas
      (Array pack property) xl xu lower upper meas height width a
    -> Quadratic (Array pack property) xl xu lower upper width a)
-> Quadratic (Array pack property) xl xu lower upper 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
 -> Quadratic (Array pack property) xl xu lower upper width a)
-> QuadraticMeas
     (Array pack property) xl xu lower upper meas height width a
-> Quadratic (Array pack property) xl xu lower upper 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
  -> Quadratic (Array pack property) xl xu lower upper width a)
 -> Quadratic (Array pack property) xl xu lower upper width a)
-> (QuadraticMeas
      (Array pack property) xl xu lower upper meas height width a
    -> Quadratic (Array pack property) xl xu lower upper width a)
-> Quadratic (Array pack property) xl xu lower upper 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 ~ Arbitrary) =>
      Matrix.MapExtent (Array pack property) where
   type MapExtentExtra (Array pack property) extra = extra ~ ()
   type MapExtentStrip (Array pack property) strip = MapExtentStrip pack strip
   mapExtent :: forall xl lower xu upper measA vertA horizA measB vertB horizB
       height width a.
(MapExtentExtra (Array pack property) xl,
 MapExtentStrip (Array pack property) lower,
 MapExtentExtra (Array pack property) xu,
 MapExtentStrip (Array pack property) upper, Measure measA, C vertA,
 C horizA, Measure measB, C vertB, C horizB) =>
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
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
forall pack property measA vertA horizA measB vertB horizB lower
       upper height width a.
(MapExtent pack, property ~ Arbitrary, Measure measA, C vertA,
 C horizA, Measure measB, C vertB, C horizB,
 MapExtentStrip pack lower, MapExtentStrip pack upper) =>
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
forall property measA vertA horizA measB vertB horizB lower upper
       height width a.
(property ~ Arbitrary, Measure measA, C vertA, C horizA,
 Measure measB, C vertB, C horizB, MapExtentStrip pack lower,
 MapExtentStrip pack upper) =>
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 where
   type MapExtentStrip pack strip :: Constraint
   mapExtent ::
      (property ~ Arbitrary) =>
      (Extent.Measure measA, Extent.C vertA, Extent.C horizA) =>
      (Extent.Measure measB, Extent.C vertB, Extent.C horizB) =>
      (MapExtentStrip pack lower, MapExtentStrip pack upper) =>
      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 where
   type MapExtentStrip Unpacked strip = strip ~ Filled
   mapExtent :: forall property measA vertA horizA measB vertB horizB lower upper
       height width a.
(property ~ Arbitrary, Measure measA, C vertA, C horizA,
 Measure measB, C vertB, C horizB, MapExtentStrip Unpacked lower,
 MapExtentStrip Unpacked upper) =>
Map measA vertA horizA measB vertB horizB height width
-> ArrayMatrix
     Unpacked property lower upper measA vertA horizA height width a
-> ArrayMatrix
     Unpacked property lower upper measB vertB horizB height width a
mapExtent = (Array (Full measA vertA horizA height width) a
 -> Array (Full measB vertB horizB height width) a)
-> Matrix
     (Array Unpacked property)
     ()
     ()
     lower
     upper
     measA
     vertA
     horizA
     height
     width
     a
-> Matrix
     (Array Unpacked property)
     ()
     ()
     lower
     upper
     measB
     vertB
     horizB
     height
     width
     a
(PlainArray
   Unpacked property lower upper measA vertA horizA height width a
 -> PlainArray
      Unpacked property lower upper measB vertB horizB height width a)
-> Matrix
     (Array Unpacked property)
     ()
     ()
     lower
     upper
     measA
     vertA
     horizA
     height
     width
     a
-> Matrix
     (Array Unpacked property)
     ()
     ()
     lower
     upper
     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)
 -> Matrix
      (Array Unpacked property)
      ()
      ()
      lower
      upper
      measA
      vertA
      horizA
      height
      width
      a
 -> Matrix
      (Array Unpacked property)
      ()
      ()
      lower
      upper
      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
-> Matrix
     (Array Unpacked property)
     ()
     ()
     lower
     upper
     measA
     vertA
     horizA
     height
     width
     a
-> Matrix
     (Array Unpacked property)
     ()
     ()
     lower
     upper
     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 MapExtent Packed where
   type MapExtentStrip Packed strip =
            (strip ~ Bands (GetBands strip),
             Unary.Natural (GetBands strip))
   mapExtent :: forall property measA vertA horizA measB vertB horizB lower upper
       height width a.
(property ~ Arbitrary, Measure measA, C vertA, C horizA,
 Measure measB, C vertB, C horizB, MapExtentStrip Packed lower,
 MapExtentStrip Packed upper) =>
Map measA vertA horizA measB vertB horizB height width
-> ArrayMatrix
     Packed property lower upper measA vertA horizA height width a
-> ArrayMatrix
     Packed property lower upper measB vertB horizB height width a
mapExtent = (Array
   (Banded
      (GetBands lower) (GetBands upper) measA vertA horizA height width)
   a
 -> Array
      (Banded
         (GetBands lower) (GetBands upper) measB vertB horizB height width)
      a)
-> Matrix
     (Array Packed property)
     ()
     ()
     lower
     upper
     measA
     vertA
     horizA
     height
     width
     a
-> Matrix
     (Array Packed property)
     ()
     ()
     lower
     upper
     measB
     vertB
     horizB
     height
     width
     a
(PlainArray
   Packed property lower upper measA vertA horizA height width a
 -> PlainArray
      Packed property lower upper measB vertB horizB height width a)
-> Matrix
     (Array Packed property)
     ()
     ()
     lower
     upper
     measA
     vertA
     horizA
     height
     width
     a
-> Matrix
     (Array Packed property)
     ()
     ()
     lower
     upper
     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
       (GetBands lower) (GetBands upper) measA vertA horizA height width)
    a
  -> Array
       (Banded
          (GetBands lower) (GetBands upper) measB vertB horizB height width)
       a)
 -> Matrix
      (Array Packed property)
      ()
      ()
      lower
      upper
      measA
      vertA
      horizA
      height
      width
      a
 -> Matrix
      (Array Packed property)
      ()
      ()
      lower
      upper
      measB
      vertB
      horizB
      height
      width
      a)
-> (Map measA vertA horizA measB vertB horizB height width
    -> Array
         (Banded
            (GetBands lower) (GetBands upper) measA vertA horizA height width)
         a
    -> Array
         (Banded
            (GetBands lower) (GetBands upper) measB vertB horizB height width)
         a)
-> Map measA vertA horizA measB vertB horizB height width
-> Matrix
     (Array Packed property)
     ()
     ()
     lower
     upper
     measA
     vertA
     horizA
     height
     width
     a
-> Matrix
     (Array Packed property)
     ()
     ()
     lower
     upper
     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
        (GetBands lower) (GetBands upper) measA vertA horizA height width)
     a
-> Array
     (Banded
        (GetBands lower) (GetBands upper) 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
         (GetBands lower) (GetBands upper) measA vertA horizA height width)
      a
 -> Array
      (Banded
         (GetBands lower) (GetBands upper) 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
        (GetBands lower) (GetBands upper) measA vertA horizA height width)
     a
-> Array
     (Banded
        (GetBands lower) (GetBands upper) 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