diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-02-24 13:23:42 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-02-24 13:23:42 +0000 |
commit | 54bcc1fc1e0f9676cb10f627f412eeeea34b5d2c (patch) | |
tree | 3983a0046ce08a2390c5a495aae60fd419c58986 /packages/special/lib/Numeric/GSL/Special/Elljac.hs | |
parent | aae45de54aca92c5f0f013e46c6d6f65508d76f5 (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.hs | 38 |
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 | |||
15 | module Numeric.GSL.Special.Elljac( | ||
16 | elljac_e | ||
17 | ) where | ||
18 | |||
19 | import Foreign | ||
20 | import Foreign.C.Types(CInt) | ||
21 | |||
22 | elljac_e :: Double -> Double -> (Double,Double,Double) | ||
23 | elljac_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 | |||
38 | foreign import ccall "gsl_sf_elljac_e" gsl_sf_elljac_e :: Double -> Double -> Ptr Double -> Ptr Double -> Ptr Double -> IO CInt | ||