diff options
author | Alberto Ruiz <aruiz@um.es> | 2014-09-24 09:10:11 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2014-09-24 09:10:11 +0200 |
commit | d594600aebc56830e0d6fb18120c4aeb0fc433c7 (patch) | |
tree | c38449e4dda79f9bf18bcff340646657c6172f6d /packages/base/src/Data/Packed | |
parent | ff746ea0bd8710fd515f87bc764480e8d613be14 (diff) | |
parent | 5ac36ec376104c06a645b211145d75202fec5c22 (diff) |
Merge pull request #89 from alang9/master
Fix asRow and asColumn on empty vectors
Diffstat (limited to 'packages/base/src/Data/Packed')
-rw-r--r-- | packages/base/src/Data/Packed/Matrix.hs | 4 |
1 files changed, 2 insertions, 2 deletions
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 | |||
284 | -- [ 1.0, 2.0, 3.0, 4.0, 5.0 ] | 284 | -- [ 1.0, 2.0, 3.0, 4.0, 5.0 ] |
285 | -- | 285 | -- |
286 | asRow :: Storable a => Vector a -> Matrix a | 286 | asRow :: Storable a => Vector a -> Matrix a |
287 | asRow v = reshape (dim v) v | 287 | asRow = trans . asColumn |
288 | 288 | ||
289 | -- | creates a 1-column matrix from a vector | 289 | -- | creates a 1-column matrix from a vector |
290 | -- | 290 | -- |
@@ -297,7 +297,7 @@ asRow v = reshape (dim v) v | |||
297 | -- , 5.0 ] | 297 | -- , 5.0 ] |
298 | -- | 298 | -- |
299 | asColumn :: Storable a => Vector a -> Matrix a | 299 | asColumn :: Storable a => Vector a -> Matrix a |
300 | asColumn = trans . asRow | 300 | asColumn v = reshape 1 v |
301 | 301 | ||
302 | 302 | ||
303 | 303 | ||