lapack-0.3.0.1: Numerical Linear Algebra using LAPACK

Safe HaskellNone
LanguageHaskell98

Numeric.LAPACK.Matrix.Triangular

Synopsis

Documentation

type Triangular lo diag up sh = ArrayMatrix (Triangular lo diag up sh) Source #

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

type FlexDiagonal diag sh = ArrayMatrix (Triangular Empty diag Empty sh) Source #

type FlexUpper diag sh = ArrayMatrix (UpperTriangular diag sh) Source #

type FlexLower diag sh = ArrayMatrix (LowerTriangular diag sh) Source #

type FlexSymmetric diag sh = ArrayMatrix (FlexSymmetric diag sh) Source #

size :: Triangular lo diag up sh a -> sh Source #

fromList :: (Content lo, Content up, C sh, Storable a) => Order -> sh -> [a] -> Triangular lo NonUnit up sh a Source #

diagonalFromList :: (C sh, Storable a) => Order -> sh -> [a] -> Diagonal sh 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 #

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

asDiagonal :: FlexDiagonal diag sh a -> FlexDiagonal diag sh a Source #

asLower :: FlexLower diag sh a -> FlexLower diag sh a Source #

asUpper :: FlexUpper diag sh a -> FlexUpper diag sh a Source #

asSymmetric :: FlexSymmetric diag sh a -> FlexSymmetric diag sh a Source #

relaxUnitDiagonal :: TriDiag diag => Triangular lo Unit up sh a -> Triangular lo diag up sh a Source #

strictNonUnitDiagonal :: TriDiag diag => Triangular lo diag up sh a -> Triangular lo NonUnit up sh a Source #

identity :: (Content lo, Content up, C sh, Floating a) => Order -> sh -> Triangular lo Unit up sh a Source #

diagonal :: (Content lo, Content up, C sh, Floating a) => Order -> Vector sh a -> Triangular lo NonUnit up sh a Source #

takeDiagonal :: (Content lo, Content up, C sh, Floating a) => Triangular lo diag up sh a -> Vector sh a Source #

transpose :: (Content lo, Content up, TriDiag diag) => Triangular lo diag up sh a -> Triangular up diag lo sh a Source #

adjoint :: (Content lo, Content up, TriDiag diag, C sh, Floating a) => Triangular lo diag up sh a -> Triangular up diag lo sh a Source #

stackDiagonal :: (TriDiag diag, C sh0, C sh1, Floating a) => FlexDiagonal diag sh0 a -> FlexDiagonal diag sh1 a -> FlexDiagonal diag (sh0 :+: sh1) a Source #

(%%%) :: (TriDiag diag, C sh0, C sh1, Floating a) => FlexDiagonal diag sh0 a -> FlexDiagonal diag sh1 a -> FlexDiagonal diag (sh0 :+: sh1) a infixr 2 Source #

stackLower :: (TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1, Floating a) => FlexLower diag sh0 a -> General sh1 sh0 a -> FlexLower diag sh1 a -> FlexLower diag (sh0 :+: sh1) a Source #

(#%%%) :: (TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1, Floating a) => FlexLower diag sh0 a -> (General sh1 sh0 a, FlexLower diag sh1 a) -> FlexLower diag (sh0 :+: sh1) a infixl 2 Source #

stackUpper :: (TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1, Floating a) => FlexUpper diag sh0 a -> General sh0 sh1 a -> FlexUpper diag sh1 a -> FlexUpper diag (sh0 :+: sh1) a Source #

(%%%#) :: (TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1, Floating a) => (FlexUpper diag sh0 a, General sh0 sh1 a) -> FlexUpper diag sh1 a -> FlexUpper diag (sh0 :+: sh1) a infixr 2 Source #

stackSymmetric :: (TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1, Floating a) => FlexSymmetric diag sh0 a -> General sh0 sh1 a -> FlexSymmetric diag sh1 a -> FlexSymmetric diag (sh0 :+: sh1) a Source #

(#%%%#) :: (TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1, Floating a) => (FlexSymmetric diag sh0 a, General sh0 sh1 a) -> FlexSymmetric diag sh1 a -> FlexSymmetric diag (sh0 :+: sh1) a infixr 2 Source #

splitDiagonal :: (TriDiag diag, C sh0, C sh1, Floating a) => FlexDiagonal diag (sh0 :+: sh1) a -> (FlexDiagonal diag sh0 a, FlexDiagonal diag sh1 a) Source #

splitLower :: (TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1, Floating a) => FlexLower diag (sh0 :+: sh1) a -> (FlexLower diag sh0 a, General sh1 sh0 a, FlexLower diag sh1 a) Source #

splitUpper :: (TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1, Floating a) => FlexUpper diag (sh0 :+: sh1) a -> (FlexUpper diag sh0 a, General sh0 sh1 a, FlexUpper diag sh1 a) Source #

splitSymmetric :: (TriDiag diag, C sh0, Eq sh0, C sh1, Eq sh1, Floating a) => FlexSymmetric diag (sh0 :+: sh1) a -> (FlexSymmetric diag sh0 a, General sh0 sh1 a, FlexSymmetric diag sh1 a) Source #

takeTopLeft :: (Content lo, TriDiag diag, Content up, C sh0, C sh1, Floating a) => Triangular lo diag up (sh0 :+: sh1) a -> Triangular lo diag up sh0 a Source #

takeTopRight :: (Content lo, TriDiag diag, C sh0, C sh1, Floating a) => Triangular lo diag Filled (sh0 :+: sh1) a -> General sh0 sh1 a Source #

takeBottomLeft :: (TriDiag diag, Content up, C sh0, C sh1, Floating a) => Triangular Filled diag up (sh0 :+: sh1) a -> General sh1 sh0 a Source #

takeBottomRight :: (Content lo, TriDiag diag, Content up, C sh0, C sh1, Floating a) => Triangular lo diag up (sh0 :+: sh1) a -> Triangular lo diag up sh1 a Source #

toSquare :: (Content lo, Content up, C sh, Floating a) => Triangular lo diag up sh a -> Square sh a Source #

takeLower :: (C horiz, C height, C width, Floating a) => Full Small horiz height width a -> Lower height a Source #

takeUpper :: (C vert, C height, C width, Floating a) => Full vert Small height width a -> Upper width a Source #

forceOrder :: (Content lo, Content up, TriDiag diag, C sh, Floating a) => Order -> Triangular lo diag up sh a -> Triangular lo diag up sh a Source #

adaptOrder :: (Content lo, Content up, TriDiag diag, C sh, Floating a) => Triangular lo diag up sh a -> Triangular lo diag up sh a -> Triangular lo diag up sh a Source #

adaptOrder x y contains the data of y with the layout of x.

add :: (Content lo, Content up, Eq lo, Eq up, Eq sh, C sh, Floating a) => Triangular lo NonUnit up sh a -> Triangular lo NonUnit up sh a -> Triangular lo NonUnit up sh a Source #

sub :: (Content lo, Content up, Eq lo, Eq up, Eq sh, C sh, Floating a) => Triangular lo NonUnit up sh a -> Triangular lo NonUnit up sh a -> Triangular lo NonUnit up sh a Source #

type family PowerDiag lo up diag Source #

type PowerContentDiag lo diag up = (Content lo, Content up, TriDiag diag, PowerDiag lo up diag ~ diag, PowerDiag up lo diag ~ diag) Source #

multiplyVector :: (Content lo, Content up, TriDiag diag, C sh, Eq sh, Floating a) => Triangular lo diag up sh a -> Vector sh a -> Vector sh a Source #

square :: (Content lo, Content up, TriDiag diag, C sh, Eq sh, Floating a) => Triangular lo diag up sh a -> Triangular lo (PowerDiag lo up diag) up sh a Source #

Include symmetric matrices. However, symmetric matrices do not preserve unit diagonals.

multiply :: (DiagUpLo lo up, TriDiag diag, C sh, Eq sh, Floating a) => Triangular lo diag up sh a -> Triangular lo diag up sh a -> Triangular lo diag up sh a Source #

multiplyFull :: (Content lo, Content up, TriDiag diag, C vert, C horiz, C height, Eq height, C width, Floating a) => Triangular lo diag up height a -> Full vert horiz height width a -> Full vert horiz height width a Source #

solve :: (Content lo, Content up, TriDiag diag, C vert, C horiz, C sh, Eq sh, C nrhs, Floating a) => Triangular lo diag up sh a -> Full vert horiz sh nrhs a -> Full vert horiz sh nrhs a Source #

inverse :: (Content lo, Content up, TriDiag diag, C sh, Floating a) => Triangular lo diag up sh a -> Triangular lo (PowerDiag lo up diag) up sh a Source #

determinant :: (Content lo, Content up, TriDiag diag, C sh, Floating a) => Triangular lo diag up sh a -> a Source #

eigenvalues :: (DiagUpLo lo up, C sh, Floating a) => Triangular lo diag up sh a -> Vector sh a Source #

eigensystem :: (DiagUpLo lo up, C sh, Floating a) => Triangular lo NonUnit up sh a -> (Triangular lo NonUnit up sh a, Vector sh a, Triangular lo NonUnit 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.