diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-09-20 17:08:34 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-09-20 17:08:34 +0000 |
commit | 05908719a7323110ba1955038d8341a8b7483351 (patch) | |
tree | f1f1fe28a8db64675dacc7eb4ec79d36e8174588 /lib/Numeric/LinearAlgebra/Algorithms.hs | |
parent | 482b533c3fbfcd75d6c5c1d3ce32585bf9fc2ad7 (diff) |
generalized diagRect
Diffstat (limited to 'lib/Numeric/LinearAlgebra/Algorithms.hs')
-rw-r--r-- | lib/Numeric/LinearAlgebra/Algorithms.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs index 4f6f54d..394a1d7 100644 --- a/lib/Numeric/LinearAlgebra/Algorithms.hs +++ b/lib/Numeric/LinearAlgebra/Algorithms.hs | |||
@@ -183,7 +183,7 @@ singularValues = {-# SCC "singularValues" #-} sv' | |||
183 | fullSVD :: Field t => Matrix t -> (Matrix t, Matrix Double, Matrix t) | 183 | fullSVD :: Field t => Matrix t -> (Matrix t, Matrix Double, Matrix t) |
184 | fullSVD m = (u,d,v) where | 184 | fullSVD m = (u,d,v) where |
185 | (u,s,v) = svd m | 185 | (u,s,v) = svd m |
186 | d = diagRect s r c | 186 | d = diagRect 0 s r c |
187 | r = rows m | 187 | r = rows m |
188 | c = cols m | 188 | c = cols m |
189 | 189 | ||
@@ -210,7 +210,7 @@ leftSV m | vertical m = let (u,s,_) = svd m in (u,s) | |||
210 | {-# DEPRECATED full "use fullSVD instead" #-} | 210 | {-# DEPRECATED full "use fullSVD instead" #-} |
211 | full svdFun m = (u, d ,v) where | 211 | full svdFun m = (u, d ,v) where |
212 | (u,s,v) = svdFun m | 212 | (u,s,v) = svdFun m |
213 | d = diagRect s r c | 213 | d = diagRect 0 s r c |
214 | r = rows m | 214 | r = rows m |
215 | c = cols m | 215 | c = cols m |
216 | 216 | ||
@@ -624,10 +624,10 @@ luFact (l_u,perm) | r <= c = (l ,u ,p, s) | |||
624 | c = cols l_u | 624 | c = cols l_u |
625 | tu = triang r c 0 1 | 625 | tu = triang r c 0 1 |
626 | tl = triang r c 0 0 | 626 | tl = triang r c 0 0 |
627 | l = takeColumns r (l_u |*| tl) |+| diagRect (konst 1 r) r r | 627 | l = takeColumns r (l_u |*| tl) |+| diagRect 0 (konst 1 r) r r |
628 | u = l_u |*| tu | 628 | u = l_u |*| tu |
629 | (p,s) = fixPerm r perm | 629 | (p,s) = fixPerm r perm |
630 | l' = (l_u |*| tl) |+| diagRect (konst 1 c) r c | 630 | l' = (l_u |*| tl) |+| diagRect 0 (konst 1 c) r c |
631 | u' = takeRows c (l_u |*| tu) | 631 | u' = takeRows c (l_u |*| tu) |
632 | (|+|) = add | 632 | (|+|) = add |
633 | (|*|) = mul | 633 | (|*|) = mul |