summaryrefslogtreecommitdiff
path: root/packages/base/src/Numeric
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Numeric')
-rw-r--r--packages/base/src/Numeric/LinearAlgebra/Data.hs1
-rw-r--r--packages/base/src/Numeric/Vectorized.hs12
2 files changed, 12 insertions, 1 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/Data.hs b/packages/base/src/Numeric/LinearAlgebra/Data.hs
index 4e4868a..5099445 100644
--- a/packages/base/src/Numeric/LinearAlgebra/Data.hs
+++ b/packages/base/src/Numeric/LinearAlgebra/Data.hs
@@ -47,6 +47,7 @@ module Numeric.LinearAlgebra.Data(
47 47
48 -- * Find elements 48 -- * Find elements
49 find, maxIndex, minIndex, maxElement, minElement, atIndex, 49 find, maxIndex, minIndex, maxElement, minElement, atIndex,
50 sortVector,
50 51
51 -- * Sparse 52 -- * Sparse
52 AssocMatrix, toDense, 53 AssocMatrix, toDense,
diff --git a/packages/base/src/Numeric/Vectorized.hs b/packages/base/src/Numeric/Vectorized.hs
index 5aebb14..82504a9 100644
--- a/packages/base/src/Numeric/Vectorized.hs
+++ b/packages/base/src/Numeric/Vectorized.hs
@@ -18,7 +18,8 @@ module Numeric.Vectorized (
18 FunCodeSV(..), vectorMapValR, vectorMapValC, vectorMapValF, vectorMapValQ, 18 FunCodeSV(..), vectorMapValR, vectorMapValC, vectorMapValF, vectorMapValQ,
19 FunCodeVV(..), vectorZipR, vectorZipC, vectorZipF, vectorZipQ, 19 FunCodeVV(..), vectorZipR, vectorZipC, vectorZipF, vectorZipQ,
20 vectorScan, saveMatrix, 20 vectorScan, saveMatrix,
21 Seed, RandDist(..), randomVector 21 Seed, RandDist(..), randomVector,
22 sortVector
22) where 23) where
23 24
24import Data.Packed.Internal.Common 25import Data.Packed.Internal.Common
@@ -344,3 +345,12 @@ randomVector seed dist n = unsafePerformIO $ do
344 345
345foreign import ccall unsafe "random_vector" c_random_vector :: CInt -> CInt -> TV 346foreign import ccall unsafe "random_vector" c_random_vector :: CInt -> CInt -> TV
346 347
348--------------------------------------------------------------------------------
349
350sortVector v = unsafePerformIO $ do
351 r <- createVector (dim v)
352 app2 c_sort_values vec v vec r "sortVector"
353 return r
354
355foreign import ccall unsafe "sort_values" c_sort_values :: TVV
356