Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- type Triangular lo diag up sh = TriangularP Packed lo diag up sh
- type UpLo lo up = (UpLoC lo up, UpLoC up lo)
- type Upper sh = FlexUpper Arbitrary sh
- type FlexUpper diag sh = Quadratic Packed diag Empty Filled sh
- type UnitUpper sh = FlexUpper Unit sh
- type QuasiUpper sh = Quadratic Unpacked Arbitrary (Bands U1) Filled sh
- type Lower sh = FlexLower Arbitrary sh
- type FlexLower diag sh = Quadratic Packed diag Filled Empty sh
- type UnitLower sh = FlexLower Unit sh
- size :: TriangularP pack lo diag up sh a -> sh
- fromList :: (UpLo lo up, C sh, Storable a) => Order -> sh -> [a] -> Triangular lo Arbitrary up sh a
- autoFromList :: (UpLo lo up, Storable a) => Order -> [a] -> Triangular lo Arbitrary up ShapeInt a
- lowerFromList :: (C sh, Storable a) => Order -> sh -> [a] -> Lower sh a
- autoLowerFromList :: Storable a => Order -> [a] -> Lower ShapeInt a
- upperFromList :: (C sh, Storable a) => Order -> sh -> [a] -> Upper sh a
- autoUpperFromList :: Storable a => Order -> [a] -> Upper ShapeInt a
- asLower :: Id (FlexLowerP pack diag sh a)
- asUpper :: Id (FlexUpperP pack diag sh a)
- requireUnitDiagonal :: Id (TriangularP pack lo Unit up sh a)
- requireArbitraryDiagonal :: Id (TriangularP pack lo Arbitrary up sh a)
- relaxUnitDiagonal :: TriDiag diag => TriangularP pack lo Unit up sh a -> TriangularP pack lo diag up sh a
- strictArbitraryDiagonal :: TriDiag diag => TriangularP pack lo diag up sh a -> TriangularP pack lo Arbitrary up sh a
- identityOrder :: (Quadratic pack property lower upper, C sh, Floating a) => Order -> sh -> Quadratic pack property lower upper sh a
- diagonal :: (UpLo lo up, C sh, Floating a) => Order -> Vector sh a -> Triangular lo Arbitrary up sh a
- takeDiagonal :: (PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) => TriangularP pack lo diag up sh a -> Vector sh a
- transpose :: (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 :: (PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) => TriangularP pack lo diag up sh a -> TriangularP pack up diag lo sh a
- stackLower :: (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
- (#%%%) :: (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
- stackUpper :: (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
- (%%%#) :: (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
- splitLower :: (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)
- splitUpper :: (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)
- takeTopLeft :: (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
- takeTopRight :: (Packing pack, TriDiag diag, C sh0, C sh1, Floating a) => FlexUpperP pack diag (sh0 ::+ sh1) a -> General sh0 sh1 a
- takeBottomLeft :: (Packing pack, TriDiag diag, C sh0, C sh1, Floating a) => FlexLowerP pack diag (sh0 ::+ sh1) a -> General sh1 sh0 a
- takeBottomRight :: (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
- pack :: (Packing pack, UpLo lo up, TriDiag diag, C sh, Floating a) => TriangularP pack lo diag up sh a -> Triangular lo diag up sh a
- toSquare :: (PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) => TriangularP pack lo diag up sh a -> Square sh a
- takeLower :: (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
- takeUpper :: (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
- fromLowerRowMajor :: (C sh, Floating a) => Array (Triangular Lower sh) a -> Lower sh a
- toLowerRowMajor :: (C sh, Floating a) => Lower sh a -> Array (Triangular Lower sh) a
- fromUpperRowMajor :: (C sh, Floating a) => Array (Triangular Upper sh) a -> Upper sh a
- toUpperRowMajor :: (C sh, Floating a) => Upper sh a -> Array (Triangular Upper sh) a
- forceOrder :: (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
- adaptOrder :: (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
- add :: (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 :: (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
- multiplyVector :: (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
- square :: (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
- multiply :: (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
- multiplyFull :: (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 :: (Packing pack, UpLo lo up, TriDiag diag, Measure meas, C vert, C horiz, C sh, Eq sh, C nrhs, Floating a) => TriangularP pack lo diag up sh a -> Full meas vert horiz sh nrhs a -> Full meas vert horiz sh nrhs a
- inverse :: (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
- determinant :: (Packing pack, UpLo lo up, TriDiag diag, C sh, Floating a) => TriangularP pack lo diag up sh a -> a
- eigenvalues :: (Packing pack, DiagUpLo lo up, C sh, Floating a) => TriangularP pack lo diag up sh a -> Vector sh a
- eigensystem :: (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)
Documentation
type Triangular lo diag up sh = TriangularP Packed lo diag up sh Source #
fromList :: (UpLo lo up, C sh, Storable a) => Order -> sh -> [a] -> Triangular lo Arbitrary up sh a Source #
autoFromList :: (UpLo lo up, Storable a) => Order -> [a] -> Triangular lo Arbitrary up ShapeInt a Source #
requireUnitDiagonal :: Id (TriangularP pack lo Unit up sh a) Source #
requireArbitraryDiagonal :: Id (TriangularP pack lo Arbitrary up sh a) Source #
relaxUnitDiagonal :: TriDiag diag => TriangularP pack lo Unit up sh a -> TriangularP pack lo diag up sh a Source #
strictArbitraryDiagonal :: TriDiag diag => TriangularP pack lo diag up sh a -> TriangularP pack lo Arbitrary up sh a Source #
identityOrder :: (Quadratic pack property lower upper, C sh, Floating a) => Order -> sh -> Quadratic pack property lower upper sh a Source #
diagonal :: (UpLo lo up, C sh, Floating a) => Order -> Vector sh a -> Triangular lo Arbitrary up sh a Source #
takeDiagonal :: (PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) => TriangularP pack lo diag up sh a -> Vector sh a Source #
transpose :: (PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) => TriangularP pack lo diag up sh a -> TriangularP pack up diag lo sh a Source #
adjoint :: (PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) => TriangularP pack lo diag up sh a -> TriangularP pack up diag lo sh a Source #
stackLower :: (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 Source #
(#%%%) :: (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 infixl 2 Source #
stackUpper :: (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 Source #
(%%%#) :: (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 infixr 2 Source #
splitLower :: (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) Source #
splitUpper :: (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) Source #
takeTopLeft :: (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 Source #
takeTopRight :: (Packing pack, TriDiag diag, C sh0, C sh1, Floating a) => FlexUpperP pack diag (sh0 ::+ sh1) a -> General sh0 sh1 a Source #
takeBottomLeft :: (Packing pack, TriDiag diag, C sh0, C sh1, Floating a) => FlexLowerP pack diag (sh0 ::+ sh1) a -> General sh1 sh0 a Source #
takeBottomRight :: (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 Source #
pack :: (Packing pack, UpLo lo up, TriDiag diag, C sh, Floating a) => TriangularP pack lo diag up sh a -> Triangular lo diag up sh a Source #
toSquare :: (PowerStrip lo, PowerStrip up, TriDiag diag, C sh, Floating a) => TriangularP pack lo diag up sh a -> Square sh a Source #
takeLower :: (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 Source #
takeUpper :: (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 Source #
fromLowerRowMajor :: (C sh, Floating a) => Array (Triangular Lower sh) a -> Lower sh a Source #
toLowerRowMajor :: (C sh, Floating a) => Lower sh a -> Array (Triangular Lower sh) a Source #
fromUpperRowMajor :: (C sh, Floating a) => Array (Triangular Upper sh) a -> Upper sh a Source #
toUpperRowMajor :: (C sh, Floating a) => Upper sh a -> Array (Triangular Upper sh) a Source #
forceOrder :: (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 Source #
adaptOrder :: (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 Source #
adaptOrder x y
contains the data of y
with the layout of x
.
add :: (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 Source #
sub :: (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 Source #
multiplyVector :: (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 Source #
square :: (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 Source #
multiply :: (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 Source #
multiplyFull :: (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 Source #
solve :: (Packing pack, UpLo lo up, TriDiag diag, Measure meas, C vert, C horiz, C sh, Eq sh, C nrhs, Floating a) => TriangularP pack lo diag up sh a -> Full meas vert horiz sh nrhs a -> Full meas vert horiz sh nrhs a Source #
inverse :: (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 Source #
determinant :: (Packing pack, UpLo lo up, TriDiag diag, C sh, Floating a) => TriangularP pack lo diag up sh a -> a Source #
eigenvalues :: (Packing pack, DiagUpLo lo up, C sh, Floating a) => TriangularP pack lo diag up sh a -> Vector sh a Source #
eigensystem :: (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) Source #
(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 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.