diff options
Diffstat (limited to 'lib/Data/Packed/Internal')
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index 5a42f9d..772aafd 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs | |||
@@ -166,3 +166,12 @@ updateVector k h (v@V {dim=n}) | |||
166 | >> return 0 | 166 | >> return 0 |
167 | app2 f vec v vec r "updateVector" | 167 | app2 f vec v vec r "updateVector" |
168 | return r | 168 | return r |
169 | |||
170 | ----------------------------------------------------------------- | ||
171 | |||
172 | cloneVector :: Storable t => Vector t -> IO (Vector t) | ||
173 | cloneVector (v@V {dim=n}) = do | ||
174 | r <- createVector n | ||
175 | let f _ s _ d = copyArray d s n >> return 0 | ||
176 | app2 f vec v vec r "cloneVector" | ||
177 | return r | ||