From 225901798773228e73b4c98670d56e844c040b3d Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sun, 7 Sep 2014 14:25:07 +0200 Subject: fix diagRectR/C (eye), check zero cols in in gmat(fromList-matrix), and thanks --- packages/base/src/Numeric/LinearAlgebra/Static/Internal.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/base/src/Numeric/LinearAlgebra/Static') diff --git a/packages/base/src/Numeric/LinearAlgebra/Static/Internal.hs b/packages/base/src/Numeric/LinearAlgebra/Static/Internal.hs index 339ef7d..ec02cf6 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Static/Internal.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Static/Internal.hs @@ -150,7 +150,7 @@ gmat st xs' (xs,rest) = splitAt (m'*n') xs' v = LA.fromList xs x = reshape n' v - ok = rem (LA.size v) n' == 0 && LA.size x == (m',n') && null rest + ok = null rest && ((n' == 0 && dim v == 0) || n'> 0 && (rem (LA.size v) n' == 0) && LA.size x == (m',n')) m' = fromIntegral . natVal $ (undefined :: Proxy m) :: Int n' = fromIntegral . natVal $ (undefined :: Proxy n) :: Int abort info = error $ st ++" "++show m' ++ " " ++ show n'++" can't be created from elements " ++ info -- cgit v1.2.3