lapack-0.5.1: Numerical Linear Algebra using LAPACK

Safe HaskellNone
LanguageHaskell98

Numeric.LAPACK.Matrix.Triangular

Synopsis

Documentation

type Triangular lo diag up sh = TriangularP Packed lo diag up sh Source #

type UpLo lo up = (UpLoC lo up, UpLoC up lo) Source #

type FlexUpper diag sh = Quadratic Packed diag Empty Filled sh Source #

type FlexLower diag sh = Quadratic Packed diag Filled Empty sh Source #

size :: TriangularP pack lo diag up sh a -> 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 #

lowerFromList :: (C sh, Storable a) => Order -> sh -> [a] -> Lower sh a Source #

upperFromList :: (C sh, Storable a) => Order -> sh -> [a] -> Upper sh a Source #

asLower :: Id (FlexLowerP pack diag sh a) Source #

asUpper :: Id (FlexUpperP pack diag sh 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 #

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.