summaryrefslogtreecommitdiff
path: root/lib/Data
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-06-08 23:07:45 +0000
committerAlberto Ruiz <aruiz@um.es>2007-06-08 23:07:45 +0000
commite21f42f742959ec9452add9b6c6e08d30d9584ed (patch)
tree25b0fe2e085a021b3d05305c759aa15ab1b17bff /lib/Data
parent8050c64f706c027e0446b892ca64814a174013a4 (diff)
diagRect, svdC
Diffstat (limited to 'lib/Data')
-rw-r--r--lib/Data/Packed/Internal/Matrix.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs
index bd333d4..4383e79 100644
--- a/lib/Data/Packed/Internal/Matrix.hs
+++ b/lib/Data/Packed/Internal/Matrix.hs
@@ -315,3 +315,10 @@ diagG v = reshape c $ fromList $ [ l!!(i-1) * delta k i | k <- [1..c], i <- [1..
315 l = toList v 315 l = toList v
316 delta i j | i==j = 1 316 delta i j | i==j = 1
317 | otherwise = 0 317 | otherwise = 0
318
319diagRect s r c
320 | dim s < min r c = error "diagRect"
321 | r == c = diag s
322 | r < c = joinHoriz [diag s , zeros (r,c-r)]
323 | otherwise = joinVert [diag s , zeros (r-c,c)]
324 where zeros (r,c) = reshape c $ constant (r*c) 0