diff options
Diffstat (limited to 'packages/hmatrix/src/Numeric/GSL/Vector.hs')
-rw-r--r-- | packages/hmatrix/src/Numeric/GSL/Vector.hs | 32 |
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) | |||
27 | import Numeric.Vectorized( | 27 | import 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 | ||
49 | toScalarAux fun code v = unsafePerformIO $ do | ||
50 | r <- createVector 1 | ||
51 | app2 (fun (fromei code)) vec v vec r "toScalarAux" | ||
52 | return (r @> 0) | ||
53 | |||
54 | vectorMapAux fun code v = unsafePerformIO $ do | 49 | vectorMapAux 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. | ||
74 | toScalarR :: FunCodeS -> Vector Double -> Double | ||
75 | toScalarR oper = toScalarAux c_toScalarR (fromei oper) | ||
76 | |||
77 | foreign 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. | ||
80 | toScalarF :: FunCodeS -> Vector Float -> Float | ||
81 | toScalarF oper = toScalarAux c_toScalarF (fromei oper) | ||
82 | |||
83 | foreign import ccall unsafe "gsl-aux.h toScalarF" c_toScalarF :: CInt -> TFF | ||
84 | |||
85 | -- | obtains different functions of a vector: only norm1, norm2 | ||
86 | toScalarC :: FunCodeS -> Vector (Complex Double) -> Double | ||
87 | toScalarC oper = toScalarAux c_toScalarC (fromei oper) | ||
88 | |||
89 | foreign import ccall unsafe "gsl-aux.h toScalarC" c_toScalarC :: CInt -> TCVV | ||
90 | |||
91 | -- | obtains different functions of a vector: only norm1, norm2 | ||
92 | toScalarQ :: FunCodeS -> Vector (Complex Float) -> Float | ||
93 | toScalarQ oper = toScalarAux c_toScalarQ (fromei oper) | ||
94 | |||
95 | foreign 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 |
100 | vectorMapR :: FunCodeV -> Vector Double -> Vector Double | 70 | vectorMapR :: FunCodeV -> Vector Double -> Vector Double |