Safe Haskell | Safe |
---|---|

Language | Haskell98 |

## Synopsis

- leastSquares :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Matrix i j a -> Array i a -> Array j a
- decompose :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Matrix i j a -> ([Rotation i a], Upper i j a)
- solve :: (Ix i, Ix j, Fractional a) => ([Rotation i a], Upper i j a) -> Array i a -> Array j a
- det :: (Ix i, Enum i, Ix j, Enum j, RealFloat a) => Matrix i j a -> a
- data Rotation i a
- rotateVector :: (Ix i, Num a) => Rotation i a -> Array i a -> Array i a
- data Upper 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) => 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.

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 #

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.