summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Matrix.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2015-07-03 14:39:29 +0200
committerAlberto Ruiz <aruiz@um.es>2015-07-03 14:39:29 +0200
commit04acd2ad79f7fddb1e6fa9029638378ac9fa8a66 (patch)
treeb55ec5a35cea858857e3ebf27b5c50b0f743ce28 /packages/base/src/Internal/Matrix.hs
parent0bdc40ca822e1b80089080da3fe03d0e31e7d927 (diff)
fix subMatrix tot and test
Diffstat (limited to 'packages/base/src/Internal/Matrix.hs')
-rw-r--r--packages/base/src/Internal/Matrix.hs1
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
367subMatrix (r0,c0) (rt,ct) m 367subMatrix (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