dsp-0.2.5: Haskell Digital Signal Processing

Safe HaskellSafe
LanguageHaskell98

Matrix.QR.Givens

Synopsis

Documentation

leastSquares :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Matrix i j a -> Array i a -> Array j a Source #

Solve a sparse overconstrained linear problem, i.e. minimize ||Ax-b||. A must have dimensions m x n with m>=n and it must have full-rank. None of these conditions is checked.

decompose Source #

Arguments

:: (Ix i, Enum i, Ix j, Enum j, RealFloat a) 
=> Matrix i j a

A

-> ([Rotation i a], Upper i j a)

QR(A)

The decomposition routine is pretty simple. It does not try to minimize fill-up by a clever ordering of rotations. However, for banded matrices it will work as expected.

solve :: (Ix i, Ix j, Fractional a) => ([Rotation i a], Upper i j a) -> Array i a -> Array j a Source #

det :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Matrix i j a -> a Source #

Only sensible for square matrices, but the function does not check whether the matrix is square.

detAbs :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Matrix i j a -> a Source #

Absolute value of the determinant. This is also sound for non-square matrices.

data Rotation i a Source #

Instances
(Show i, Show a) => Show (Rotation i a) Source # 
Instance details

Defined in Matrix.QR.Givens

Methods

showsPrec :: Int -> Rotation i a -> ShowS #

show :: Rotation i a -> String #

showList :: [Rotation i a] -> ShowS #

rotateVector :: (Ix i, Num a) => Rotation i a -> Array i a -> Array i a Source #

data Upper i j a Source #

Instances
(Show i, Show j, Show a) => Show (Upper i j a) Source # 
Instance details

Defined in Matrix.QR.Givens

Methods

showsPrec :: Int -> Upper i j a -> ShowS #

show :: Upper i j a -> String #

showList :: [Upper i j a] -> ShowS #

solveUpper :: (Ix i, Ix j, Fractional a) => Upper i j a -> Array i a -> Array j a Source #

Assumes that Upper matrix is at least as high as wide and that it has full rank.

detUpper :: (Ix i, Ix j, Fractional a) => Upper i j a -> a Source #