diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-05-22 17:53:40 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-05-22 17:53:40 +0200 |
commit | 4b74d1b1f7c46a4b3907838bee11f669060d3a23 (patch) | |
tree | 20c9cb2a082841de6e3d2f5345ec9344e8f2b014 /src/Data/Array/Mixed.hs | |
parent | 7e707146d7d275046b4435ae7245ccb3746477ce (diff) |
Fix bug in X.reshapePartial
Thanks Mikolaj!
Diffstat (limited to 'src/Data/Array/Mixed.hs')
-rw-r--r-- | src/Data/Array/Mixed.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Data/Array/Mixed.hs b/src/Data/Array/Mixed.hs index baa9575..9a77ccb 100644 --- a/src/Data/Array/Mixed.hs +++ b/src/Data/Array/Mixed.hs @@ -784,7 +784,7 @@ reshapePartial :: forall sh1 sh2 sh' a. Storable a => StaticShX sh1 -> StaticShX reshapePartial ssh1 ssh' sh2 (XArray arr) | Dict <- lemKnownNatRankSSX (ssxAppend ssh1 ssh') , Dict <- lemKnownNatRankSSX (ssxAppend (staticShapeFrom sh2) ssh') - = XArray (S.reshape (shapeLshape sh2 ++ drop (lengthShX sh2) (S.shapeL arr)) arr) + = XArray (S.reshape (shapeLshape sh2 ++ drop (lengthStaticShX ssh1) (S.shapeL arr)) arr) -- this was benchmarked to be (slightly) faster than S.iota, S.generate and S.fromVector(VS.enumFromTo). iota :: (Enum a, Storable a) => SNat n -> XArray '[Just n] a |