summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwchresta <>2018-10-16 15:32:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-10-16 15:32:00 (GMT)
commitf8f1bf723d153b700e7d7665d3c614b90f6de8cd (patch)
treed8442177ab98edd3a59d48c385ca65c438a70f53
parentf5c53743927461cfab97fea298349120a3a4d850 (diff)
version 0.20.2
-rw-r--r--ChangeLog.md3
-rw-r--r--matrix-static.cabal4
-rw-r--r--src/Data/Matrix/Static.hs16
3 files changed, 13 insertions, 10 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
index d2c4fc1..1c81ce9 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,6 @@
+# Version 0.2 - 16.10.2018
+* Fix bug with the types of splitBlocks (Incompatible change)
+
# Version 0.1.1 - 15.10.2018
* Dropped `semigroup` dependency
diff --git a/matrix-static.cabal b/matrix-static.cabal
index d0cba31..04c0b09 100644
--- a/matrix-static.cabal
+++ b/matrix-static.cabal
@@ -4,10 +4,10 @@ cabal-version: >= 1.10
--
-- see: https://github.com/sol/hpack
--
--- hash: c553d9deb8496047a0389a6bf184d757be92bf8fe4336cb0330d82ba02327fb5
+-- hash: 71d0aad7acb4b2fc1986bb9cd9d7f4a861b968f85193c2244ea95a1f321a1e34
name: matrix-static
-version: 0.1.1
+version: 0.2
synopsis: Type-safe matrix operations
description: Please see the README on GitHub at <https://github.com/wchresta/matrix-static#readme>
category: Math
diff --git a/src/Data/Matrix/Static.hs b/src/Data/Matrix/Static.hs
index ecca204..e003907 100644
--- a/src/Data/Matrix/Static.hs
+++ b/src/Data/Matrix/Static.hs
@@ -857,17 +857,17 @@ minorMatrix = applyUnary $ M.minorMatrix delCol delRow
-- no way to have a type safe variant of this functon where the pivot element
-- is given at run-time.
--
-splitBlocks :: forall i j m n a.
- (KnownNat i, KnownNat j, 1 <= i, i+1 <= m, 1 <= j, j+1 <= n)
- => Matrix m n a -- ^ Matrix to split.
- -> ( Matrix i j a, Matrix i (n-j) a
- , Matrix (n-i) j a, Matrix (m-i) (n-j) a
+splitBlocks :: forall mt nl mb nr a.
+ (KnownNat mt, KnownNat nl, 1 <= mt, 1 <= mb, 1 <= nl, 1 <= nr)
+ => Matrix (mt+mb) (nl+nr) a -- ^ Matrix to split.
+ -> ( Matrix mt nl a, Matrix mt nr a
+ , Matrix mb nl a, Matrix mb nr a
) -- ^ (TL,TR,BL,BR)
{-# INLINE[1] splitBlocks #-}
splitBlocks mat =
- let i = fromInteger $ natVal @i Proxy
- j = fromInteger $ natVal @j Proxy
- (x,y,z,w) = M.splitBlocks i j $ unpackStatic mat
+ let mt = fromInteger $ natVal @mt Proxy
+ nl = fromInteger $ natVal @nl Proxy
+ (x,y,z,w) = M.splitBlocks mt nl $ unpackStatic mat
in (Matrix x, Matrix y, Matrix z, Matrix w)