diff options
Diffstat (limited to 'lib/Numeric/GSL/Vector.hs')
-rw-r--r-- | lib/Numeric/GSL/Vector.hs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Numeric/GSL/Vector.hs b/lib/Numeric/GSL/Vector.hs index 65f3a2e..86d8f10 100644 --- a/lib/Numeric/GSL/Vector.hs +++ b/lib/Numeric/GSL/Vector.hs | |||
@@ -73,28 +73,24 @@ data FunCodeS = Norm2 | |||
73 | 73 | ||
74 | toScalarAux fun code v = unsafePerformIO $ do | 74 | toScalarAux fun code v = unsafePerformIO $ do |
75 | r <- createVector 1 | 75 | r <- createVector 1 |
76 | ww2 withVector v withVector r $ \v r -> | 76 | app2 (fun (fromEnum code)) vec v vec r "toScalarAux" |
77 | fun (fromEnum code) // v // r // check "toScalarAux" | ||
78 | return (r `at` 0) | 77 | return (r `at` 0) |
79 | 78 | ||
80 | vectorMapAux fun code v = unsafePerformIO $ do | 79 | vectorMapAux fun code v = unsafePerformIO $ do |
81 | r <- createVector (dim v) | 80 | r <- createVector (dim v) |
82 | ww2 withVector v withVector r $ \v r -> | 81 | app2 (fun (fromEnum code)) vec v vec r "vectorMapAux" |
83 | fun (fromEnum code) // v // r // check "vectorMapAux" | ||
84 | return r | 82 | return r |
85 | 83 | ||
86 | vectorMapValAux fun code val v = unsafePerformIO $ do | 84 | vectorMapValAux fun code val v = unsafePerformIO $ do |
87 | r <- createVector (dim v) | 85 | r <- createVector (dim v) |
88 | pval <- newArray [val] | 86 | pval <- newArray [val] |
89 | ww2 withVector v withVector r $ \v r -> | 87 | app2 (fun (fromEnum code) pval) vec v vec r "vectorMapValAux" |
90 | fun (fromEnum code) pval // v // r // check "vectorMapValAux" | ||
91 | free pval | 88 | free pval |
92 | return r | 89 | return r |
93 | 90 | ||
94 | vectorZipAux fun code u v = unsafePerformIO $ do | 91 | vectorZipAux fun code u v = unsafePerformIO $ do |
95 | r <- createVector (dim u) | 92 | r <- createVector (dim u) |
96 | ww3 withVector u withVector v withVector r $ \u v r -> | 93 | app3 (fun (fromEnum code)) vec u vec v vec r "vectorZipAux" |
97 | fun (fromEnum code) // u // v // r // check "vectorZipAux" | ||
98 | return r | 94 | return r |
99 | 95 | ||
100 | --------------------------------------------------------------------- | 96 | --------------------------------------------------------------------- |