From 5ac36ec376104c06a645b211145d75202fec5c22 Mon Sep 17 00:00:00 2001 From: Alex Lang Date: Tue, 23 Sep 2014 20:07:22 -0700 Subject: Fix asRow and asColumn on empty vectors --- packages/base/src/Data/Packed/Matrix.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/base/src/Data/Packed') diff --git a/packages/base/src/Data/Packed/Matrix.hs b/packages/base/src/Data/Packed/Matrix.hs index 6445ce4..067bf76 100644 --- a/packages/base/src/Data/Packed/Matrix.hs +++ b/packages/base/src/Data/Packed/Matrix.hs @@ -284,7 +284,7 @@ fromLists = fromRows . map fromList -- [ 1.0, 2.0, 3.0, 4.0, 5.0 ] -- asRow :: Storable a => Vector a -> Matrix a -asRow v = reshape (dim v) v +asRow = trans . asColumn -- | creates a 1-column matrix from a vector -- @@ -297,7 +297,7 @@ asRow v = reshape (dim v) v -- , 5.0 ] -- asColumn :: Storable a => Vector a -> Matrix a -asColumn = trans . asRow +asColumn v = reshape 1 v -- cgit v1.2.3