From 8325e1a676a1a8e253e6915d62630145051aee11 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Tue, 10 Jun 2014 16:50:19 +0200 Subject: sortVector --- packages/base/src/Numeric/Vectorized.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'packages/base/src/Numeric/Vectorized.hs') 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 ( FunCodeSV(..), vectorMapValR, vectorMapValC, vectorMapValF, vectorMapValQ, FunCodeVV(..), vectorZipR, vectorZipC, vectorZipF, vectorZipQ, vectorScan, saveMatrix, - Seed, RandDist(..), randomVector + Seed, RandDist(..), randomVector, + sortVector ) where import Data.Packed.Internal.Common @@ -344,3 +345,12 @@ randomVector seed dist n = unsafePerformIO $ do foreign import ccall unsafe "random_vector" c_random_vector :: CInt -> CInt -> TV +-------------------------------------------------------------------------------- + +sortVector v = unsafePerformIO $ do + r <- createVector (dim v) + app2 c_sort_values vec v vec r "sortVector" + return r + +foreign import ccall unsafe "sort_values" c_sort_values :: TVV + -- cgit v1.2.3