summaryrefslogtreecommitdiff
path: root/packages/hmatrix/src/Numeric/GSL/Vector.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/hmatrix/src/Numeric/GSL/Vector.hs')
-rw-r--r--packages/hmatrix/src/Numeric/GSL/Vector.hs32
1 files changed, 1 insertions, 31 deletions
diff --git a/packages/hmatrix/src/Numeric/GSL/Vector.hs b/packages/hmatrix/src/Numeric/GSL/Vector.hs
index 38c138b..27db6ae 100644
--- a/packages/hmatrix/src/Numeric/GSL/Vector.hs
+++ b/packages/hmatrix/src/Numeric/GSL/Vector.hs
@@ -27,7 +27,7 @@ import Numeric.GSL.Internal hiding (TV,TM,TCV,TCM)
27import Numeric.Vectorized( 27import Numeric.Vectorized(
28 sumF, sumR, sumQ, sumC, 28 sumF, sumR, sumQ, sumC,
29 prodF, prodR, prodQ, prodC, 29 prodF, prodR, prodQ, prodC,
30 FunCodeS(..), 30 FunCodeS(..), toScalarR, toScalarF, toScalarC, toScalarQ,
31 FunCodeV(..), 31 FunCodeV(..),
32 FunCodeSV(..), 32 FunCodeSV(..),
33 FunCodeVV(..) 33 FunCodeVV(..)
@@ -46,11 +46,6 @@ fromei x = fromIntegral (fromEnum x) :: CInt
46 46
47------------------------------------------------------------------ 47------------------------------------------------------------------
48 48
49toScalarAux fun code v = unsafePerformIO $ do
50 r <- createVector 1
51 app2 (fun (fromei code)) vec v vec r "toScalarAux"
52 return (r @> 0)
53
54vectorMapAux fun code v = unsafePerformIO $ do 49vectorMapAux fun code v = unsafePerformIO $ do
55 r <- createVector (dim v) 50 r <- createVector (dim v)
56 app2 (fun (fromei code)) vec v vec r "vectorMapAux" 51 app2 (fun (fromei code)) vec v vec r "vectorMapAux"
@@ -70,31 +65,6 @@ vectorZipAux fun code u v = unsafePerformIO $ do
70 65
71--------------------------------------------------------------------- 66---------------------------------------------------------------------
72 67
73-- | obtains different functions of a vector: norm1, norm2, max, min, posmax, posmin, etc.
74toScalarR :: FunCodeS -> Vector Double -> Double
75toScalarR oper = toScalarAux c_toScalarR (fromei oper)
76
77foreign import ccall unsafe "gsl-aux.h toScalarR" c_toScalarR :: CInt -> TVV
78
79-- | obtains different functions of a vector: norm1, norm2, max, min, posmax, posmin, etc.
80toScalarF :: FunCodeS -> Vector Float -> Float
81toScalarF oper = toScalarAux c_toScalarF (fromei oper)
82
83foreign import ccall unsafe "gsl-aux.h toScalarF" c_toScalarF :: CInt -> TFF
84
85-- | obtains different functions of a vector: only norm1, norm2
86toScalarC :: FunCodeS -> Vector (Complex Double) -> Double
87toScalarC oper = toScalarAux c_toScalarC (fromei oper)
88
89foreign import ccall unsafe "gsl-aux.h toScalarC" c_toScalarC :: CInt -> TCVV
90
91-- | obtains different functions of a vector: only norm1, norm2
92toScalarQ :: FunCodeS -> Vector (Complex Float) -> Float
93toScalarQ oper = toScalarAux c_toScalarQ (fromei oper)
94
95foreign import ccall unsafe "gsl-aux.h toScalarQ" c_toScalarQ :: CInt -> TQVF
96
97------------------------------------------------------------------
98 68
99-- | map of real vectors with given function 69-- | map of real vectors with given function
100vectorMapR :: FunCodeV -> Vector Double -> Vector Double 70vectorMapR :: FunCodeV -> Vector Double -> Vector Double