diff options
author | Alberto Ruiz <aruiz@um.es> | 2015-07-03 14:39:29 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2015-07-03 14:39:29 +0200 |
commit | 04acd2ad79f7fddb1e6fa9029638378ac9fa8a66 (patch) | |
tree | b55ec5a35cea858857e3ebf27b5c50b0f743ce28 /packages/base/src/Internal/Matrix.hs | |
parent | 0bdc40ca822e1b80089080da3fe03d0e31e7d927 (diff) |
fix subMatrix tot and test
Diffstat (limited to 'packages/base/src/Internal/Matrix.hs')
-rw-r--r-- | packages/base/src/Internal/Matrix.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/packages/base/src/Internal/Matrix.hs b/packages/base/src/Internal/Matrix.hs index a7fcb47..792fe35 100644 --- a/packages/base/src/Internal/Matrix.hs +++ b/packages/base/src/Internal/Matrix.hs | |||
@@ -365,6 +365,7 @@ subMatrix :: Element a | |||
365 | -> Matrix a -- ^ input matrix | 365 | -> Matrix a -- ^ input matrix |
366 | -> Matrix a -- ^ result | 366 | -> Matrix a -- ^ result |
367 | subMatrix (r0,c0) (rt,ct) m | 367 | subMatrix (r0,c0) (rt,ct) m |
368 | | rt <= 0 || ct <= 0 = matrixFromVector RowMajor (max 0 rt) (max 0 ct) (fromList []) | ||
368 | | 0 <= r0 && 0 <= rt && r0+rt <= rows m && | 369 | | 0 <= r0 && 0 <= rt && r0+rt <= rows m && |
369 | 0 <= c0 && 0 <= ct && c0+ct <= cols m = res | 370 | 0 <= c0 && 0 <= ct && c0+ct <= cols m = res |
370 | | otherwise = error $ "wrong subMatrix "++show ((r0,c0),(rt,ct))++" of "++shSize m | 371 | | otherwise = error $ "wrong subMatrix "++show ((r0,c0),(rt,ct))++" of "++shSize m |