diff options
-rw-r--r-- | THANKS | 3 | ||||
-rw-r--r-- | hmatrix.cabal | 2 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 10 |
3 files changed, 14 insertions, 1 deletions
@@ -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 @@ | |||
1 | Name: hmatrix | 1 | Name: hmatrix |
2 | Version: 0.11.0.1 | 2 | Version: 0.11.0.2 |
3 | License: GPL | 3 | License: GPL |
4 | License-file: LICENSE | 4 | License-file: LICENSE |
5 | Author: Alberto Ruiz | 5 | Author: 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 | ||
202 | subVector = Vector.slice | 202 | subVector = Vector.slice |
203 | 203 | ||
204 | {- | ||
205 | subVector 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 | ||
206 | subVector k l v@V{idim = n, ioff = i} | 214 | subVector 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 | {- | ||
210 | subVectorCopy k l (v@V {idim=n}) | 219 | subVectorCopy 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 | ||