diff options
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Algorithms.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Algorithms.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs index 435cc5a..9ae5e32 100644 --- a/lib/Numeric/LinearAlgebra/Algorithms.hs +++ b/lib/Numeric/LinearAlgebra/Algorithms.hs | |||
@@ -64,6 +64,7 @@ module Numeric.LinearAlgebra.Algorithms ( | |||
64 | nullspacePrec, | 64 | nullspacePrec, |
65 | nullVector, | 65 | nullVector, |
66 | nullspaceSVD, | 66 | nullspaceSVD, |
67 | orth, | ||
67 | -- * Norms | 68 | -- * Norms |
68 | Normed(..), NormType(..), | 69 | Normed(..), NormType(..), |
69 | relativeError, | 70 | relativeError, |
@@ -445,6 +446,13 @@ nullspacePrec t m = nullspaceSVD (Left (t*eps)) m (rightSV m) | |||
445 | nullVector :: Field t => Matrix t -> Vector t | 446 | nullVector :: Field t => Matrix t -> Vector t |
446 | nullVector = last . nullspacePrec 1 | 447 | nullVector = last . nullspacePrec 1 |
447 | 448 | ||
449 | orth :: Field t => Matrix t -> [Vector t] | ||
450 | -- ^ Return an orthonormal basis of the range space of a matrix | ||
451 | orth m = take r $ toColumns u | ||
452 | where | ||
453 | (u,s,_) = compactSVD m | ||
454 | r = ranksv eps (max (rows m) (cols m)) (toList s) | ||
455 | |||
448 | ------------------------------------------------------------------------ | 456 | ------------------------------------------------------------------------ |
449 | 457 | ||
450 | {- Pseudoinverse of a real matrix with the desired tolerance, expressed as a | 458 | {- Pseudoinverse of a real matrix with the desired tolerance, expressed as a |