summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--THANKS3
-rw-r--r--hmatrix.cabal2
-rw-r--r--lib/Data/Packed/Internal/Vector.hs10
3 files changed, 14 insertions, 1 deletions
diff --git a/THANKS b/THANKS
index bd7782c..083495b 100644
--- a/THANKS
+++ b/THANKS
@@ -85,3 +85,6 @@ module reorganization, monadic mapVectorM, and many other improvements.
85 85
86- Stefan Kersten fixed hmatrix.cabal for 64-bit ghc-7 in OS/X 86- Stefan Kersten fixed hmatrix.cabal for 64-bit ghc-7 in OS/X
87 87
88- Sacha Sokoloski reported an installation problem on Arch Linux and
89 helped with the configuration.
90
diff --git a/hmatrix.cabal b/hmatrix.cabal
index 1ff4ec2..b92cdd0 100644
--- a/hmatrix.cabal
+++ b/hmatrix.cabal
@@ -1,5 +1,5 @@
1Name: hmatrix 1Name: hmatrix
2Version: 0.11.0.1 2Version: 0.11.0.2
3License: GPL 3License: GPL
4License-file: LICENSE 4License-file: LICENSE
5Author: Alberto Ruiz 5Author: Alberto Ruiz
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs
index b68d16a..078cb36 100644
--- a/lib/Data/Packed/Internal/Vector.hs
+++ b/lib/Data/Packed/Internal/Vector.hs
@@ -201,12 +201,21 @@ subVector :: Storable t => Int -- ^ index of the starting element
201 201
202subVector = Vector.slice 202subVector = Vector.slice
203 203
204{-
205subVector k l v
206 | k<0 || k >= n || k+l > n || l < 0 = error "subVector out of range"
207 | otherwise = unsafeFromForeignPtr fp (i+k) l
208 where
209 (fp, i, n) = unsafeToForeignPtr v
210-}
211
204#else 212#else
205 213
206subVector k l v@V{idim = n, ioff = i} 214subVector k l v@V{idim = n, ioff = i}
207 | k<0 || k >= n || k+l > n || l < 0 = error "subVector out of range" 215 | k<0 || k >= n || k+l > n || l < 0 = error "subVector out of range"
208 | otherwise = v {idim = l, ioff = i+k} 216 | otherwise = v {idim = l, ioff = i+k}
209 217
218{-
210subVectorCopy k l (v@V {idim=n}) 219subVectorCopy k l (v@V {idim=n})
211 | k<0 || k >= n || k+l > n || l < 0 = error "subVector out of range" 220 | k<0 || k >= n || k+l > n || l < 0 = error "subVector out of range"
212 | otherwise = unsafePerformIO $ do 221 | otherwise = unsafePerformIO $ do
@@ -214,6 +223,7 @@ subVectorCopy k l (v@V {idim=n})
214 let f _ s _ d = copyArray d (advancePtr s k) l >> return 0 223 let f _ s _ d = copyArray d (advancePtr s k) l >> return 0
215 app2 f vec v vec r "subVector" 224 app2 f vec v vec r "subVector"
216 return r 225 return r
226-}
217 227
218#endif 228#endif
219 229