summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Algorithms.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal/Algorithms.hs')
-rw-r--r--packages/base/src/Internal/Algorithms.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/base/src/Internal/Algorithms.hs b/packages/base/src/Internal/Algorithms.hs
index f5bddc6..aa51792 100644
--- a/packages/base/src/Internal/Algorithms.hs
+++ b/packages/base/src/Internal/Algorithms.hs
@@ -39,6 +39,7 @@ import qualified Data.Vector.Storable as Vector
39import Internal.ST 39import Internal.ST
40import Internal.Vectorized(range) 40import Internal.Vectorized(range)
41import Control.DeepSeq 41import Control.DeepSeq
42import Foreign.Storable
42 43
43{- | Generic linear algebra functions for double precision real and complex matrices. 44{- | Generic linear algebra functions for double precision real and complex matrices.
44 45
@@ -742,7 +743,7 @@ pinvTol t m = v' `mXm` diag s' `mXm` ctrans u' where
742 743
743 744
744-- | Numeric rank of a matrix from the SVD decomposition. 745-- | Numeric rank of a matrix from the SVD decomposition.
745rankSVD :: Element t 746rankSVD :: Storable t
746 => Double -- ^ numeric zero (e.g. 1*'eps') 747 => Double -- ^ numeric zero (e.g. 1*'eps')
747 -> Matrix t -- ^ input matrix m 748 -> Matrix t -- ^ input matrix m
748 -> Vector Double -- ^ 'sv' of m 749 -> Vector Double -- ^ 'sv' of m
@@ -1003,7 +1004,7 @@ fixPerm' s = res $ mutable f s0
1003 s0 = reshape 1 (range (length s)) 1004 s0 = reshape 1 (range (length s))
1004 res = flatten . fst 1005 res = flatten . fst
1005 swap m i j = rowOper (SWAP i j AllCols) m 1006 swap m i j = rowOper (SWAP i j AllCols) m
1006 f :: (Num t, Element t) => (Int, Int) -> STMatrix s t -> ST s () -- needed because of TypeFamilies 1007 f :: (Num t, Storable t) => (Int, Int) -> STMatrix s t -> ST s () -- needed because of TypeFamilies
1007 f _ p = sequence_ $ zipWith (swap p) [0..] s 1008 f _ p = sequence_ $ zipWith (swap p) [0..] s
1008 1009
1009triang r c h v = (r><c) [el s t | s<-[0..r-1], t<-[0..c-1]] 1010triang r c h v = (r><c) [el s t | s<-[0..r-1], t<-[0..c-1]]