summaryrefslogtreecommitdiff
path: root/packages/special/lib/Numeric/GSL/Special/Elljac.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2010-02-24 13:23:42 +0000
committerAlberto Ruiz <aruiz@um.es>2010-02-24 13:23:42 +0000
commit54bcc1fc1e0f9676cb10f627f412eeeea34b5d2c (patch)
tree3983a0046ce08a2390c5a495aae60fd419c58986 /packages/special/lib/Numeric/GSL/Special/Elljac.hs
parentaae45de54aca92c5f0f013e46c6d6f65508d76f5 (diff)
created package hmatrix-special
Diffstat (limited to 'packages/special/lib/Numeric/GSL/Special/Elljac.hs')
-rw-r--r--packages/special/lib/Numeric/GSL/Special/Elljac.hs38
1 files changed, 38 insertions, 0 deletions
diff --git a/packages/special/lib/Numeric/GSL/Special/Elljac.hs b/packages/special/lib/Numeric/GSL/Special/Elljac.hs
new file mode 100644
index 0000000..5b32cfe
--- /dev/null
+++ b/packages/special/lib/Numeric/GSL/Special/Elljac.hs
@@ -0,0 +1,38 @@
1------------------------------------------------------------
2-- |
3-- Module : Numeric.GSL.Special.Elljac
4-- Copyright : (c) Alberto Ruiz 2006
5-- License : GPL
6-- Maintainer : Alberto Ruiz (aruiz at um dot es)
7-- Stability : provisional
8-- Portability : uses ffi
9--
10-- Wrappers for selected functions described at:
11--
12-- <http://www.google.com/search?q=gsl_sf_elljac.h&as_sitesearch=www.gnu.org/software/gsl/manual&btnI=Lucky>
13------------------------------------------------------------
14
15module Numeric.GSL.Special.Elljac(
16elljac_e
17) where
18
19import Foreign
20import Foreign.C.Types(CInt)
21
22elljac_e :: Double -> Double -> (Double,Double,Double)
23elljac_e u m = unsafePerformIO $ do
24 psn <- malloc
25 pcn <- malloc
26 pdn <- malloc
27 res <- gsl_sf_elljac_e u m psn pcn pdn
28 sn <- peek psn
29 cn <- peek pcn
30 dn <- peek pdn
31 free psn
32 free pcn
33 free pdn
34 if res == 0 then return (sn,cn,dn)
35 else error $ "error code "++show res++
36 " in elljac_e "++show u++" "++show m
37
38foreign import ccall "gsl_sf_elljac_e" gsl_sf_elljac_e :: Double -> Double -> Ptr Double -> Ptr Double -> Ptr Double -> IO CInt