diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-07-29 15:43:21 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-07-29 15:43:21 +0000 |
commit | b9db4d25d87cd4ab0f493413db92fb41b7eacda9 (patch) | |
tree | a447fe6f7e16b3768e912064a033ce257040720e /lib/GSL/Special/Log.hs | |
parent | b1b908c10ad7a393200651b4b23fc0b26efbc1b9 (diff) |
more automatic wrappers for simple special functions
Diffstat (limited to 'lib/GSL/Special/Log.hs')
-rw-r--r-- | lib/GSL/Special/Log.hs | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/lib/GSL/Special/Log.hs b/lib/GSL/Special/Log.hs new file mode 100644 index 0000000..9fd51a8 --- /dev/null +++ b/lib/GSL/Special/Log.hs | |||
@@ -0,0 +1,72 @@ | |||
1 | ------------------------------------------------------------ | ||
2 | {- | | ||
3 | Module : GSL.Special.Log | ||
4 | Copyright : (c) Alberto Ruiz 2006 | ||
5 | License : GPL-style | ||
6 | Maintainer : Alberto Ruiz (aruiz at um dot es) | ||
7 | Stability : provisional | ||
8 | Portability : uses ffi | ||
9 | |||
10 | |||
11 | |||
12 | -} | ||
13 | ------------------------------------------------------------ | ||
14 | |||
15 | module GSL.Special.Log( | ||
16 | log_e | ||
17 | , GSL.Special.Log.log | ||
18 | , log_abs_e | ||
19 | , log_abs | ||
20 | , log_1plusx_e | ||
21 | , log_1plusx | ||
22 | , log_1plusx_mx_e | ||
23 | , log_1plusx_mx | ||
24 | ) where | ||
25 | |||
26 | import Foreign(Ptr) | ||
27 | import GSL.Special.Internal | ||
28 | |||
29 | -- | wrapper for int gsl_sf_log_e(double x,gsl_sf_result* result); | ||
30 | log_e :: Double -> (Double,Double) | ||
31 | log_e x = createSFR "log_e" $ gsl_sf_log_e x | ||
32 | foreign import ccall "log.h gsl_sf_log_e" gsl_sf_log_e :: Double -> Ptr Double -> IO(Int) | ||
33 | |||
34 | -- | wrapper for double gsl_sf_log(double x); | ||
35 | log :: Double -> Double | ||
36 | log = gsl_sf_log | ||
37 | foreign import ccall "log.h gsl_sf_log" gsl_sf_log :: Double -> Double | ||
38 | |||
39 | -- | wrapper for int gsl_sf_log_abs_e(double x,gsl_sf_result* result); | ||
40 | log_abs_e :: Double -> (Double,Double) | ||
41 | log_abs_e x = createSFR "log_abs_e" $ gsl_sf_log_abs_e x | ||
42 | foreign import ccall "log.h gsl_sf_log_abs_e" gsl_sf_log_abs_e :: Double -> Ptr Double -> IO(Int) | ||
43 | |||
44 | -- | wrapper for double gsl_sf_log_abs(double x); | ||
45 | log_abs :: Double -> Double | ||
46 | log_abs = gsl_sf_log_abs | ||
47 | foreign import ccall "log.h gsl_sf_log_abs" gsl_sf_log_abs :: Double -> Double | ||
48 | |||
49 | -- | wrapper for int gsl_sf_complex_log_e(double zr,double zi,gsl_sf_result* lnr,gsl_sf_result* theta); | ||
50 | complex_log_e :: Double -> Double -> Ptr Double -> (Double,Double) | ||
51 | complex_log_e zr zi lnr = createSFR "complex_log_e" $ gsl_sf_complex_log_e zr zi lnr | ||
52 | foreign import ccall "log.h gsl_sf_complex_log_e" gsl_sf_complex_log_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
53 | |||
54 | -- | wrapper for int gsl_sf_log_1plusx_e(double x,gsl_sf_result* result); | ||
55 | log_1plusx_e :: Double -> (Double,Double) | ||
56 | log_1plusx_e x = createSFR "log_1plusx_e" $ gsl_sf_log_1plusx_e x | ||
57 | foreign import ccall "log.h gsl_sf_log_1plusx_e" gsl_sf_log_1plusx_e :: Double -> Ptr Double -> IO(Int) | ||
58 | |||
59 | -- | wrapper for double gsl_sf_log_1plusx(double x); | ||
60 | log_1plusx :: Double -> Double | ||
61 | log_1plusx = gsl_sf_log_1plusx | ||
62 | foreign import ccall "log.h gsl_sf_log_1plusx" gsl_sf_log_1plusx :: Double -> Double | ||
63 | |||
64 | -- | wrapper for int gsl_sf_log_1plusx_mx_e(double x,gsl_sf_result* result); | ||
65 | log_1plusx_mx_e :: Double -> (Double,Double) | ||
66 | log_1plusx_mx_e x = createSFR "log_1plusx_mx_e" $ gsl_sf_log_1plusx_mx_e x | ||
67 | foreign import ccall "log.h gsl_sf_log_1plusx_mx_e" gsl_sf_log_1plusx_mx_e :: Double -> Ptr Double -> IO(Int) | ||
68 | |||
69 | -- | wrapper for double gsl_sf_log_1plusx_mx(double x); | ||
70 | log_1plusx_mx :: Double -> Double | ||
71 | log_1plusx_mx = gsl_sf_log_1plusx_mx | ||
72 | foreign import ccall "log.h gsl_sf_log_1plusx_mx" gsl_sf_log_1plusx_mx :: Double -> Double | ||