From 6859c5712a85950b5bc3de3fe8352f4592bc273b Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sat, 11 Sep 2010 11:10:33 +0000 Subject: added generic konst --- lib/Numeric/LinearAlgebra/Algorithms.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/Numeric/LinearAlgebra') diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs index 6e703fa..5bc9ca5 100644 --- a/lib/Numeric/LinearAlgebra/Algorithms.hs +++ b/lib/Numeric/LinearAlgebra/Algorithms.hs @@ -83,8 +83,6 @@ import Data.List(foldl1') import Data.Array import Numeric.Container -constant x = constantD x - -- | Auxiliary typeclass used to define generic computations for both real and complex matrices. class (Product t, Container Vector t, Container Matrix t) => Field t where svd' :: Matrix t -> (Matrix t, Vector Double, Matrix t) @@ -469,7 +467,7 @@ zh k v = fromList $ replicate (k-1) 0 ++ (1:drop k xs) where xs = toList v zt 0 v = v -zt k v = join [subVector 0 (dim v - k) v, constant 0 k] +zt k v = join [subVector 0 (dim v - k) v, konst 0 k] unpackQR :: (Field t) => (Matrix t, Vector t) -> (Matrix t, Matrix t) @@ -623,10 +621,10 @@ luFact (l_u,perm) | r <= c = (l ,u ,p, s) c = cols l_u tu = triang r c 0 1 tl = triang r c 0 0 - l = takeColumns r (l_u |*| tl) |+| diagRect (constant 1 r) r r + l = takeColumns r (l_u |*| tl) |+| diagRect (konst 1 r) r r u = l_u |*| tu (p,s) = fixPerm r perm - l' = (l_u |*| tl) |+| diagRect (constant 1 c) r c + l' = (l_u |*| tl) |+| diagRect (konst 1 c) r c u' = takeRows c (l_u |*| tu) (|+|) = add (|*|) = mul -- cgit v1.2.3