Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Synopsis
- leastSquares :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Array (i, j) a -> Array i a -> Array j a
- decompose :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Array (i, j) a -> ([Reflection i a], Upper i j a)
- solve :: (Ix i, Ix j, Fractional a) => ([Reflection i a], Upper i j a) -> Array i a -> Array j a
- det :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Array (i, j) a -> a
- detAbs :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Array (i, j) a -> a
- data Reflection i a
- reflectMatrix :: (Ix i, Ix j, Num a) => Reflection i a -> Array (i, j) a -> Array (i, j) a
- reflectVector :: (Ix i, Num a) => Reflection i a -> Array i a -> Array i a
- data Upper i j a
- matrixFromUpper :: (Ix i, Ix j, Num a) => Upper i j a -> Array (i, j) a
- solveUpper :: (Ix i, Ix j, Fractional a) => Upper i j a -> Array i a -> Array j a
- detUpper :: (Ix i, Ix j, Fractional a) => Upper i j a -> a
Documentation
leastSquares :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Array (i, j) a -> Array i a -> Array j a Source #
Solve an 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.
solve :: (Ix i, Ix j, Fractional a) => ([Reflection i a], Upper i j a) -> Array i a -> Array j a Source #
det :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Array (i, j) a -> a Source #
Only sensible for square matrices, but the function does not check whether the matrix is square.
For non-square matrices the sign is not of much use. It depends on the implementation. It is not uniquely defined by requiring that the determinant of the orthogonal transformation has positive sign.
detAbs :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Array (i, j) a -> a Source #
Absolute value of the determinant. This is also sound for non-square matrices.
data Reflection i a Source #
reflectMatrix :: (Ix i, Ix j, Num a) => Reflection i a -> Array (i, j) a -> Array (i, j) a Source #
reflectVector :: (Ix i, Num a) => Reflection i a -> Array i a -> Array i a Source #
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.