summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Matrix.hs
diff options
context:
space:
mode:
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