{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE GADTs #-}
module Numeric.LAPACK.Matrix.Triangular (
   Triangular, MatrixShape.UpLo,
   Upper, FlexUpper, Triangular.UnitUpper, Triangular.QuasiUpper,
   Lower, FlexLower, Triangular.UnitLower,
   size,
   fromList, autoFromList,
   lowerFromList, autoLowerFromList,
   upperFromList, autoUpperFromList,
   asLower, asUpper,
   requireUnitDiagonal, requireArbitraryDiagonal,
   relaxUnitDiagonal, strictArbitraryDiagonal,
   OmniMatrix.identityOrder,
   diagonal,
   takeDiagonal,
   transpose,
   adjoint,

   stackLower, (#%%%),
   stackUpper, (%%%#),
   splitLower,
   splitUpper,
   takeTopLeft,
   takeTopRight,
   takeBottomLeft,
   takeBottomRight,

   pack,
   toSquare,
   takeLower,
   takeUpper,

   fromLowerRowMajor, toLowerRowMajor,
   fromUpperRowMajor, toUpperRowMajor,
   forceOrder, adaptOrder,

   add, sub,

   multiplyVector,
   square,
   multiply,
   multiplyFull,

   solve,
   inverse,
   determinant,

   eigenvalues,
   eigensystem,
   ) where

import qualified Numeric.LAPACK.Matrix.Triangular.Eigen as Eigen
import qualified Numeric.LAPACK.Matrix.Triangular.Linear as Linear
import qualified Numeric.LAPACK.Matrix.Triangular.Basic as Basic
import qualified Numeric.LAPACK.Matrix.Mosaic.Basic as Mosaic
import qualified Numeric.LAPACK.Matrix.Mosaic.Packed as Packed
import qualified Numeric.LAPACK.Matrix.Mosaic.Generic as Mos
import qualified Numeric.LAPACK.Matrix.Basic as FullBasic

import qualified Numeric.LAPACK.Matrix.Array.Mosaic as Triangular
import qualified Numeric.LAPACK.Matrix.Array.Unpacked as ArrUnpacked
import qualified Numeric.LAPACK.Matrix.Array.Basic as OmniMatrix
import qualified Numeric.LAPACK.Matrix.Array.Private as ArrMatrix
import qualified Numeric.LAPACK.Matrix.Type.Private as Matrix
import qualified Numeric.LAPACK.Matrix.Class as MatrixClass
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 as Extent
import qualified Numeric.LAPACK.Vector as Vector
import qualified Numeric.LAPACK.Scalar as Scalar
import Numeric.LAPACK.Matrix.Array.Mosaic (
   Triangular, TriangularP,
   Lower, FlexLower, FlexLowerP,
   Upper, FlexUpper, FlexUpperP,
   )
import Numeric.LAPACK.Matrix.Array.Unpacked (Unpacked)
import Numeric.LAPACK.Matrix.Array.Private (Full, General, Square, packTag, diagTag)
import Numeric.LAPACK.Matrix.Shape.Omni (Arbitrary, Unit)
import Numeric.LAPACK.Matrix.Layout.Private (Order, Filled)
import Numeric.LAPACK.Matrix.Private (ShapeInt)
import Numeric.LAPACK.Vector (Vector)

import qualified Numeric.Netlib.Class as Class

import qualified Data.Array.Comfort.Storable as Array
import qualified Data.Array.Comfort.Shape as Shape
import Data.Array.Comfort.Storable (Array)
import Data.Array.Comfort.Shape ((::+))

import Foreign.Storable (Storable)

import Data.Tuple.HT (mapPair)
import Data.Function.HT (Id)


size :: TriangularP pack lo diag up sh a -> sh
size :: forall pack lo diag up sh a. TriangularP pack lo diag up sh a -> sh
size = Omni pack diag lo up Shape Small Small sh sh -> sh
forall pack property lower upper sh.
Omni pack property lower upper Shape Small Small sh sh -> sh
Omni.squareSize (Omni pack diag lo up Shape Small Small sh sh -> sh)
-> (TriangularP pack lo diag up sh a
    -> Omni pack diag lo up Shape Small Small sh sh)
-> TriangularP pack lo diag up sh a
-> sh
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TriangularP pack lo diag up sh a
-> Omni pack diag lo up Shape Small Small 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
ArrMatrix.shape

transpose ::
   (MatrixShape.PowerStrip lo, MatrixShape.PowerStrip up,
    MatrixShape.TriDiag diag, Shape.C sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a -> TriangularP pack up diag lo sh a
transpose :: forall lo up diag sh a pack.
(PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) =>
TriangularP pack lo diag up sh a
-> TriangularP pack up diag lo sh a
transpose = Matrix (Array pack diag) () () lo up Shape Small Small sh sh a
-> Matrix (Array pack diag) () () up lo Shape Small Small sh sh a
forall typ xl xu meas vert horiz height width a lower upper.
(Transpose typ, TransposeExtra typ xl, TransposeExtra typ xu,
 Measure meas, C vert, C horiz, C height, C width, Floating a) =>
Matrix typ xl xu lower upper meas vert horiz height width a
-> Matrix typ xu xl upper lower meas horiz vert width height a
forall xl xu meas vert horiz height width a lower upper.
(TransposeExtra (Array pack diag) xl,
 TransposeExtra (Array pack diag) xu, Measure meas, C vert, C horiz,
 C height, C width, Floating a) =>
Matrix
  (Array pack diag) xl xu lower upper meas vert horiz height width a
-> Matrix
     (Array pack diag) xu xl upper lower meas horiz vert width height a
Matrix.transpose

adjoint ::
   (MatrixShape.PowerStrip lo, MatrixShape.PowerStrip up,
    MatrixShape.TriDiag diag, Shape.C sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a -> TriangularP pack up diag lo sh a
adjoint :: forall lo up diag sh a pack.
(PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) =>
TriangularP pack lo diag up sh a
-> TriangularP pack up diag lo sh a
adjoint = Matrix (Array pack diag) () () lo up Shape Small Small sh sh a
-> Matrix (Array pack diag) () () up lo Shape Small Small sh sh a
forall typ xl xu meas vert horiz height width a lower upper.
(Transpose typ, Complex typ, TransposeExtra typ xl,
 TransposeExtra typ xu, Measure meas, C vert, C horiz, C height,
 C width, Floating a) =>
Matrix typ xl xu lower upper meas vert horiz height width a
-> Matrix typ xu xl upper lower meas horiz vert width height a
MatrixClass.adjoint


fromList ::
   (MatrixShape.UpLo lo up, Shape.C sh, Storable a) =>
   Order -> sh -> [a] -> Triangular lo Arbitrary up sh a
fromList :: forall lo up sh a.
(UpLo lo up, C sh, Storable a) =>
Order -> sh -> [a] -> Triangular lo Arbitrary up sh a
fromList Order
order sh
sh [a]
xs =
   let m :: TriangularP Packed lo Arbitrary up sh a
m =
         case TriangularP Packed lo Arbitrary up sh a -> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP Packed lo Arbitrary up sh a
m of
            UpLoSingleton lo up
MatrixShape.Upper -> Order -> sh -> [a] -> Upper sh a
forall sh a. (C sh, Storable a) => Order -> sh -> [a] -> Upper sh a
upperFromList Order
order sh
sh [a]
xs
            UpLoSingleton lo up
MatrixShape.Lower -> Order -> sh -> [a] -> Lower sh a
forall sh a. (C sh, Storable a) => Order -> sh -> [a] -> Lower sh a
lowerFromList Order
order sh
sh [a]
xs
   in TriangularP Packed lo Arbitrary up sh a
m

lowerFromList :: (Shape.C sh, Storable a) => Order -> sh -> [a] -> Lower sh a
lowerFromList :: forall sh a. (C sh, Storable a) => Order -> sh -> [a] -> Lower sh a
lowerFromList Order
order sh
sh = Array (LowerTriangularP Packed sh) a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     sh
     sh
     a
PlainArray
  Packed Arbitrary Filled (Bands U0) Shape Small Small sh sh a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     sh
     sh
     a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (Array (LowerTriangularP Packed sh) a
 -> Matrix
      (Array Packed Arbitrary)
      ()
      ()
      Filled
      (Bands U0)
      Shape
      Small
      Small
      sh
      sh
      a)
-> ([a] -> Array (LowerTriangularP Packed sh) a)
-> [a]
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     sh
     sh
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Order -> sh -> [a] -> Array (LowerTriangularP Packed sh) a
forall pack mirror uplo sh a.
(Packing pack, Mirror mirror, UpLo uplo, C sh, Storable a) =>
Order -> sh -> [a] -> Mosaic pack mirror uplo sh a
Mos.fromList Order
order sh
sh

upperFromList :: (Shape.C sh, Storable a) => Order -> sh -> [a] -> Upper sh a
upperFromList :: forall sh a. (C sh, Storable a) => Order -> sh -> [a] -> Upper sh a
upperFromList Order
order sh
sh = Array (UpperTriangularP Packed sh) a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     sh
     sh
     a
PlainArray
  Packed Arbitrary (Bands U0) Filled Shape Small Small sh sh a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     sh
     sh
     a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (Array (UpperTriangularP Packed sh) a
 -> Matrix
      (Array Packed Arbitrary)
      ()
      ()
      (Bands U0)
      Filled
      Shape
      Small
      Small
      sh
      sh
      a)
-> ([a] -> Array (UpperTriangularP Packed sh) a)
-> [a]
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     sh
     sh
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Order -> sh -> [a] -> Array (UpperTriangularP Packed sh) a
forall pack mirror uplo sh a.
(Packing pack, Mirror mirror, UpLo uplo, C sh, Storable a) =>
Order -> sh -> [a] -> Mosaic pack mirror uplo sh a
Mos.fromList Order
order sh
sh


autoFromList ::
   (MatrixShape.UpLo lo up, Storable a) =>
   Order -> [a] -> Triangular lo Arbitrary up ShapeInt a
autoFromList :: forall lo up a.
(UpLo lo up, Storable a) =>
Order -> [a] -> Triangular lo Arbitrary up ShapeInt a
autoFromList Order
order [a]
xs =
   let m :: TriangularP Packed lo Arbitrary up ShapeInt a
m =
         case TriangularP Packed lo Arbitrary up ShapeInt a
-> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP Packed lo Arbitrary up ShapeInt a
m of
            UpLoSingleton lo up
MatrixShape.Upper -> Order -> [a] -> Upper ShapeInt a
forall a. Storable a => Order -> [a] -> Upper ShapeInt a
autoUpperFromList Order
order [a]
xs
            UpLoSingleton lo up
MatrixShape.Lower -> Order -> [a] -> Lower ShapeInt a
forall a. Storable a => Order -> [a] -> Lower ShapeInt a
autoLowerFromList Order
order [a]
xs
   in TriangularP Packed lo Arbitrary up ShapeInt a
m

autoLowerFromList :: (Storable a) => Order -> [a] -> Lower ShapeInt a
autoLowerFromList :: forall a. Storable a => Order -> [a] -> Lower ShapeInt a
autoLowerFromList Order
order = Array (LowerTriangularP Packed ShapeInt) a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     ShapeInt
     ShapeInt
     a
PlainArray
  Packed
  Arbitrary
  Filled
  (Bands U0)
  Shape
  Small
  Small
  ShapeInt
  ShapeInt
  a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     ShapeInt
     ShapeInt
     a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (Array (LowerTriangularP Packed ShapeInt) a
 -> Matrix
      (Array Packed Arbitrary)
      ()
      ()
      Filled
      (Bands U0)
      Shape
      Small
      Small
      ShapeInt
      ShapeInt
      a)
-> ([a] -> Array (LowerTriangularP Packed ShapeInt) a)
-> [a]
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     ShapeInt
     ShapeInt
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Order -> [a] -> Array (LowerTriangularP Packed ShapeInt) a
forall pack mirror uplo a.
(Packing pack, Mirror mirror, UpLo uplo, Storable a) =>
Order -> [a] -> Mosaic pack mirror uplo ShapeInt a
Mos.autoFromList Order
order

autoUpperFromList :: (Storable a) => Order -> [a] -> Upper ShapeInt a
autoUpperFromList :: forall a. Storable a => Order -> [a] -> Upper ShapeInt a
autoUpperFromList Order
order = Array (UpperTriangularP Packed ShapeInt) a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     ShapeInt
     ShapeInt
     a
PlainArray
  Packed
  Arbitrary
  (Bands U0)
  Filled
  Shape
  Small
  Small
  ShapeInt
  ShapeInt
  a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     ShapeInt
     ShapeInt
     a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (Array (UpperTriangularP Packed ShapeInt) a
 -> Matrix
      (Array Packed Arbitrary)
      ()
      ()
      (Bands U0)
      Filled
      Shape
      Small
      Small
      ShapeInt
      ShapeInt
      a)
-> ([a] -> Array (UpperTriangularP Packed ShapeInt) a)
-> [a]
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     ShapeInt
     ShapeInt
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Order -> [a] -> Array (UpperTriangularP Packed ShapeInt) a
forall pack mirror uplo a.
(Packing pack, Mirror mirror, UpLo uplo, Storable a) =>
Order -> [a] -> Mosaic pack mirror uplo ShapeInt a
Mos.autoFromList Order
order


asLower :: Id (FlexLowerP pack diag sh a)
asLower :: forall pack diag sh a. Id (FlexLowerP pack diag sh a)
asLower = FlexLowerP pack diag sh a -> FlexLowerP pack diag sh a
forall a. a -> a
id

asUpper :: Id (FlexUpperP pack diag sh a)
asUpper :: forall pack diag sh a. Id (FlexUpperP pack diag sh a)
asUpper = FlexUpperP pack diag sh a -> FlexUpperP pack diag sh a
forall a. a -> a
id


requireUnitDiagonal :: Id (TriangularP pack lo Unit up sh a)
requireUnitDiagonal :: forall pack lo up sh a. Id (TriangularP pack lo Unit up sh a)
requireUnitDiagonal = TriangularP pack lo Unit up sh a
-> TriangularP pack lo Unit up sh a
forall a. a -> a
id

requireArbitraryDiagonal :: Id (TriangularP pack lo Arbitrary up sh a)
requireArbitraryDiagonal :: forall pack lo up sh a. Id (TriangularP pack lo Arbitrary up sh a)
requireArbitraryDiagonal = TriangularP pack lo Arbitrary up sh a
-> TriangularP pack lo Arbitrary up sh a
forall a. a -> a
id


pack ::
   (Layout.Packing pack, MatrixShape.UpLo lo up, MatrixShape.TriDiag diag,
    Shape.C sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a -> Triangular lo diag up sh a
pack :: forall pack lo up diag sh a.
(Packing pack, UpLo lo up, TriDiag diag, C sh, Floating a) =>
TriangularP pack lo diag up sh a -> Triangular lo diag up sh a
pack TriangularP pack lo diag up sh a
a =
   case TriangularP pack lo diag up sh a -> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP pack lo diag up sh a
a of
      UpLoSingleton lo up
MatrixShape.Lower -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray Packed diag lo up Shape Small Small sh sh a)
-> TriangularP pack lo diag up sh a -> Triangular lo diag up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Mosaic pack NoMirror Lower sh a -> Mosaic NoMirror Lower sh a
PlainArray pack diag lo up Shape Small Small sh sh a
-> PlainArray Packed diag lo up Shape Small Small sh sh a
forall uplo sh a pack mirror.
(UpLo uplo, C sh, Floating a) =>
Mosaic pack mirror uplo sh a -> Mosaic mirror uplo sh a
Mosaic.pack TriangularP pack lo diag up sh a
a
      UpLoSingleton lo up
MatrixShape.Upper -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray Packed diag lo up Shape Small Small sh sh a)
-> TriangularP pack lo diag up sh a -> Triangular lo diag up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Mosaic pack NoMirror Upper sh a -> Mosaic NoMirror Upper sh a
PlainArray pack diag lo up Shape Small Small sh sh a
-> PlainArray Packed diag lo up Shape Small Small sh sh a
forall uplo sh a pack mirror.
(UpLo uplo, C sh, Floating a) =>
Mosaic pack mirror uplo sh a -> Mosaic mirror uplo sh a
Mosaic.pack TriangularP pack lo diag up sh a
a

toSquare ::
   (MatrixShape.PowerStrip lo, MatrixShape.PowerStrip up,
    MatrixShape.TriDiag diag,
    Shape.C sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a -> Square sh a
toSquare :: forall lo up diag sh a pack.
(PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) =>
TriangularP pack lo diag up sh a -> Square sh a
toSquare = ArrayMatrix pack diag lo up Shape Small Small sh sh a
-> Full Shape Small Small sh sh 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
-> Full meas vert horiz height width a
OmniMatrix.toFull

takeLower ::
   (Omni.Property property, Omni.Strip upper) =>
   (Extent.Measure meas, Extent.C horiz,
    Shape.C height, Shape.C width, Class.Floating a) =>
   Unpacked property Filled upper meas Extent.Small horiz height width a ->
   Lower height a
takeLower :: forall property upper meas horiz height width a.
(Property property, Strip upper, Measure meas, C horiz, C height,
 C width, Floating a) =>
Unpacked property Filled upper meas Small horiz height width a
-> Lower height a
takeLower = Array (LowerTriangularP Packed height) a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     height
     height
     a
PlainArray
  Packed
  Arbitrary
  Filled
  (Bands U0)
  Shape
  Small
  Small
  height
  height
  a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     height
     height
     a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (Array (LowerTriangularP Packed height) a
 -> Matrix
      (Array Packed Arbitrary)
      ()
      ()
      Filled
      (Bands U0)
      Shape
      Small
      Small
      height
      height
      a)
-> (Unpacked property Filled upper meas Small horiz height width a
    -> Array (LowerTriangularP Packed height) a)
-> Unpacked property Filled upper meas Small horiz height width a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     height
     height
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Full meas Small horiz height width a
-> Array (LowerTriangularP Packed height) a
forall meas horiz height width a.
(Measure meas, C horiz, C height, C width, Floating a) =>
Full meas Small horiz height width a -> Lower height a
Basic.takeLower (Full meas Small horiz height width a
 -> Array (LowerTriangularP Packed height) a)
-> (Unpacked property Filled upper meas Small horiz height width a
    -> Full meas Small horiz height width a)
-> Unpacked property Filled upper meas Small horiz height width a
-> Array (LowerTriangularP Packed height) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Unpacked property Filled upper meas Small horiz height width a
-> Full meas Small horiz height width 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
ArrMatrix.unpackedToVector

takeUpper ::
   (Omni.Property property, Omni.Strip lower) =>
   (Extent.Measure meas, Extent.C vert,
    Shape.C height, Shape.C width, Class.Floating a) =>
   Unpacked property lower Filled meas vert Extent.Small height width a ->
   Upper width a
takeUpper :: forall property lower meas vert height width a.
(Property property, Strip lower, Measure meas, C vert, C height,
 C width, Floating a) =>
Unpacked property lower Filled meas vert Small height width a
-> Upper width a
takeUpper = Array (UpperTriangularP Packed width) a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     width
     width
     a
PlainArray
  Packed Arbitrary (Bands U0) Filled Shape Small Small width width a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     width
     width
     a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (Array (UpperTriangularP Packed width) a
 -> Matrix
      (Array Packed Arbitrary)
      ()
      ()
      (Bands U0)
      Filled
      Shape
      Small
      Small
      width
      width
      a)
-> (Unpacked property lower Filled meas vert Small height width a
    -> Array (UpperTriangularP Packed width) a)
-> Unpacked property lower Filled meas vert Small height width a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     width
     width
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Full meas vert Small height width a
-> Array (UpperTriangularP Packed width) a
forall meas vert height width a.
(Measure meas, C vert, C height, C width, Floating a) =>
Full meas vert Small height width a -> Upper width a
Basic.takeUpper (Full meas vert Small height width a
 -> Array (UpperTriangularP Packed width) a)
-> (Unpacked property lower Filled meas vert Small height width a
    -> Full meas vert Small height width a)
-> Unpacked property lower Filled meas vert Small height width a
-> Array (UpperTriangularP Packed width) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Unpacked property lower Filled meas vert Small height width a
-> Full meas vert Small height width 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
ArrMatrix.unpackedToVector

fromLowerRowMajor ::
   (Shape.C sh, Class.Floating a) =>
   Array (Shape.Triangular Shape.Lower sh) a -> Lower sh a
fromLowerRowMajor :: forall sh a.
(C sh, Floating a) =>
Array (Triangular Lower sh) a -> Lower sh a
fromLowerRowMajor = Array (LowerTriangularP Packed sh) a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     sh
     sh
     a
PlainArray
  Packed Arbitrary Filled (Bands U0) Shape Small Small sh sh a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     sh
     sh
     a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (Array (LowerTriangularP Packed sh) a
 -> Matrix
      (Array Packed Arbitrary)
      ()
      ()
      Filled
      (Bands U0)
      Shape
      Small
      Small
      sh
      sh
      a)
-> (Array (Triangular Lower sh) a
    -> Array (LowerTriangularP Packed sh) a)
-> Array (Triangular Lower sh) a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     Filled
     (Bands U0)
     Shape
     Small
     Small
     sh
     sh
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Array (Triangular Lower sh) a
-> Array (LowerTriangularP Packed sh) a
forall sh a.
(C sh, Floating a) =>
Array (Triangular Lower sh) a -> Lower sh a
Basic.fromLowerRowMajor

fromUpperRowMajor ::
   (Shape.C sh, Class.Floating a) =>
   Array (Shape.Triangular Shape.Upper sh) a -> Upper sh a
fromUpperRowMajor :: forall sh a.
(C sh, Floating a) =>
Array (Triangular Upper sh) a -> Upper sh a
fromUpperRowMajor = Array (UpperTriangularP Packed sh) a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     sh
     sh
     a
PlainArray
  Packed Arbitrary (Bands U0) Filled Shape Small Small sh sh a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     sh
     sh
     a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (Array (UpperTriangularP Packed sh) a
 -> Matrix
      (Array Packed Arbitrary)
      ()
      ()
      (Bands U0)
      Filled
      Shape
      Small
      Small
      sh
      sh
      a)
-> (Array (Triangular Upper sh) a
    -> Array (UpperTriangularP Packed sh) a)
-> Array (Triangular Upper sh) a
-> Matrix
     (Array Packed Arbitrary)
     ()
     ()
     (Bands U0)
     Filled
     Shape
     Small
     Small
     sh
     sh
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Array (Triangular Upper sh) a
-> Array (UpperTriangularP Packed sh) a
forall sh a.
(C sh, Floating a) =>
Array (Triangular Upper sh) a -> Upper sh a
Basic.fromUpperRowMajor

toLowerRowMajor ::
   (Shape.C sh, Class.Floating a) =>
   Lower sh a -> Array (Shape.Triangular Shape.Lower sh) a
toLowerRowMajor :: forall sh a.
(C sh, Floating a) =>
Lower sh a -> Array (Triangular Lower sh) a
toLowerRowMajor = Lower sh a -> Array (Triangular Lower sh) a
forall sh a.
(C sh, Floating a) =>
Lower sh a -> Array (Triangular Lower sh) a
Basic.toLowerRowMajor (Lower sh a -> Array (Triangular Lower sh) a)
-> (Lower sh a -> Lower sh a)
-> Lower sh a
-> Array (Triangular Lower sh) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Lower sh a -> Lower sh a
Lower sh a
-> PlainArray
     Packed Arbitrary Filled (Bands U0) Shape Small Small sh sh a
forall pack property lower upper meas vert horiz height width a.
ToPlain pack property lower upper meas vert horiz height width =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper meas vert horiz height width a
ArrMatrix.toVector

toUpperRowMajor ::
   (Shape.C sh, Class.Floating a) =>
   Upper sh a -> Array (Shape.Triangular Shape.Upper sh) a
toUpperRowMajor :: forall sh a.
(C sh, Floating a) =>
Upper sh a -> Array (Triangular Upper sh) a
toUpperRowMajor = Upper sh a -> Array (Triangular Upper sh) a
forall sh a.
(C sh, Floating a) =>
Upper sh a -> Array (Triangular Upper sh) a
Basic.toUpperRowMajor (Upper sh a -> Array (Triangular Upper sh) a)
-> (Upper sh a -> Upper sh a)
-> Upper sh a
-> Array (Triangular Upper sh) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Upper sh a -> Upper sh a
Upper sh a
-> PlainArray
     Packed Arbitrary (Bands U0) Filled Shape Small Small sh sh a
forall pack property lower upper meas vert horiz height width a.
ToPlain pack property lower upper meas vert horiz height width =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper meas vert horiz height width a
ArrMatrix.toVector

forceOrder ::
   (MatrixShape.PowerStrip lo, MatrixShape.PowerStrip up,
    MatrixShape.TriDiag diag,
    Shape.C sh, Class.Floating a) =>
   Order -> TriangularP pack lo diag up sh a -> TriangularP pack lo diag up sh a
forceOrder :: forall lo up diag sh a pack.
(PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) =>
Order
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
forceOrder = Order
-> ArrayMatrix pack diag lo up Shape Small Small sh sh a
-> ArrayMatrix pack diag lo up Shape Small Small sh sh 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
ArrMatrix.forceOrder

{- |
@adaptOrder x y@ contains the data of @y@ with the layout of @x@.
-}
adaptOrder ::
   (MatrixShape.PowerStrip lo, MatrixShape.PowerStrip up,
    MatrixShape.TriDiag diag,
    Shape.C sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a ->
   TriangularP pack lo diag up sh a ->
   TriangularP pack lo diag up sh a
adaptOrder :: forall lo up diag sh a pack.
(PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) =>
TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
adaptOrder = ArrayMatrix pack diag lo up Shape Small Small sh sh a
-> ArrayMatrix pack diag lo up Shape Small Small sh sh a
-> ArrayMatrix pack diag lo up Shape Small Small sh sh 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
ArrMatrix.adaptOrder

add, sub ::
   (MatrixShape.PowerStrip lo, MatrixShape.PowerStrip up,
    Eq lo, Eq up, Eq sh, Shape.C sh, Class.Floating a) =>
   TriangularP pack lo Arbitrary up sh a ->
   TriangularP pack lo Arbitrary up sh a ->
   TriangularP pack lo Arbitrary up sh a
add :: forall lo up sh a pack.
(PowerStrip lo, PowerStrip up, Eq lo, Eq up, Eq sh, C sh,
 Floating a) =>
TriangularP pack lo Arbitrary up sh a
-> TriangularP pack lo Arbitrary up sh a
-> TriangularP pack lo Arbitrary up sh a
add = ArrayMatrix pack Arbitrary lo up Shape Small Small sh sh a
-> ArrayMatrix pack Arbitrary lo up Shape Small Small sh sh a
-> ArrayMatrix pack Arbitrary lo up Shape Small Small sh sh a
forall meas vert horiz property height width a pack lower upper.
(Measure meas, C vert, C horiz, Additive property, C height,
 Eq height, C width, Eq width, Floating a) =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
ArrMatrix.add
sub :: forall lo up sh a pack.
(PowerStrip lo, PowerStrip up, Eq lo, Eq up, Eq sh, C sh,
 Floating a) =>
TriangularP pack lo Arbitrary up sh a
-> TriangularP pack lo Arbitrary up sh a
-> TriangularP pack lo Arbitrary up sh a
sub = ArrayMatrix pack Arbitrary lo up Shape Small Small sh sh a
-> ArrayMatrix pack Arbitrary lo up Shape Small Small sh sh a
-> ArrayMatrix pack Arbitrary lo up Shape Small Small sh sh a
forall meas vert horiz property height width a pack lower upper.
(Measure meas, C vert, C horiz, Subtractive property, C height,
 Eq height, C width, Eq width, Floating a) =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
-> ArrayMatrix
     pack property lower upper meas vert horiz height width a
ArrMatrix.sub


{-
identity ::
   (MatrixShape.PowerStrip lo, MatrixShape.PowerStrip up,
    Shape.C sh, Class.Floating a) =>
   Order -> sh -> Triangular lo Unit up sh a
identity order = ArrMatrix.lift0 . Basic.identity order
-}

diagonal ::
   (MatrixShape.UpLo lo up, Shape.C sh, Class.Floating a) =>
   Order -> Vector sh a -> Triangular lo Arbitrary up sh a
diagonal :: forall lo up sh a.
(UpLo lo up, C sh, Floating a) =>
Order -> Vector sh a -> Triangular lo Arbitrary up sh a
diagonal Order
order Vector sh a
v =
   Diagonal_ sh a lo up -> Triangular lo Arbitrary up sh a
forall sh a lo up.
Diagonal_ sh a lo up -> Triangular lo Arbitrary up sh a
getDiagonal (Diagonal_ sh a lo up -> Triangular lo Arbitrary up sh a)
-> Diagonal_ sh a lo up -> Triangular lo Arbitrary up sh a
forall a b. (a -> b) -> a -> b
$
   Diagonal_ sh a (Bands U0) Filled
-> Diagonal_ sh a Filled (Bands U0) -> Diagonal_ sh a lo up
forall lo up (f :: * -> * -> *).
UpLoC lo up =>
f (Bands U0) Filled -> f Filled (Bands U0) -> f lo up
forall (f :: * -> * -> *).
f (Bands U0) Filled -> f Filled (Bands U0) -> f lo up
MatrixShape.switchUpLo
      (Triangular (Bands U0) Arbitrary Filled sh a
-> Diagonal_ sh a (Bands U0) Filled
forall sh a lo up.
Triangular lo Arbitrary up sh a -> Diagonal_ sh a lo up
Diagonal (Triangular (Bands U0) Arbitrary Filled sh a
 -> Diagonal_ sh a (Bands U0) Filled)
-> Triangular (Bands U0) Arbitrary Filled sh a
-> Diagonal_ sh a (Bands U0) Filled
forall a b. (a -> b) -> a -> b
$ PlainArray
  Packed Arbitrary (Bands U0) Filled Shape Small Small sh sh a
-> Triangular (Bands U0) Arbitrary Filled sh a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (PlainArray
   Packed Arbitrary (Bands U0) Filled Shape Small Small sh sh a
 -> Triangular (Bands U0) Arbitrary Filled sh a)
-> PlainArray
     Packed Arbitrary (Bands U0) Filled Shape Small Small sh sh a
-> Triangular (Bands U0) Arbitrary Filled sh a
forall a b. (a -> b) -> a -> b
$ Order -> Vector sh a -> Mosaic NoMirror Upper sh a
forall mirror uplo sh a.
(Mirror mirror, UpLo uplo, C sh, Floating a) =>
Order -> Vector sh a -> Mosaic mirror uplo sh a
Packed.diagonal Order
order Vector sh a
v)
      (Triangular Filled Arbitrary (Bands U0) sh a
-> Diagonal_ sh a Filled (Bands U0)
forall sh a lo up.
Triangular lo Arbitrary up sh a -> Diagonal_ sh a lo up
Diagonal (Triangular Filled Arbitrary (Bands U0) sh a
 -> Diagonal_ sh a Filled (Bands U0))
-> Triangular Filled Arbitrary (Bands U0) sh a
-> Diagonal_ sh a Filled (Bands U0)
forall a b. (a -> b) -> a -> b
$ PlainArray
  Packed Arbitrary Filled (Bands U0) Shape Small Small sh sh a
-> Triangular Filled Arbitrary (Bands U0) sh a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0 (PlainArray
   Packed Arbitrary Filled (Bands U0) Shape Small Small sh sh a
 -> Triangular Filled Arbitrary (Bands U0) sh a)
-> PlainArray
     Packed Arbitrary Filled (Bands U0) Shape Small Small sh sh a
-> Triangular Filled Arbitrary (Bands U0) sh a
forall a b. (a -> b) -> a -> b
$ Order -> Vector sh a -> Mosaic NoMirror Lower sh a
forall mirror uplo sh a.
(Mirror mirror, UpLo uplo, C sh, Floating a) =>
Order -> Vector sh a -> Mosaic mirror uplo sh a
Packed.diagonal Order
order Vector sh a
v)

newtype Diagonal_ sh a lo up =
   Diagonal {
      forall sh a lo up.
Diagonal_ sh a lo up -> Triangular lo Arbitrary up sh a
getDiagonal :: Triangular lo Arbitrary up sh a
   }

takeDiagonal ::
   (MatrixShape.PowerStrip lo, MatrixShape.PowerStrip up,
    MatrixShape.TriDiag diag,
    Shape.C sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a -> Vector sh a
takeDiagonal :: forall lo up diag sh a pack.
(PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) =>
TriangularP pack lo diag up sh a -> Vector sh a
takeDiagonal = Quadratic pack diag lo up sh a -> Vector sh a
forall sh a pack property lower upper.
(C sh, Floating a) =>
Quadratic pack property lower upper sh a -> Vector sh a
OmniMatrix.takeDiagonal



relaxUnitDiagonal ::
   (MatrixShape.TriDiag diag) =>
   TriangularP pack lo Unit up sh a -> TriangularP pack lo diag up sh a
relaxUnitDiagonal :: forall diag pack lo up sh a.
TriDiag diag =>
TriangularP pack lo Unit up sh a
-> TriangularP pack lo diag up sh a
relaxUnitDiagonal a :: TriangularP pack lo Unit up sh a
a@(ArrMatrix.Array OmniArray pack Unit lo up Shape Small Small sh sh a
_arr) =
   case TriangularP pack lo Unit up sh a
-> Omni pack Unit lo up Shape Small Small 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
ArrMatrix.shape TriangularP pack lo Unit up sh a
a of
      Omni.Full Full Shape Small Small sh sh
_ -> (FullArray Shape Small Small sh sh a
 -> FullArray Shape Small Small sh sh a)
-> UnpackedMatrix Unit lo up Shape Small Small sh sh a
-> UnpackedMatrix diag lo up Shape Small Small sh sh 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
ArrMatrix.liftUnpacked1 FullArray Shape Small Small sh sh a
-> FullArray Shape Small Small sh sh a
forall a. a -> a
id TriangularP pack lo Unit up sh a
UnpackedMatrix Unit lo up Shape Small Small sh sh a
a
      Omni.LowerTriangular LowerTriangular sh
_ -> (PlainArray pack Unit lo up Shape Small Small sh sh a
 -> PlainArray pack diag lo up Shape Small Small sh sh a)
-> TriangularP pack lo Unit up sh a
-> TriangularP pack lo diag up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Array (LowerTriangular sh) a -> Array (LowerTriangular sh) a
PlainArray pack Unit lo up Shape Small Small sh sh a
-> PlainArray pack diag lo up Shape Small Small sh sh a
forall a. a -> a
id TriangularP pack lo Unit up sh a
a
      Omni.UpperTriangular UpperTriangular sh
_ -> (PlainArray pack Unit lo up Shape Small Small sh sh a
 -> PlainArray pack diag lo up Shape Small Small sh sh a)
-> TriangularP pack lo Unit up sh a
-> TriangularP pack lo diag up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Array (UpperTriangular sh) a -> Array (UpperTriangular sh) a
PlainArray pack Unit lo up Shape Small Small sh sh a
-> PlainArray pack diag lo up Shape Small Small sh sh a
forall a. a -> a
id TriangularP pack lo Unit up sh a
a
      Omni.UnitBandedTriangular BandedSquare sub super sh
_ ->
         let m :: TriangularP pack lo diag up sh a
m =
               case TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
m of
                  DiagSingleton diag
Omni.Unit -> TriangularP pack lo diag up sh a
TriangularP pack lo Unit up sh a
a
                  DiagSingleton diag
Omni.Arbitrary -> (PlainArray pack Unit lo up Shape Small Small sh sh a
 -> PlainArray pack diag lo up Shape Small Small sh sh a)
-> TriangularP pack lo Unit up sh a
-> TriangularP pack lo diag up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Array (BandedSquare sub super sh) a
-> Array (BandedSquare sub super sh) a
PlainArray pack Unit lo up Shape Small Small sh sh a
-> PlainArray pack diag lo up Shape Small Small sh sh a
forall a. a -> a
id TriangularP pack lo Unit up sh a
a
         in TriangularP pack lo diag up sh a
m

strictArbitraryDiagonal ::
   (MatrixShape.TriDiag diag) =>
   TriangularP pack lo diag up sh a -> TriangularP pack lo Arbitrary up sh a
strictArbitraryDiagonal :: forall diag pack lo up sh a.
TriDiag diag =>
TriangularP pack lo diag up sh a
-> TriangularP pack lo Arbitrary up sh a
strictArbitraryDiagonal TriangularP pack lo diag up sh a
a =
   case TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a of
      DiagSingleton diag
Omni.Arbitrary -> TriangularP pack lo diag up sh a
TriangularP pack lo Arbitrary up sh a
a
      DiagSingleton diag
Omni.Unit ->
         case TriangularP pack lo diag up sh a
-> Omni pack diag lo up Shape Small Small 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
ArrMatrix.shape TriangularP pack lo diag up sh a
a of
            Omni.Full Full Shape Small Small sh sh
_ -> (FullArray Shape Small Small sh sh a
 -> FullArray Shape Small Small sh sh a)
-> UnpackedMatrix diag lo up Shape Small Small sh sh a
-> UnpackedMatrix Arbitrary lo up Shape Small Small sh sh 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
ArrMatrix.liftUnpacked1 FullArray Shape Small Small sh sh a
-> FullArray Shape Small Small sh sh a
forall a. a -> a
id TriangularP pack lo diag up sh a
UnpackedMatrix diag lo up Shape Small Small sh sh a
a
            Omni.LowerTriangular LowerTriangular sh
_ -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray pack Arbitrary lo up Shape Small Small sh sh a)
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo Arbitrary up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Array (LowerTriangular sh) a -> Array (LowerTriangular sh) a
PlainArray pack diag lo up Shape Small Small sh sh a
-> PlainArray pack Arbitrary lo up Shape Small Small sh sh a
forall a. a -> a
id TriangularP pack lo diag up sh a
a
            Omni.UpperTriangular UpperTriangular sh
_ -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray pack Arbitrary lo up Shape Small Small sh sh a)
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo Arbitrary up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Array (UpperTriangular sh) a -> Array (UpperTriangular sh) a
PlainArray pack diag lo up Shape Small Small sh sh a
-> PlainArray pack Arbitrary lo up Shape Small Small sh sh a
forall a. a -> a
id TriangularP pack lo diag up sh a
a
            Omni.UnitBandedTriangular BandedSquare sub super sh
_ -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray pack Arbitrary lo up Shape Small Small sh sh a)
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo Arbitrary up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Array (BandedSquare sub super sh) a
-> Array (BandedSquare sub super sh) a
PlainArray pack diag lo up Shape Small Small sh sh a
-> PlainArray pack Arbitrary lo up Shape Small Small sh sh a
forall a. a -> a
id TriangularP pack lo diag up sh a
a


infixr 2 %%%#
infixl 2 #%%%

stackLower ::
   (Layout.Packing pack, MatrixShape.TriDiag diag,
    Shape.C sh0, Eq sh0, Shape.C sh1, Eq sh1, Class.Floating a) =>
   FlexLowerP pack diag sh0 a ->
   General sh1 sh0 a ->
   FlexLowerP pack diag sh1 a ->
   FlexLowerP pack diag (sh0::+sh1) a
stackLower :: forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1,
 Floating a) =>
FlexLowerP pack diag sh0 a
-> General sh1 sh0 a
-> FlexLowerP pack diag sh1 a
-> FlexLowerP pack diag (sh0 ::+ sh1) a
stackLower FlexLowerP pack diag sh0 a
a0 =
   case FlexLowerP pack diag sh0 a -> PackingSingleton pack
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 FlexLowerP pack diag sh0 a
a0 of
      PackingSingleton pack
Layout.Packed -> (PlainArray pack diag Filled (Bands U0) Shape Small Small sh0 sh0 a
 -> PlainArray
      Unpacked Arbitrary Filled Filled Size Big Big sh1 sh0 a
 -> PlainArray
      pack diag Filled (Bands U0) Shape Small Small sh1 sh1 a
 -> PlainArray
      pack
      diag
      Filled
      (Bands U0)
      Shape
      Small
      Small
      (sh0 ::+ sh1)
      (sh0 ::+ sh1)
      a)
-> FlexLowerP pack diag sh0 a
-> General sh1 sh0 a
-> FlexLowerP pack diag sh1 a
-> FlexLowerP pack diag (sh0 ::+ sh1) 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 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
ArrMatrix.lift3 MosaicLower NoMirror sh0 a
-> General sh1 sh0 a
-> MosaicLower NoMirror sh1 a
-> MosaicLower NoMirror (sh0 ::+ sh1) a
PlainArray pack diag Filled (Bands U0) Shape Small Small sh0 sh0 a
-> PlainArray
     Unpacked Arbitrary Filled Filled Size Big Big sh1 sh0 a
-> PlainArray
     pack diag Filled (Bands U0) Shape Small Small sh1 sh1 a
-> PlainArray
     pack
     diag
     Filled
     (Bands U0)
     Shape
     Small
     Small
     (sh0 ::+ sh1)
     (sh0 ::+ sh1)
     a
forall height width a mirror.
(C height, Eq height, C width, Eq width, Floating a) =>
MosaicLower mirror width a
-> General height width a
-> MosaicLower mirror height a
-> MosaicLower mirror (width ::+ height) a
Packed.stackLower FlexLowerP pack diag sh0 a
a0
      PackingSingleton pack
Layout.Unpacked -> ((FlexLowerP pack diag sh0 a
 -> General sh1 sh0 a
 -> FlexLowerP pack diag sh1 a
 -> FlexLowerP pack diag (sh0 ::+ sh1) a)
-> FlexLowerP pack diag sh0 a
-> General sh1 sh0 a
-> FlexLowerP pack diag sh1 a
-> FlexLowerP pack diag (sh0 ::+ sh1) a
forall a b. (a -> b) -> a -> b
$ FlexLowerP pack diag sh0 a
a0) ((FlexLowerP pack diag sh0 a
  -> General sh1 sh0 a
  -> FlexLowerP pack diag sh1 a
  -> FlexLowerP pack diag (sh0 ::+ sh1) a)
 -> General sh1 sh0 a
 -> FlexLowerP pack diag sh1 a
 -> FlexLowerP pack diag (sh0 ::+ sh1) a)
-> (FlexLowerP pack diag sh0 a
    -> General sh1 sh0 a
    -> FlexLowerP pack diag sh1 a
    -> FlexLowerP pack diag (sh0 ::+ sh1) a)
-> General sh1 sh0 a
-> FlexLowerP pack diag sh1 a
-> FlexLowerP pack diag (sh0 ::+ sh1) a
forall a b. (a -> b) -> a -> b
$
         (FullArray Shape Small Small sh0 sh0 a
 -> General sh1 sh0 a
 -> FullArray Shape Small Small sh1 sh1 a
 -> FullArray Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a)
-> UnpackedMatrix
     diag Filled (Bands U0) Shape Small Small sh0 sh0 a
-> General sh1 sh0 a
-> UnpackedMatrix
     diag Filled (Bands U0) Shape Small Small sh1 sh1 a
-> UnpackedMatrix
     diag
     Filled
     (Bands U0)
     Shape
     Small
     Small
     (sh0 ::+ sh1)
     (sh0 ::+ sh1)
     a
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
ArrMatrix.liftUnpacked3 ((FullArray Shape Small Small sh0 sh0 a
  -> General sh1 sh0 a
  -> FullArray Shape Small Small sh1 sh1 a
  -> FullArray Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a)
 -> UnpackedMatrix
      diag Filled (Bands U0) Shape Small Small sh0 sh0 a
 -> General sh1 sh0 a
 -> UnpackedMatrix
      diag Filled (Bands U0) Shape Small Small sh1 sh1 a
 -> UnpackedMatrix
      diag
      Filled
      (Bands U0)
      Shape
      Small
      Small
      (sh0 ::+ sh1)
      (sh0 ::+ sh1)
      a)
-> (FullArray Shape Small Small sh0 sh0 a
    -> General sh1 sh0 a
    -> FullArray Shape Small Small sh1 sh1 a
    -> FullArray Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a)
-> UnpackedMatrix
     diag Filled (Bands U0) Shape Small Small sh0 sh0 a
-> General sh1 sh0 a
-> UnpackedMatrix
     diag Filled (Bands U0) Shape Small Small sh1 sh1 a
-> UnpackedMatrix
     diag
     Filled
     (Bands U0)
     Shape
     Small
     Small
     (sh0 ::+ sh1)
     (sh0 ::+ sh1)
     a
forall a b. (a -> b) -> a -> b
$ \FullArray Shape Small Small sh0 sh0 a
a General sh1 sh0 a
b FullArray Shape Small Small sh1 sh1 a
c ->
            FullArray Shape Small Small sh0 sh0 a
-> General sh0 sh1 a
-> General sh1 sh0 a
-> FullArray Shape Small Small sh1 sh1 a
-> FullArray Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a
forall shA shB a.
(C shA, Eq shA, C shB, Eq shB, Floating a) =>
Square shA a
-> General shA shB a
-> General shB shA a
-> Square shB a
-> Square (shA ::+ shB) a
FullBasic.stackMosaic
               FullArray Shape Small Small sh0 sh0 a
a (General sh0 sh1 -> General sh0 sh1 a
forall sh a. (C sh, Floating a) => sh -> Vector sh a
Vector.zero (General sh0 sh1 -> General sh0 sh1 a)
-> General sh0 sh1 -> General sh0 sh1 a
forall a b. (a -> b) -> a -> b
$ Full Size Big Big sh1 sh0 -> General sh0 sh1
forall meas vert horiz height width.
(Measure meas, C vert, C horiz) =>
Full meas vert horiz height width
-> Full meas horiz vert width height
Layout.inverse (Full Size Big Big sh1 sh0 -> General sh0 sh1)
-> Full Size Big Big sh1 sh0 -> General sh0 sh1
forall a b. (a -> b) -> a -> b
$ General sh1 sh0 a -> Full Size Big Big sh1 sh0
forall sh a. Array sh a -> sh
Array.shape General sh1 sh0 a
b)
               General sh1 sh0 a
b FullArray Shape Small Small sh1 sh1 a
c

(#%%%) ::
   (Layout.Packing pack, MatrixShape.TriDiag diag,
    Shape.C sh0, Eq sh0, Shape.C sh1, Eq sh1, Class.Floating a) =>
   FlexLowerP pack diag sh0 a ->
   (General sh1 sh0 a, FlexLowerP pack diag sh1 a) ->
   FlexLowerP pack diag (sh0::+sh1) a
#%%% :: forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1,
 Floating a) =>
FlexLowerP pack diag sh0 a
-> (General sh1 sh0 a, FlexLowerP pack diag sh1 a)
-> FlexLowerP pack diag (sh0 ::+ sh1) a
(#%%%) = (General sh1 sh0 a
 -> FlexLowerP pack diag sh1 a
 -> FlexLowerP pack diag (sh0 ::+ sh1) a)
-> (General sh1 sh0 a, FlexLowerP pack diag sh1 a)
-> FlexLowerP pack diag (sh0 ::+ sh1) a
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry ((General sh1 sh0 a
  -> FlexLowerP pack diag sh1 a
  -> FlexLowerP pack diag (sh0 ::+ sh1) a)
 -> (General sh1 sh0 a, FlexLowerP pack diag sh1 a)
 -> FlexLowerP pack diag (sh0 ::+ sh1) a)
-> (FlexLowerP pack diag sh0 a
    -> General sh1 sh0 a
    -> FlexLowerP pack diag sh1 a
    -> FlexLowerP pack diag (sh0 ::+ sh1) a)
-> FlexLowerP pack diag sh0 a
-> (General sh1 sh0 a, FlexLowerP pack diag sh1 a)
-> FlexLowerP pack diag (sh0 ::+ sh1) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlexLowerP pack diag sh0 a
-> General sh1 sh0 a
-> FlexLowerP pack diag sh1 a
-> FlexLowerP pack diag (sh0 ::+ sh1) a
forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1,
 Floating a) =>
FlexLowerP pack diag sh0 a
-> General sh1 sh0 a
-> FlexLowerP pack diag sh1 a
-> FlexLowerP pack diag (sh0 ::+ sh1) a
stackLower

stackUpper ::
   (Layout.Packing pack, MatrixShape.TriDiag diag,
    Shape.C sh0, Eq sh0, Shape.C sh1, Eq sh1, Class.Floating a) =>
   FlexUpperP pack diag sh0 a ->
   General sh0 sh1 a ->
   FlexUpperP pack diag sh1 a ->
   FlexUpperP pack diag (sh0::+sh1) a
stackUpper :: forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1,
 Floating a) =>
FlexUpperP pack diag sh0 a
-> General sh0 sh1 a
-> FlexUpperP pack diag sh1 a
-> FlexUpperP pack diag (sh0 ::+ sh1) a
stackUpper FlexUpperP pack diag sh0 a
a0 =
   case FlexUpperP pack diag sh0 a -> PackingSingleton pack
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 FlexUpperP pack diag sh0 a
a0 of
      PackingSingleton pack
Layout.Packed -> (PlainArray pack diag (Bands U0) Filled Shape Small Small sh0 sh0 a
 -> PlainArray
      Unpacked Arbitrary Filled Filled Size Big Big sh0 sh1 a
 -> PlainArray
      pack diag (Bands U0) Filled Shape Small Small sh1 sh1 a
 -> PlainArray
      pack
      diag
      (Bands U0)
      Filled
      Shape
      Small
      Small
      (sh0 ::+ sh1)
      (sh0 ::+ sh1)
      a)
-> FlexUpperP pack diag sh0 a
-> General sh0 sh1 a
-> FlexUpperP pack diag sh1 a
-> FlexUpperP pack diag (sh0 ::+ sh1) 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 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
ArrMatrix.lift3 MosaicUpper NoMirror sh0 a
-> General sh0 sh1 a
-> MosaicUpper NoMirror sh1 a
-> MosaicUpper NoMirror (sh0 ::+ sh1) a
PlainArray pack diag (Bands U0) Filled Shape Small Small sh0 sh0 a
-> PlainArray
     Unpacked Arbitrary Filled Filled Size Big Big sh0 sh1 a
-> PlainArray
     pack diag (Bands U0) Filled Shape Small Small sh1 sh1 a
-> PlainArray
     pack
     diag
     (Bands U0)
     Filled
     Shape
     Small
     Small
     (sh0 ::+ sh1)
     (sh0 ::+ sh1)
     a
forall height width a mirror.
(C height, Eq height, C width, Eq width, Floating a) =>
MosaicUpper mirror height a
-> General height width a
-> MosaicUpper mirror width a
-> MosaicUpper mirror (height ::+ width) a
Packed.stackUpper FlexUpperP pack diag sh0 a
a0
      PackingSingleton pack
Layout.Unpacked -> ((FlexUpperP pack diag sh0 a
 -> General sh0 sh1 a
 -> FlexUpperP pack diag sh1 a
 -> FlexUpperP pack diag (sh0 ::+ sh1) a)
-> FlexUpperP pack diag sh0 a
-> General sh0 sh1 a
-> FlexUpperP pack diag sh1 a
-> FlexUpperP pack diag (sh0 ::+ sh1) a
forall a b. (a -> b) -> a -> b
$ FlexUpperP pack diag sh0 a
a0) ((FlexUpperP pack diag sh0 a
  -> General sh0 sh1 a
  -> FlexUpperP pack diag sh1 a
  -> FlexUpperP pack diag (sh0 ::+ sh1) a)
 -> General sh0 sh1 a
 -> FlexUpperP pack diag sh1 a
 -> FlexUpperP pack diag (sh0 ::+ sh1) a)
-> (FlexUpperP pack diag sh0 a
    -> General sh0 sh1 a
    -> FlexUpperP pack diag sh1 a
    -> FlexUpperP pack diag (sh0 ::+ sh1) a)
-> General sh0 sh1 a
-> FlexUpperP pack diag sh1 a
-> FlexUpperP pack diag (sh0 ::+ sh1) a
forall a b. (a -> b) -> a -> b
$
         (FullArray Shape Small Small sh0 sh0 a
 -> General sh0 sh1 a
 -> FullArray Shape Small Small sh1 sh1 a
 -> FullArray Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a)
-> UnpackedMatrix
     diag (Bands U0) Filled Shape Small Small sh0 sh0 a
-> General sh0 sh1 a
-> UnpackedMatrix
     diag (Bands U0) Filled Shape Small Small sh1 sh1 a
-> UnpackedMatrix
     diag
     (Bands U0)
     Filled
     Shape
     Small
     Small
     (sh0 ::+ sh1)
     (sh0 ::+ sh1)
     a
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
ArrMatrix.liftUnpacked3 ((FullArray Shape Small Small sh0 sh0 a
  -> General sh0 sh1 a
  -> FullArray Shape Small Small sh1 sh1 a
  -> FullArray Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a)
 -> UnpackedMatrix
      diag (Bands U0) Filled Shape Small Small sh0 sh0 a
 -> General sh0 sh1 a
 -> UnpackedMatrix
      diag (Bands U0) Filled Shape Small Small sh1 sh1 a
 -> UnpackedMatrix
      diag
      (Bands U0)
      Filled
      Shape
      Small
      Small
      (sh0 ::+ sh1)
      (sh0 ::+ sh1)
      a)
-> (FullArray Shape Small Small sh0 sh0 a
    -> General sh0 sh1 a
    -> FullArray Shape Small Small sh1 sh1 a
    -> FullArray Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a)
-> UnpackedMatrix
     diag (Bands U0) Filled Shape Small Small sh0 sh0 a
-> General sh0 sh1 a
-> UnpackedMatrix
     diag (Bands U0) Filled Shape Small Small sh1 sh1 a
-> UnpackedMatrix
     diag
     (Bands U0)
     Filled
     Shape
     Small
     Small
     (sh0 ::+ sh1)
     (sh0 ::+ sh1)
     a
forall a b. (a -> b) -> a -> b
$ \FullArray Shape Small Small sh0 sh0 a
a General sh0 sh1 a
b FullArray Shape Small Small sh1 sh1 a
c ->
            FullArray Shape Small Small sh0 sh0 a
-> General sh0 sh1 a
-> General sh1 sh0 a
-> FullArray Shape Small Small sh1 sh1 a
-> FullArray Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a
forall shA shB a.
(C shA, Eq shA, C shB, Eq shB, Floating a) =>
Square shA a
-> General shA shB a
-> General shB shA a
-> Square shB a
-> Square (shA ::+ shB) a
FullBasic.stackMosaic FullArray Shape Small Small sh0 sh0 a
a General sh0 sh1 a
b
               (General sh1 sh0 -> General sh1 sh0 a
forall sh a. (C sh, Floating a) => sh -> Vector sh a
Vector.zero (General sh1 sh0 -> General sh1 sh0 a)
-> General sh1 sh0 -> General sh1 sh0 a
forall a b. (a -> b) -> a -> b
$ Full Size Big Big sh0 sh1 -> General sh1 sh0
forall meas vert horiz height width.
(Measure meas, C vert, C horiz) =>
Full meas vert horiz height width
-> Full meas horiz vert width height
Layout.inverse (Full Size Big Big sh0 sh1 -> General sh1 sh0)
-> Full Size Big Big sh0 sh1 -> General sh1 sh0
forall a b. (a -> b) -> a -> b
$ General sh0 sh1 a -> Full Size Big Big sh0 sh1
forall sh a. Array sh a -> sh
Array.shape General sh0 sh1 a
b) FullArray Shape Small Small sh1 sh1 a
c

(%%%#) ::
   (Layout.Packing pack, MatrixShape.TriDiag diag,
    Shape.C sh0, Eq sh0, Shape.C sh1, Eq sh1, Class.Floating a) =>
   (FlexUpperP pack diag sh0 a, General sh0 sh1 a) ->
   FlexUpperP pack diag sh1 a ->
   FlexUpperP pack diag (sh0::+sh1) a
%%%# :: forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1,
 Floating a) =>
(FlexUpperP pack diag sh0 a, General sh0 sh1 a)
-> FlexUpperP pack diag sh1 a
-> FlexUpperP pack diag (sh0 ::+ sh1) a
(%%%#) = (FlexUpperP pack diag sh0 a
 -> General sh0 sh1 a
 -> FlexUpperP pack diag sh1 a
 -> FlexUpperP pack diag (sh0 ::+ sh1) a)
-> (FlexUpperP pack diag sh0 a, General sh0 sh1 a)
-> FlexUpperP pack diag sh1 a
-> FlexUpperP pack diag (sh0 ::+ sh1) a
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry FlexUpperP pack diag sh0 a
-> General sh0 sh1 a
-> FlexUpperP pack diag sh1 a
-> FlexUpperP pack diag (sh0 ::+ sh1) a
forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1,
 Floating a) =>
FlexUpperP pack diag sh0 a
-> General sh0 sh1 a
-> FlexUpperP pack diag sh1 a
-> FlexUpperP pack diag (sh0 ::+ sh1) a
stackUpper


splitLower ::
   (Layout.Packing pack, MatrixShape.TriDiag diag,
    Shape.C sh0, Eq sh0, Shape.C sh1, Eq sh1, Class.Floating a) =>
   FlexLowerP pack diag (sh0::+sh1) a ->
   (FlexLowerP pack diag sh0 a, General sh1 sh0 a, FlexLowerP pack diag sh1 a)
splitLower :: forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1,
 Floating a) =>
FlexLowerP pack diag (sh0 ::+ sh1) a
-> (FlexLowerP pack diag sh0 a, General sh1 sh0 a,
    FlexLowerP pack diag sh1 a)
splitLower FlexLowerP pack diag (sh0 ::+ sh1) a
a = (FlexLowerP pack diag (sh0 ::+ sh1) a
-> TriangularP pack Filled diag (Bands U0) sh0 a
forall pack lo up diag sh0 sh1 a.
(Packing pack, UpLo lo up, TriDiag diag, C sh0, C sh1,
 Floating a) =>
TriangularP pack lo diag up (sh0 ::+ sh1) a
-> TriangularP pack lo diag up sh0 a
takeTopLeft FlexLowerP pack diag (sh0 ::+ sh1) a
a, FlexLowerP pack diag (sh0 ::+ sh1) a -> General sh1 sh0 a
forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, C sh1, Floating a) =>
FlexLowerP pack diag (sh0 ::+ sh1) a -> General sh1 sh0 a
takeBottomLeft FlexLowerP pack diag (sh0 ::+ sh1) a
a, FlexLowerP pack diag (sh0 ::+ sh1) a
-> TriangularP pack Filled diag (Bands U0) sh1 a
forall pack lo up diag sh0 sh1 a.
(Packing pack, UpLo lo up, TriDiag diag, C sh0, C sh1,
 Floating a) =>
TriangularP pack lo diag up (sh0 ::+ sh1) a
-> TriangularP pack lo diag up sh1 a
takeBottomRight FlexLowerP pack diag (sh0 ::+ sh1) a
a)

splitUpper ::
   (Layout.Packing pack, MatrixShape.TriDiag diag,
    Shape.C sh0, Eq sh0, Shape.C sh1, Eq sh1, Class.Floating a) =>
   FlexUpperP pack diag (sh0::+sh1) a ->
   (FlexUpperP pack diag sh0 a, General sh0 sh1 a, FlexUpperP pack diag sh1 a)
splitUpper :: forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1,
 Floating a) =>
FlexUpperP pack diag (sh0 ::+ sh1) a
-> (FlexUpperP pack diag sh0 a, General sh0 sh1 a,
    FlexUpperP pack diag sh1 a)
splitUpper FlexUpperP pack diag (sh0 ::+ sh1) a
a = (FlexUpperP pack diag (sh0 ::+ sh1) a
-> TriangularP pack (Bands U0) diag Filled sh0 a
forall pack lo up diag sh0 sh1 a.
(Packing pack, UpLo lo up, TriDiag diag, C sh0, C sh1,
 Floating a) =>
TriangularP pack lo diag up (sh0 ::+ sh1) a
-> TriangularP pack lo diag up sh0 a
takeTopLeft FlexUpperP pack diag (sh0 ::+ sh1) a
a, FlexUpperP pack diag (sh0 ::+ sh1) a -> General sh0 sh1 a
forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, C sh1, Floating a) =>
FlexUpperP pack diag (sh0 ::+ sh1) a -> General sh0 sh1 a
takeTopRight FlexUpperP pack diag (sh0 ::+ sh1) a
a, FlexUpperP pack diag (sh0 ::+ sh1) a
-> TriangularP pack (Bands U0) diag Filled sh1 a
forall pack lo up diag sh0 sh1 a.
(Packing pack, UpLo lo up, TriDiag diag, C sh0, C sh1,
 Floating a) =>
TriangularP pack lo diag up (sh0 ::+ sh1) a
-> TriangularP pack lo diag up sh1 a
takeBottomRight FlexUpperP pack diag (sh0 ::+ sh1) a
a)


takeTopLeft ::
   (Layout.Packing pack, MatrixShape.UpLo lo up, MatrixShape.TriDiag diag,
    Shape.C sh0, Shape.C sh1, Class.Floating a) =>
   TriangularP pack lo diag up (sh0::+sh1) a ->
   TriangularP pack lo diag up sh0 a
takeTopLeft :: forall pack lo up diag sh0 sh1 a.
(Packing pack, UpLo lo up, TriDiag diag, C sh0, C sh1,
 Floating a) =>
TriangularP pack lo diag up (sh0 ::+ sh1) a
-> TriangularP pack lo diag up sh0 a
takeTopLeft TriangularP pack lo diag up (sh0 ::+ sh1) a
a =
   case TriangularP pack lo diag up (sh0 ::+ sh1) a
-> PackingSingleton pack
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 TriangularP pack lo diag up (sh0 ::+ sh1) a
a of
      PackingSingleton pack
Layout.Unpacked -> Quadratic diag lo up (sh0 ::+ sh1) a -> Quadratic diag lo up sh0 a
forall property lower upper sh0 sh1 a.
(Property property, Strip lower, Strip upper, C sh0, C sh1,
 Floating a) =>
Quadratic property lower upper (sh0 ::+ sh1) a
-> Quadratic property lower upper sh0 a
ArrUnpacked.takeTopLeft TriangularP pack lo diag up (sh0 ::+ sh1) a
Quadratic diag lo up (sh0 ::+ sh1) a
a
      PackingSingleton pack
Layout.Packed ->
         case TriangularP pack lo diag up (sh0 ::+ sh1) a -> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP pack lo diag up (sh0 ::+ sh1) a
a of
            UpLoSingleton lo up
MatrixShape.Lower -> (PlainArray
   pack diag lo up Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a
 -> PlainArray pack diag lo up Shape Small Small sh0 sh0 a)
-> TriangularP pack lo diag up (sh0 ::+ sh1) a
-> TriangularP pack lo diag up sh0 a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Mosaic NoMirror Lower (sh0 ::+ sh1) a
-> Mosaic NoMirror Lower sh0 a
PlainArray
  pack diag lo up Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a
-> PlainArray pack diag lo up Shape Small Small sh0 sh0 a
forall uplo height width a mirror.
(UpLo uplo, C height, C width, Floating a) =>
Mosaic mirror uplo (height ::+ width) a
-> Mosaic mirror uplo height a
Packed.takeTopLeft TriangularP pack lo diag up (sh0 ::+ sh1) a
a
            UpLoSingleton lo up
MatrixShape.Upper -> (PlainArray
   pack diag lo up Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a
 -> PlainArray pack diag lo up Shape Small Small sh0 sh0 a)
-> TriangularP pack lo diag up (sh0 ::+ sh1) a
-> TriangularP pack lo diag up sh0 a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Mosaic NoMirror Upper (sh0 ::+ sh1) a
-> Mosaic NoMirror Upper sh0 a
PlainArray
  pack diag lo up Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a
-> PlainArray pack diag lo up Shape Small Small sh0 sh0 a
forall uplo height width a mirror.
(UpLo uplo, C height, C width, Floating a) =>
Mosaic mirror uplo (height ::+ width) a
-> Mosaic mirror uplo height a
Packed.takeTopLeft TriangularP pack lo diag up (sh0 ::+ sh1) a
a

takeBottomLeft ::
   (Layout.Packing pack, MatrixShape.TriDiag diag,
    Shape.C sh0, Shape.C sh1, Class.Floating a) =>
   FlexLowerP pack diag (sh0::+sh1) a -> General sh1 sh0 a
takeBottomLeft :: forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, C sh1, Floating a) =>
FlexLowerP pack diag (sh0 ::+ sh1) a -> General sh1 sh0 a
takeBottomLeft FlexLowerP pack diag (sh0 ::+ sh1) a
a =
   case FlexLowerP pack diag (sh0 ::+ sh1) a -> PackingSingleton pack
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 FlexLowerP pack diag (sh0 ::+ sh1) a
a of
      PackingSingleton pack
Layout.Packed -> (PlainArray
   pack
   diag
   Filled
   (Bands U0)
   Shape
   Small
   Small
   (sh0 ::+ sh1)
   (sh0 ::+ sh1)
   a
 -> PlainArray
      Unpacked Arbitrary Filled Filled Size Big Big sh1 sh0 a)
-> FlexLowerP pack diag (sh0 ::+ sh1) a -> General sh1 sh0 a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 MosaicLower NoMirror (sh0 ::+ sh1) a -> General sh1 sh0 a
PlainArray
  pack
  diag
  Filled
  (Bands U0)
  Shape
  Small
  Small
  (sh0 ::+ sh1)
  (sh0 ::+ sh1)
  a
-> PlainArray
     Unpacked Arbitrary Filled Filled Size Big Big sh1 sh0 a
forall height width a mirror.
(C height, C width, Floating a) =>
MosaicLower mirror (width ::+ height) a -> General height width a
Packed.takeBottomLeft FlexLowerP pack diag (sh0 ::+ sh1) a
a
      PackingSingleton pack
Layout.Unpacked -> Quadratic diag Filled (Bands U0) (sh0 ::+ sh1) a
-> General sh1 sh0 a
forall property lower upper sh0 sh1 a.
(Property property, Strip lower, Strip upper, C sh0, C sh1,
 Floating a) =>
Quadratic property lower upper (sh0 ::+ sh1) a -> General sh1 sh0 a
ArrUnpacked.takeBottomLeft FlexLowerP pack diag (sh0 ::+ sh1) a
Quadratic diag Filled (Bands U0) (sh0 ::+ sh1) a
a

takeTopRight ::
   (Layout.Packing pack, MatrixShape.TriDiag diag,
    Shape.C sh0, Shape.C sh1, Class.Floating a) =>
   FlexUpperP pack diag (sh0::+sh1) a -> General sh0 sh1 a
takeTopRight :: forall pack diag sh0 sh1 a.
(Packing pack, TriDiag diag, C sh0, C sh1, Floating a) =>
FlexUpperP pack diag (sh0 ::+ sh1) a -> General sh0 sh1 a
takeTopRight FlexUpperP pack diag (sh0 ::+ sh1) a
a =
   case FlexUpperP pack diag (sh0 ::+ sh1) a -> PackingSingleton pack
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 FlexUpperP pack diag (sh0 ::+ sh1) a
a of
      PackingSingleton pack
Layout.Packed -> (PlainArray
   pack
   diag
   (Bands U0)
   Filled
   Shape
   Small
   Small
   (sh0 ::+ sh1)
   (sh0 ::+ sh1)
   a
 -> PlainArray
      Unpacked Arbitrary Filled Filled Size Big Big sh0 sh1 a)
-> FlexUpperP pack diag (sh0 ::+ sh1) a -> General sh0 sh1 a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 MosaicUpper NoMirror (sh0 ::+ sh1) a -> General sh0 sh1 a
PlainArray
  pack
  diag
  (Bands U0)
  Filled
  Shape
  Small
  Small
  (sh0 ::+ sh1)
  (sh0 ::+ sh1)
  a
-> PlainArray
     Unpacked Arbitrary Filled Filled Size Big Big sh0 sh1 a
forall height width a mirror.
(C height, C width, Floating a) =>
MosaicUpper mirror (height ::+ width) a -> General height width a
Packed.takeTopRight FlexUpperP pack diag (sh0 ::+ sh1) a
a
      PackingSingleton pack
Layout.Unpacked -> Quadratic diag (Bands U0) Filled (sh0 ::+ sh1) a
-> General sh0 sh1 a
forall property lower upper sh0 sh1 a.
(Property property, Strip lower, Strip upper, C sh0, C sh1,
 Floating a) =>
Quadratic property lower upper (sh0 ::+ sh1) a -> General sh0 sh1 a
ArrUnpacked.takeTopRight FlexUpperP pack diag (sh0 ::+ sh1) a
Quadratic diag (Bands U0) Filled (sh0 ::+ sh1) a
a

takeBottomRight ::
   (Layout.Packing pack, MatrixShape.UpLo lo up, MatrixShape.TriDiag diag,
    Shape.C sh0, Shape.C sh1, Class.Floating a) =>
   TriangularP pack lo diag up (sh0::+sh1) a ->
   TriangularP pack lo diag up sh1 a
takeBottomRight :: forall pack lo up diag sh0 sh1 a.
(Packing pack, UpLo lo up, TriDiag diag, C sh0, C sh1,
 Floating a) =>
TriangularP pack lo diag up (sh0 ::+ sh1) a
-> TriangularP pack lo diag up sh1 a
takeBottomRight TriangularP pack lo diag up (sh0 ::+ sh1) a
a =
   case TriangularP pack lo diag up (sh0 ::+ sh1) a
-> PackingSingleton pack
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 TriangularP pack lo diag up (sh0 ::+ sh1) a
a of
      PackingSingleton pack
Layout.Unpacked -> Quadratic diag lo up (sh0 ::+ sh1) a -> Quadratic diag lo up sh1 a
forall property lower upper sh0 sh1 a.
(Property property, Strip lower, Strip upper, C sh0, C sh1,
 Floating a) =>
Quadratic property lower upper (sh0 ::+ sh1) a
-> Quadratic property lower upper sh1 a
ArrUnpacked.takeBottomRight TriangularP pack lo diag up (sh0 ::+ sh1) a
Quadratic diag lo up (sh0 ::+ sh1) a
a
      PackingSingleton pack
Layout.Packed ->
         case TriangularP pack lo diag up (sh0 ::+ sh1) a -> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP pack lo diag up (sh0 ::+ sh1) a
a of
            UpLoSingleton lo up
MatrixShape.Lower -> (PlainArray
   pack diag lo up Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a
 -> PlainArray pack diag lo up Shape Small Small sh1 sh1 a)
-> TriangularP pack lo diag up (sh0 ::+ sh1) a
-> TriangularP pack lo diag up sh1 a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Mosaic NoMirror Lower (sh0 ::+ sh1) a
-> Mosaic NoMirror Lower sh1 a
PlainArray
  pack diag lo up Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a
-> PlainArray pack diag lo up Shape Small Small sh1 sh1 a
forall uplo height width a mirror.
(UpLo uplo, C height, C width, Floating a) =>
Mosaic mirror uplo (height ::+ width) a
-> Mosaic mirror uplo width a
Packed.takeBottomRight TriangularP pack lo diag up (sh0 ::+ sh1) a
a
            UpLoSingleton lo up
MatrixShape.Upper -> (PlainArray
   pack diag lo up Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a
 -> PlainArray pack diag lo up Shape Small Small sh1 sh1 a)
-> TriangularP pack lo diag up (sh0 ::+ sh1) a
-> TriangularP pack lo diag up sh1 a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 Mosaic NoMirror Upper (sh0 ::+ sh1) a
-> Mosaic NoMirror Upper sh1 a
PlainArray
  pack diag lo up Shape Small Small (sh0 ::+ sh1) (sh0 ::+ sh1) a
-> PlainArray pack diag lo up Shape Small Small sh1 sh1 a
forall uplo height width a mirror.
(UpLo uplo, C height, C width, Floating a) =>
Mosaic mirror uplo (height ::+ width) a
-> Mosaic mirror uplo width a
Packed.takeBottomRight TriangularP pack lo diag up (sh0 ::+ sh1) a
a


uploTag ::
   (MatrixShape.UpLo lo up) =>
   TriangularP pack lo diag up sh a -> MatrixShape.UpLoSingleton lo up
uploTag :: forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP pack lo diag up sh a
_ = UpLoSingleton lo up
forall lo up. UpLo lo up => UpLoSingleton lo up
MatrixShape.autoUplo


multiplyVector ::
   (Layout.Packing pack, MatrixShape.UpLo lo up, MatrixShape.TriDiag diag,
    Shape.C sh, Eq sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a -> Vector sh a -> Vector sh a
multiplyVector :: forall pack lo up diag sh a.
(Packing pack, UpLo lo up, TriDiag diag, C sh, Eq sh,
 Floating a) =>
TriangularP pack lo diag up sh a -> Vector sh a -> Vector sh a
multiplyVector TriangularP pack lo diag up sh a
a =
   case TriangularP pack lo diag up sh a -> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP pack lo diag up sh a
a of
      UpLoSingleton lo up
MatrixShape.Upper ->
         DiagSingleton diag
-> TriangularP pack Upper sh a -> Vector sh a -> Vector sh a
forall uplo diag sh a pack.
(UpLo uplo, TriDiag diag, C sh, Eq sh, Floating a) =>
DiagSingleton diag
-> TriangularP pack uplo sh a -> Vector sh a -> Vector sh a
Basic.multiplyVector (TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a) (TriangularP pack Upper sh a -> Vector sh a -> Vector sh a)
-> TriangularP pack Upper sh a -> Vector sh a -> Vector sh a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up sh a
-> PlainArray pack diag lo up Shape Small Small sh sh a
forall pack property lower upper meas vert horiz height width a.
ToPlain pack property lower upper meas vert horiz height width =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper meas vert horiz height width a
ArrMatrix.toVector TriangularP pack lo diag up sh a
a
      UpLoSingleton lo up
MatrixShape.Lower ->
         DiagSingleton diag
-> TriangularP pack Lower sh a -> Vector sh a -> Vector sh a
forall uplo diag sh a pack.
(UpLo uplo, TriDiag diag, C sh, Eq sh, Floating a) =>
DiagSingleton diag
-> TriangularP pack uplo sh a -> Vector sh a -> Vector sh a
Basic.multiplyVector (TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a) (TriangularP pack Lower sh a -> Vector sh a -> Vector sh a)
-> TriangularP pack Lower sh a -> Vector sh a -> Vector sh a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up sh a
-> PlainArray pack diag lo up Shape Small Small sh sh a
forall pack property lower upper meas vert horiz height width a.
ToPlain pack property lower upper meas vert horiz height width =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper meas vert horiz height width a
ArrMatrix.toVector TriangularP pack lo diag up sh a
a

square ::
   (Layout.Packing pack, MatrixShape.UpLo lo up, MatrixShape.TriDiag diag,
    Shape.C sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a ->
   TriangularP pack lo diag up sh a
square :: forall pack lo up diag sh a.
(Packing pack, UpLo lo up, TriDiag diag, C sh, Floating a) =>
TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
square TriangularP pack lo diag up sh a
a =
   case TriangularP pack lo diag up sh a -> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP pack lo diag up sh a
a of
      UpLoSingleton lo up
MatrixShape.Upper -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray pack diag lo up Shape Small Small sh sh a)
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 (DiagSingleton diag
-> Mosaic pack NoMirror Upper sh a
-> Mosaic pack NoMirror Upper sh a
forall pack diag uplo sh a mirror.
(Packing pack, TriDiag diag, UpLo uplo, C sh, Floating a) =>
DiagSingleton diag
-> Mosaic pack mirror uplo sh a -> Mosaic pack mirror uplo sh a
Mosaic.square (DiagSingleton diag
 -> Mosaic pack NoMirror Upper sh a
 -> Mosaic pack NoMirror Upper sh a)
-> DiagSingleton diag
-> Mosaic pack NoMirror Upper sh a
-> Mosaic pack NoMirror Upper sh a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a) TriangularP pack lo diag up sh a
a
      UpLoSingleton lo up
MatrixShape.Lower -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray pack diag lo up Shape Small Small sh sh a)
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 (DiagSingleton diag
-> Mosaic pack NoMirror Lower sh a
-> Mosaic pack NoMirror Lower sh a
forall pack diag uplo sh a mirror.
(Packing pack, TriDiag diag, UpLo uplo, C sh, Floating a) =>
DiagSingleton diag
-> Mosaic pack mirror uplo sh a -> Mosaic pack mirror uplo sh a
Mosaic.square (DiagSingleton diag
 -> Mosaic pack NoMirror Lower sh a
 -> Mosaic pack NoMirror Lower sh a)
-> DiagSingleton diag
-> Mosaic pack NoMirror Lower sh a
-> Mosaic pack NoMirror Lower sh a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a) TriangularP pack lo diag up sh a
a

multiply ::
   (Layout.Packing pack, MatrixShape.UpLo lo up, MatrixShape.TriDiag diag,
    Shape.C sh, Eq sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a ->
   TriangularP pack lo diag up sh a ->
   TriangularP pack lo diag up sh a
multiply :: forall pack lo up diag sh a.
(Packing pack, UpLo lo up, TriDiag diag, C sh, Eq sh,
 Floating a) =>
TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
multiply TriangularP pack lo diag up sh a
a =
   case TriangularP pack lo diag up sh a -> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP pack lo diag up sh a
a of
      UpLoSingleton lo up
MatrixShape.Upper -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray pack diag lo up Shape Small Small sh sh a)
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up 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
ArrMatrix.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
Basic.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
$ TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a) TriangularP pack lo diag up sh a
a
      UpLoSingleton lo up
MatrixShape.Lower -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray pack diag lo up Shape Small Small sh sh a)
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up 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
ArrMatrix.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
Basic.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
$ TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a) TriangularP pack lo diag up sh a
a

multiplyFull ::
   (Layout.Packing pack, MatrixShape.UpLo lo up, MatrixShape.TriDiag diag,
    Extent.Measure meas, Extent.C vert, Extent.C horiz,
    Shape.C height, Eq height, Shape.C width, Class.Floating a) =>
   TriangularP pack lo diag up height a ->
   Full meas vert horiz height width a ->
   Full meas vert horiz height width a
multiplyFull :: forall pack lo up diag meas vert horiz height width a.
(Packing pack, UpLo lo up, TriDiag diag, Measure meas, C vert,
 C horiz, C height, Eq height, C width, Floating a) =>
TriangularP pack lo diag up height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
multiplyFull TriangularP pack lo diag up height a
a =
   case TriangularP pack lo diag up height a -> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP pack lo diag up height a
a of
      UpLoSingleton lo up
MatrixShape.Upper -> (PlainArray pack diag lo up Shape Small Small height height a
 -> PlainArray
      Unpacked Arbitrary Filled Filled meas vert horiz height width a
 -> PlainArray
      Unpacked Arbitrary Filled Filled meas vert horiz height width a)
-> TriangularP pack lo diag up height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB 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
ArrMatrix.lift2 (DiagSingleton diag
-> TriangularP pack Upper height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
forall uplo diag meas vert horiz height width a pack.
(UpLo uplo, TriDiag diag, Measure meas, C vert, C horiz, C height,
 Eq height, C width, Floating a) =>
DiagSingleton diag
-> TriangularP pack uplo height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
Basic.multiplyFull (DiagSingleton diag
 -> TriangularP pack Upper height a
 -> Full meas vert horiz height width a
 -> Full meas vert horiz height width a)
-> DiagSingleton diag
-> TriangularP pack Upper height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up height 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 TriangularP pack lo diag up height a
a) TriangularP pack lo diag up height a
a
      UpLoSingleton lo up
MatrixShape.Lower -> (PlainArray pack diag lo up Shape Small Small height height a
 -> PlainArray
      Unpacked Arbitrary Filled Filled meas vert horiz height width a
 -> PlainArray
      Unpacked Arbitrary Filled Filled meas vert horiz height width a)
-> TriangularP pack lo diag up height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB 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
ArrMatrix.lift2 (DiagSingleton diag
-> TriangularP pack Lower height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
forall uplo diag meas vert horiz height width a pack.
(UpLo uplo, TriDiag diag, Measure meas, C vert, C horiz, C height,
 Eq height, C width, Floating a) =>
DiagSingleton diag
-> TriangularP pack uplo height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
Basic.multiplyFull (DiagSingleton diag
 -> TriangularP pack Lower height a
 -> Full meas vert horiz height width a
 -> Full meas vert horiz height width a)
-> DiagSingleton diag
-> TriangularP pack Lower height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up height 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 TriangularP pack lo diag up height a
a) TriangularP pack lo diag up height a
a



solve ::
   (Layout.Packing pack, MatrixShape.UpLo lo up, MatrixShape.TriDiag diag,
    Extent.Measure meas, Extent.C vert, Extent.C horiz,
    Shape.C sh, Eq sh, Shape.C nrhs, Class.Floating a) =>
   TriangularP pack lo diag up sh a ->
   Full meas vert horiz sh nrhs a -> Full meas vert horiz sh nrhs a
solve :: forall pack lo up diag meas vert horiz height width a.
(Packing pack, UpLo lo up, TriDiag diag, Measure meas, C vert,
 C horiz, C height, Eq height, C width, Floating a) =>
TriangularP pack lo diag up height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
solve TriangularP pack lo diag up sh a
a =
   case TriangularP pack lo diag up sh a -> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP pack lo diag up sh a
a of
      UpLoSingleton lo up
MatrixShape.Upper -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray
      Unpacked Arbitrary Filled Filled meas vert horiz sh nrhs a
 -> PlainArray
      Unpacked Arbitrary Filled Filled meas vert horiz sh nrhs a)
-> TriangularP pack lo diag up sh a
-> Full meas vert horiz sh nrhs a
-> Full meas vert horiz sh nrhs 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
ArrMatrix.lift2 (DiagSingleton diag
-> Triangular pack Upper sh a
-> Full meas vert horiz sh nrhs a
-> Full meas vert horiz sh nrhs a
forall uplo diag meas vert horiz height width a pack.
(UpLo uplo, TriDiag diag, Measure meas, C vert, C horiz, C height,
 Eq height, C width, Floating a) =>
DiagSingleton diag
-> TriangularP pack uplo height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
Linear.solve (DiagSingleton diag
 -> Triangular pack Upper sh a
 -> Full meas vert horiz sh nrhs a
 -> Full meas vert horiz sh nrhs a)
-> DiagSingleton diag
-> Triangular pack Upper sh a
-> Full meas vert horiz sh nrhs a
-> Full meas vert horiz sh nrhs a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a) TriangularP pack lo diag up sh a
a
      UpLoSingleton lo up
MatrixShape.Lower -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray
      Unpacked Arbitrary Filled Filled meas vert horiz sh nrhs a
 -> PlainArray
      Unpacked Arbitrary Filled Filled meas vert horiz sh nrhs a)
-> TriangularP pack lo diag up sh a
-> Full meas vert horiz sh nrhs a
-> Full meas vert horiz sh nrhs 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
ArrMatrix.lift2 (DiagSingleton diag
-> Triangular pack Lower sh a
-> Full meas vert horiz sh nrhs a
-> Full meas vert horiz sh nrhs a
forall uplo diag meas vert horiz height width a pack.
(UpLo uplo, TriDiag diag, Measure meas, C vert, C horiz, C height,
 Eq height, C width, Floating a) =>
DiagSingleton diag
-> TriangularP pack uplo height a
-> Full meas vert horiz height width a
-> Full meas vert horiz height width a
Linear.solve (DiagSingleton diag
 -> Triangular pack Lower sh a
 -> Full meas vert horiz sh nrhs a
 -> Full meas vert horiz sh nrhs a)
-> DiagSingleton diag
-> Triangular pack Lower sh a
-> Full meas vert horiz sh nrhs a
-> Full meas vert horiz sh nrhs a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a) TriangularP pack lo diag up sh a
a

inverse ::
   (Layout.Packing pack, MatrixShape.UpLo lo up, MatrixShape.TriDiag diag,
    Shape.C sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a ->
   TriangularP pack lo diag up sh a
inverse :: forall pack lo up diag sh a.
(Packing pack, UpLo lo up, TriDiag diag, C sh, Floating a) =>
TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
inverse TriangularP pack lo diag up sh a
a =
   case TriangularP pack lo diag up sh a -> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP pack lo diag up sh a
a of
      UpLoSingleton lo up
MatrixShape.Upper -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray pack diag lo up Shape Small Small sh sh a)
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 (DiagSingleton diag
-> Triangular pack Upper sh a -> Triangular pack Upper sh a
forall uplo diag sh a pack.
(UpLo uplo, TriDiag diag, C sh, Floating a) =>
DiagSingleton diag
-> Triangular pack uplo sh a -> Triangular pack uplo sh a
Linear.inverse (DiagSingleton diag
 -> Triangular pack Upper sh a -> Triangular pack Upper sh a)
-> DiagSingleton diag
-> Triangular pack Upper sh a
-> Triangular pack Upper sh a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a) TriangularP pack lo diag up sh a
a
      UpLoSingleton lo up
MatrixShape.Lower -> (PlainArray pack diag lo up Shape Small Small sh sh a
 -> PlainArray pack diag lo up Shape Small Small sh sh a)
-> TriangularP pack lo diag up sh a
-> TriangularP pack lo diag up sh a
forall packA propA lowerA upperA measA vertA horizA heightA widthA
       packB propB lowerB upperB measB vertB horizB heightB widthB a b.
(ToPlain
   packA propA lowerA upperA measA vertA horizA heightA widthA,
 FromPlain
   packB propB lowerB upperB measB vertB horizB heightB widthB) =>
(PlainArray
   packA propA lowerA upperA measA vertA horizA heightA widthA a
 -> PlainArray
      packB propB lowerB upperB measB vertB horizB heightB widthB b)
-> ArrayMatrix
     packA propA lowerA upperA measA vertA horizA heightA widthA a
-> ArrayMatrix
     packB propB lowerB upperB measB vertB horizB heightB widthB b
ArrMatrix.lift1 (DiagSingleton diag
-> Triangular pack Lower sh a -> Triangular pack Lower sh a
forall uplo diag sh a pack.
(UpLo uplo, TriDiag diag, C sh, Floating a) =>
DiagSingleton diag
-> Triangular pack uplo sh a -> Triangular pack uplo sh a
Linear.inverse (DiagSingleton diag
 -> Triangular pack Lower sh a -> Triangular pack Lower sh a)
-> DiagSingleton diag
-> Triangular pack Lower sh a
-> Triangular pack Lower sh a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a) TriangularP pack lo diag up sh a
a

determinant ::
   (Layout.Packing pack, MatrixShape.UpLo lo up, MatrixShape.TriDiag diag,
    Shape.C sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a -> a
determinant :: forall pack lo up diag sh a.
(Packing pack, UpLo lo up, TriDiag diag, C sh, Floating a) =>
TriangularP pack lo diag up sh a -> a
determinant TriangularP pack lo diag up sh a
a =
   case TriangularP pack lo diag up 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 TriangularP pack lo diag up sh a
a of
      DiagSingleton diag
MatrixShape.Unit -> a
forall a. Floating a => a
Scalar.one
      DiagSingleton diag
MatrixShape.Arbitrary ->
         case TriangularP pack lo diag up sh a -> UpLoSingleton lo up
forall lo up pack diag sh a.
UpLo lo up =>
TriangularP pack lo diag up sh a -> UpLoSingleton lo up
uploTag TriangularP pack lo diag up sh a
a of
            UpLoSingleton lo up
MatrixShape.Upper -> Triangular pack Upper sh a -> a
forall uplo sh a pack.
(UpLo uplo, C sh, Floating a) =>
Triangular pack uplo sh a -> a
Linear.determinant (Triangular pack Upper sh a -> a)
-> Triangular pack Upper sh a -> a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up sh a
-> PlainArray pack diag lo up Shape Small Small sh sh a
forall pack property lower upper meas vert horiz height width a.
ToPlain pack property lower upper meas vert horiz height width =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper meas vert horiz height width a
ArrMatrix.toVector TriangularP pack lo diag up sh a
a
            UpLoSingleton lo up
MatrixShape.Lower -> Triangular pack Lower sh a -> a
forall uplo sh a pack.
(UpLo uplo, C sh, Floating a) =>
Triangular pack uplo sh a -> a
Linear.determinant (Triangular pack Lower sh a -> a)
-> Triangular pack Lower sh a -> a
forall a b. (a -> b) -> a -> b
$ TriangularP pack lo diag up sh a
-> PlainArray pack diag lo up Shape Small Small sh sh a
forall pack property lower upper meas vert horiz height width a.
ToPlain pack property lower upper meas vert horiz height width =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper meas vert horiz height width a
ArrMatrix.toVector TriangularP pack lo diag up sh a
a



eigenvalues ::
   (Layout.Packing pack, MatrixShape.DiagUpLo lo up,
    Shape.C sh, Class.Floating a) =>
   TriangularP pack lo diag up sh a -> Vector sh a
eigenvalues :: forall pack lo up sh a diag.
(Packing pack, DiagUpLo lo up, C sh, Floating a) =>
TriangularP pack lo diag up sh a -> Vector sh a
eigenvalues = Quadratic pack diag lo up sh a -> Vector sh a
forall sh a pack property lower upper.
(C sh, Floating a) =>
Quadratic pack property lower upper sh a -> Vector sh a
OmniMatrix.takeDiagonal

{- |
@(vr,d,vlAdj) = eigensystem a@

Counterintuitively, @vr@ contains the right eigenvectors as columns
and @vlAdj@ contains the left conjugated eigenvectors as rows.
The idea is to provide a decomposition of @a@.
If @a@ is diagonalizable, then @vr@ and @vlAdj@
are almost inverse to each other.
More precisely, @vlAdj \<\> vr@ is a diagonal matrix,
but not necessarily an identity matrix.
This is because all eigenvectors are normalized
such that 'Numeric.LAPACK.Vector.normInf1' is 1.
With the following scaling, the decomposition becomes perfect:

> let scal = takeDiagonal $ vlAdj <> vr
> a == vr <> diagonal (Vector.divide d scal) <> vlAdj

If @a@ is non-diagonalizable
then some columns of @vr@ and corresponding rows of @vlAdj@ are left zero
and the above property does not hold.
-}
eigensystem ::
   (Layout.Packing pack, MatrixShape.DiagUpLo lo up,
    Shape.C sh, Class.Floating a) =>
   TriangularP pack lo Arbitrary up sh a ->
   (TriangularP pack lo Arbitrary up sh a, Vector sh a,
    TriangularP pack lo Arbitrary up sh a)
eigensystem :: forall pack lo up sh a.
(Packing pack, DiagUpLo lo up, C sh, Floating a) =>
TriangularP pack lo Arbitrary up sh a
-> (TriangularP pack lo Arbitrary up sh a, Vector sh a,
    TriangularP pack lo Arbitrary up sh a)
eigensystem TriangularP pack lo Arbitrary up sh a
a =
   let (TriangularP pack lo Arbitrary up sh a
vr,TriangularP pack lo Arbitrary up sh a
vl) =
         Eigensystem pack sh a lo up
-> TriangularP pack lo Arbitrary up sh a
-> (TriangularP pack lo Arbitrary up sh a,
    TriangularP pack lo Arbitrary up sh a)
forall pack sh a lo up.
Eigensystem pack sh a lo up
-> TriangularP pack lo Arbitrary up sh a
-> (TriangularP pack lo Arbitrary up sh a,
    TriangularP pack lo Arbitrary up sh a)
getEigensystem
            (Eigensystem pack sh a (Bands U0) (Bands U0)
-> Eigensystem pack sh a (Bands U0) Filled
-> Eigensystem pack sh a Filled (Bands U0)
-> Eigensystem pack sh a lo up
forall lo up (f :: * -> * -> *).
DiagUpLoC lo up =>
f (Bands U0) (Bands U0)
-> f (Bands U0) Filled -> f Filled (Bands U0) -> f lo up
forall (f :: * -> * -> *).
f (Bands U0) (Bands U0)
-> f (Bands U0) Filled -> f Filled (Bands U0) -> f lo up
MatrixShape.switchDiagUpLo
               ((TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
 -> (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a,
     TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a))
-> Eigensystem pack sh a (Bands U0) (Bands U0)
forall pack sh a lo up.
(TriangularP pack lo Arbitrary up sh a
 -> (TriangularP pack lo Arbitrary up sh a,
     TriangularP pack lo Arbitrary up sh a))
-> Eigensystem pack sh a lo up
Eigensystem ((TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
  -> (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a,
      TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a))
 -> Eigensystem pack sh a (Bands U0) (Bands U0))
-> (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
    -> (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a,
        TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a))
-> Eigensystem pack sh a (Bands U0) (Bands U0)
forall a b. (a -> b) -> a -> b
$
                  (\TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
eye -> (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
eye, TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
-> TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
forall typ xl xu meas vert horiz height width a lower upper.
(Transpose typ, TransposeExtra typ xl, TransposeExtra typ xu,
 Measure meas, C vert, C horiz, C height, C width, Floating a) =>
Matrix typ xl xu lower upper meas vert horiz height width a
-> Matrix typ xu xl upper lower meas horiz vert width height a
forall xl xu meas vert horiz height width a lower upper.
(TransposeExtra (Array pack Arbitrary) xl,
 TransposeExtra (Array pack Arbitrary) xu, Measure meas, C vert,
 C horiz, C height, C width, Floating a) =>
Matrix
  (Array pack Arbitrary)
  xl
  xu
  lower
  upper
  meas
  vert
  horiz
  height
  width
  a
-> Matrix
     (Array pack Arbitrary)
     xu
     xl
     upper
     lower
     meas
     horiz
     vert
     width
     height
     a
Matrix.transpose TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
eye)) (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
 -> (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a,
     TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a))
-> (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
    -> TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a)
-> TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
-> (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a,
    TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                  Quadratic pack Arbitrary (Bands U0) (Bands U0) sh
-> TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
forall sh a pack property lower upper.
(C sh, Floating a) =>
Quadratic pack property lower upper sh
-> Quadratic pack property lower upper sh a
OmniMatrix.identityFromShape (Quadratic pack Arbitrary (Bands U0) (Bands U0) sh
 -> TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a)
-> (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
    -> Quadratic pack Arbitrary (Bands U0) (Bands U0) sh)
-> TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
-> TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                  Order -> sh -> Quadratic pack Arbitrary (Bands U0) (Bands U0) sh
forall pack diag size.
(Packing pack, TriDiag diag) =>
Order
-> size
-> Omni pack diag (Bands U0) (Bands U0) Shape Small Small size size
Omni.uncheckedDiagonal Order
Layout.ColumnMajor (sh -> Quadratic pack Arbitrary (Bands U0) (Bands U0) sh)
-> (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a -> sh)
-> TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
-> Quadratic pack Arbitrary (Bands U0) (Bands U0) sh
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                  Quadratic pack Arbitrary (Bands U0) (Bands U0) sh -> sh
forall pack property lower upper sh.
Omni pack property lower upper Shape Small Small sh sh -> sh
Omni.squareSize (Quadratic pack Arbitrary (Bands U0) (Bands U0) sh -> sh)
-> (TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
    -> Quadratic pack Arbitrary (Bands U0) (Bands U0) sh)
-> TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
-> sh
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TriangularP pack (Bands U0) Arbitrary (Bands U0) sh a
-> Quadratic pack Arbitrary (Bands U0) (Bands U0) 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
ArrMatrix.shape)
               ((TriangularP pack (Bands U0) Arbitrary Filled sh a
 -> (TriangularP pack (Bands U0) Arbitrary Filled sh a,
     TriangularP pack (Bands U0) Arbitrary Filled sh a))
-> Eigensystem pack sh a (Bands U0) Filled
forall pack sh a lo up.
(TriangularP pack lo Arbitrary up sh a
 -> (TriangularP pack lo Arbitrary up sh a,
     TriangularP pack lo Arbitrary up sh a))
-> Eigensystem pack sh a lo up
Eigensystem ((TriangularP pack (Bands U0) Arbitrary Filled sh a
  -> (TriangularP pack (Bands U0) Arbitrary Filled sh a,
      TriangularP pack (Bands U0) Arbitrary Filled sh a))
 -> Eigensystem pack sh a (Bands U0) Filled)
-> (TriangularP pack (Bands U0) Arbitrary Filled sh a
    -> (TriangularP pack (Bands U0) Arbitrary Filled sh a,
        TriangularP pack (Bands U0) Arbitrary Filled sh a))
-> Eigensystem pack sh a (Bands U0) Filled
forall a b. (a -> b) -> a -> b
$
                  (TriangularP pack Upper sh a
 -> TriangularP pack (Bands U0) Arbitrary Filled sh a,
 TriangularP pack Upper sh a
 -> TriangularP pack (Bands U0) Arbitrary Filled sh a)
-> (TriangularP pack Upper sh a, TriangularP pack Upper sh a)
-> (TriangularP pack (Bands U0) Arbitrary Filled sh a,
    TriangularP pack (Bands U0) Arbitrary Filled sh a)
forall a c b d. (a -> c, b -> d) -> (a, b) -> (c, d)
mapPair (TriangularP pack Upper sh a
-> TriangularP pack (Bands U0) Arbitrary Filled sh a
PlainArray
  pack Arbitrary (Bands U0) Filled Shape Small Small sh sh a
-> TriangularP pack (Bands U0) Arbitrary Filled sh a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0, TriangularP pack Upper sh a
-> TriangularP pack (Bands U0) Arbitrary Filled sh a
PlainArray
  pack Arbitrary (Bands U0) Filled Shape Small Small sh sh a
-> TriangularP pack (Bands U0) Arbitrary Filled sh a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0) ((TriangularP pack Upper sh a, TriangularP pack Upper sh a)
 -> (TriangularP pack (Bands U0) Arbitrary Filled sh a,
     TriangularP pack (Bands U0) Arbitrary Filled sh a))
-> (TriangularP pack (Bands U0) Arbitrary Filled sh a
    -> (TriangularP pack Upper sh a, TriangularP pack Upper sh a))
-> TriangularP pack (Bands U0) Arbitrary Filled sh a
-> (TriangularP pack (Bands U0) Arbitrary Filled sh a,
    TriangularP pack (Bands U0) Arbitrary Filled sh a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                  TriangularP pack Upper sh a
-> (TriangularP pack Upper sh a, TriangularP pack Upper sh a)
forall uplo vpack sh a pack.
(UpLo uplo, Packing vpack, C sh, Floating a) =>
TriangularP pack uplo sh a
-> (TriangularP vpack uplo sh a, TriangularP vpack uplo sh a)
Eigen.decompose (TriangularP pack Upper sh a
 -> (TriangularP pack Upper sh a, TriangularP pack Upper sh a))
-> (TriangularP pack (Bands U0) Arbitrary Filled sh a
    -> TriangularP pack Upper sh a)
-> TriangularP pack (Bands U0) Arbitrary Filled sh a
-> (TriangularP pack Upper sh a, TriangularP pack Upper sh a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TriangularP pack (Bands U0) Arbitrary Filled sh a
-> TriangularP pack Upper sh a
TriangularP pack (Bands U0) Arbitrary Filled sh a
-> PlainArray
     pack Arbitrary (Bands U0) Filled Shape Small Small sh sh a
forall pack property lower upper meas vert horiz height width a.
ToPlain pack property lower upper meas vert horiz height width =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper meas vert horiz height width a
ArrMatrix.toVector)
               ((TriangularP pack Filled Arbitrary (Bands U0) sh a
 -> (TriangularP pack Filled Arbitrary (Bands U0) sh a,
     TriangularP pack Filled Arbitrary (Bands U0) sh a))
-> Eigensystem pack sh a Filled (Bands U0)
forall pack sh a lo up.
(TriangularP pack lo Arbitrary up sh a
 -> (TriangularP pack lo Arbitrary up sh a,
     TriangularP pack lo Arbitrary up sh a))
-> Eigensystem pack sh a lo up
Eigensystem ((TriangularP pack Filled Arbitrary (Bands U0) sh a
  -> (TriangularP pack Filled Arbitrary (Bands U0) sh a,
      TriangularP pack Filled Arbitrary (Bands U0) sh a))
 -> Eigensystem pack sh a Filled (Bands U0))
-> (TriangularP pack Filled Arbitrary (Bands U0) sh a
    -> (TriangularP pack Filled Arbitrary (Bands U0) sh a,
        TriangularP pack Filled Arbitrary (Bands U0) sh a))
-> Eigensystem pack sh a Filled (Bands U0)
forall a b. (a -> b) -> a -> b
$
                  (TriangularP pack Lower sh a
 -> TriangularP pack Filled Arbitrary (Bands U0) sh a,
 TriangularP pack Lower sh a
 -> TriangularP pack Filled Arbitrary (Bands U0) sh a)
-> (TriangularP pack Lower sh a, TriangularP pack Lower sh a)
-> (TriangularP pack Filled Arbitrary (Bands U0) sh a,
    TriangularP pack Filled Arbitrary (Bands U0) sh a)
forall a c b d. (a -> c, b -> d) -> (a, b) -> (c, d)
mapPair (TriangularP pack Lower sh a
-> TriangularP pack Filled Arbitrary (Bands U0) sh a
PlainArray
  pack Arbitrary Filled (Bands U0) Shape Small Small sh sh a
-> TriangularP pack Filled Arbitrary (Bands U0) sh a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0, TriangularP pack Lower sh a
-> TriangularP pack Filled Arbitrary (Bands U0) sh a
PlainArray
  pack Arbitrary Filled (Bands U0) Shape Small Small sh sh a
-> TriangularP pack Filled Arbitrary (Bands U0) sh a
forall pack prop lower upper meas vert horiz height width a.
FromPlain pack prop lower upper meas vert horiz height width =>
PlainArray pack prop lower upper meas vert horiz height width a
-> ArrayMatrix pack prop lower upper meas vert horiz height width a
ArrMatrix.lift0) ((TriangularP pack Lower sh a, TriangularP pack Lower sh a)
 -> (TriangularP pack Filled Arbitrary (Bands U0) sh a,
     TriangularP pack Filled Arbitrary (Bands U0) sh a))
-> (TriangularP pack Filled Arbitrary (Bands U0) sh a
    -> (TriangularP pack Lower sh a, TriangularP pack Lower sh a))
-> TriangularP pack Filled Arbitrary (Bands U0) sh a
-> (TriangularP pack Filled Arbitrary (Bands U0) sh a,
    TriangularP pack Filled Arbitrary (Bands U0) sh a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                  TriangularP pack Lower sh a
-> (TriangularP pack Lower sh a, TriangularP pack Lower sh a)
forall uplo vpack sh a pack.
(UpLo uplo, Packing vpack, C sh, Floating a) =>
TriangularP pack uplo sh a
-> (TriangularP vpack uplo sh a, TriangularP vpack uplo sh a)
Eigen.decompose (TriangularP pack Lower sh a
 -> (TriangularP pack Lower sh a, TriangularP pack Lower sh a))
-> (TriangularP pack Filled Arbitrary (Bands U0) sh a
    -> TriangularP pack Lower sh a)
-> TriangularP pack Filled Arbitrary (Bands U0) sh a
-> (TriangularP pack Lower sh a, TriangularP pack Lower sh a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TriangularP pack Filled Arbitrary (Bands U0) sh a
-> TriangularP pack Lower sh a
TriangularP pack Filled Arbitrary (Bands U0) sh a
-> PlainArray
     pack Arbitrary Filled (Bands U0) Shape Small Small sh sh a
forall pack property lower upper meas vert horiz height width a.
ToPlain pack property lower upper meas vert horiz height width =>
ArrayMatrix
  pack property lower upper meas vert horiz height width a
-> PlainArray
     pack property lower upper meas vert horiz height width a
ArrMatrix.toVector))
            TriangularP pack lo Arbitrary up sh a
a
   in (TriangularP pack lo Arbitrary up sh a
vr, TriangularP pack lo Arbitrary up sh a -> Vector sh a
forall pack lo up sh a diag.
(Packing pack, DiagUpLo lo up, C sh, Floating a) =>
TriangularP pack lo diag up sh a -> Vector sh a
eigenvalues TriangularP pack lo Arbitrary up sh a
a, TriangularP pack lo Arbitrary up sh a
vl)

newtype Eigensystem pack sh a lo up =
   Eigensystem {
      forall pack sh a lo up.
Eigensystem pack sh a lo up
-> TriangularP pack lo Arbitrary up sh a
-> (TriangularP pack lo Arbitrary up sh a,
    TriangularP pack lo Arbitrary up sh a)
getEigensystem ::
         TriangularP pack lo Arbitrary up sh a ->
         (TriangularP pack lo Arbitrary up sh a,
          TriangularP pack lo Arbitrary up sh a)
   }