From d14515a4a50d5b5335f9c1525432b68ab67fa7c8 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Fri, 14 Sep 2007 18:23:20 +0000 Subject: more refactoring --- lib/Data/Packed/Matrix.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Data/Packed/Matrix.hs') diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs index 01e8133..fc08ce4 100644 --- a/lib/Data/Packed/Matrix.hs +++ b/lib/Data/Packed/Matrix.hs @@ -75,12 +75,12 @@ diagRect s r c | r == c = diag s | r < c = trans $ diagRect s c r | r > c = joinVert [diag s , zeros (r-c,c)] - where zeros (r,c) = reshape c $ constant 0 (r*c) + where zeros (r,c) = reshape c $ constantD 0 (r*c) takeDiag :: (Field t) => Matrix t -> Vector t takeDiag m = fromList [cdat m `at` (k*cols m+k) | k <- [0 .. min (rows m) (cols m) -1]] -ident :: (Num t, Field t) => Int -> Matrix t +ident :: Int -> Matrix Double ident n = diag (constant 1 n) ------------------------------------------------------------ -- cgit v1.2.3