summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL/Vector.hs
diff options
context:
space:
mode:
authorVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-06-29 09:03:19 +0000
committerVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-06-29 09:03:19 +0000
commit4957cff8af91cbb23c12382e25f5373fe96acb95 (patch)
tree2f2968d5ca88f7d76e208982b8938c4dfc46ce8a /lib/Numeric/GSL/Vector.hs
parentd18a86d37d55a39d4ec9b16397dd59f35aa13688 (diff)
add-vector-float
Diffstat (limited to 'lib/Numeric/GSL/Vector.hs')
-rw-r--r--lib/Numeric/GSL/Vector.hs32
1 files changed, 28 insertions, 4 deletions
diff --git a/lib/Numeric/GSL/Vector.hs b/lib/Numeric/GSL/Vector.hs
index 28c3b06..d09323b 100644
--- a/lib/Numeric/GSL/Vector.hs
+++ b/lib/Numeric/GSL/Vector.hs
@@ -14,10 +14,10 @@
14----------------------------------------------------------------------------- 14-----------------------------------------------------------------------------
15 15
16module Numeric.GSL.Vector ( 16module Numeric.GSL.Vector (
17 FunCodeS(..), toScalarR, 17 FunCodeS(..), toScalarR, toScalarF,
18 FunCodeV(..), vectorMapR, vectorMapC, 18 FunCodeV(..), vectorMapR, vectorMapC, vectorMapF,
19 FunCodeSV(..), vectorMapValR, vectorMapValC, 19 FunCodeSV(..), vectorMapValR, vectorMapValC, vectorMapValF,
20 FunCodeVV(..), vectorZipR, vectorZipC, 20 FunCodeVV(..), vectorZipR, vectorZipC, vectorZipF,
21 RandDist(..), randomVector 21 RandDist(..), randomVector
22) where 22) where
23 23
@@ -106,6 +106,12 @@ toScalarR oper = toScalarAux c_toScalarR (fromei oper)
106 106
107foreign import ccall safe "gsl-aux.h toScalarR" c_toScalarR :: CInt -> TVV 107foreign import ccall safe "gsl-aux.h toScalarR" c_toScalarR :: CInt -> TVV
108 108
109-- | obtains different functions of a vector: norm1, norm2, max, min, posmax, posmin, etc.
110toScalarF :: FunCodeS -> Vector Float -> Float
111toScalarF oper = toScalarAux c_toScalarF (fromei oper)
112
113foreign import ccall safe "gsl-aux.h toScalarF" c_toScalarF :: CInt -> TFF
114
109------------------------------------------------------------------ 115------------------------------------------------------------------
110 116
111-- | map of real vectors with given function 117-- | map of real vectors with given function
@@ -120,6 +126,12 @@ vectorMapC oper = vectorMapAux c_vectorMapC (fromei oper)
120 126
121foreign import ccall safe "gsl-aux.h mapC" c_vectorMapC :: CInt -> TCVCV 127foreign import ccall safe "gsl-aux.h mapC" c_vectorMapC :: CInt -> TCVCV
122 128
129-- | map of real vectors with given function
130vectorMapF :: FunCodeV -> Vector Float -> Vector Float
131vectorMapF = vectorMapAux c_vectorMapF
132
133foreign import ccall safe "gsl-aux.h mapF" c_vectorMapF :: CInt -> TFF
134
123------------------------------------------------------------------- 135-------------------------------------------------------------------
124 136
125-- | map of real vectors with given function 137-- | map of real vectors with given function
@@ -134,6 +146,12 @@ vectorMapValC = vectorMapValAux c_vectorMapValC
134 146
135foreign import ccall safe "gsl-aux.h mapValC" c_vectorMapValC :: CInt -> Ptr (Complex Double) -> TCVCV 147foreign import ccall safe "gsl-aux.h mapValC" c_vectorMapValC :: CInt -> Ptr (Complex Double) -> TCVCV
136 148
149-- | map of real vectors with given function
150vectorMapValF :: FunCodeSV -> Float -> Vector Float -> Vector Float
151vectorMapValF oper = vectorMapValAux c_vectorMapValF (fromei oper)
152
153foreign import ccall safe "gsl-aux.h mapValF" c_vectorMapValF :: CInt -> Ptr Float -> TFF
154
137------------------------------------------------------------------- 155-------------------------------------------------------------------
138 156
139-- | elementwise operation on real vectors 157-- | elementwise operation on real vectors
@@ -148,6 +166,12 @@ vectorZipC = vectorZipAux c_vectorZipC
148 166
149foreign import ccall safe "gsl-aux.h zipC" c_vectorZipC :: CInt -> TCVCVCV 167foreign import ccall safe "gsl-aux.h zipC" c_vectorZipC :: CInt -> TCVCVCV
150 168
169-- | elementwise operation on real vectors
170vectorZipF :: FunCodeVV -> Vector Float -> Vector Float -> Vector Float
171vectorZipF = vectorZipAux c_vectorZipF
172
173foreign import ccall safe "gsl-aux.h zipF" c_vectorZipF :: CInt -> TFFF
174
151----------------------------------------------------------------------- 175-----------------------------------------------------------------------
152 176
153data RandDist = Uniform -- ^ uniform distribution in [0,1) 177data RandDist = Uniform -- ^ uniform distribution in [0,1)