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/Trig.hs | |
parent | b1b908c10ad7a393200651b4b23fc0b26efbc1b9 (diff) |
more automatic wrappers for simple special functions
Diffstat (limited to 'lib/GSL/Special/Trig.hs')
-rw-r--r-- | lib/GSL/Special/Trig.hs | 162 |
1 files changed, 162 insertions, 0 deletions
diff --git a/lib/GSL/Special/Trig.hs b/lib/GSL/Special/Trig.hs new file mode 100644 index 0000000..56d3933 --- /dev/null +++ b/lib/GSL/Special/Trig.hs | |||
@@ -0,0 +1,162 @@ | |||
1 | ------------------------------------------------------------ | ||
2 | {- | | ||
3 | Module : GSL.Special.Trig | ||
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.Trig( | ||
16 | sin_e | ||
17 | , GSL.Special.Trig.sin | ||
18 | , cos_e | ||
19 | , GSL.Special.Trig.cos | ||
20 | , hypot_e | ||
21 | , hypot | ||
22 | , sinc_e | ||
23 | , sinc | ||
24 | , lnsinh_e | ||
25 | , lnsinh | ||
26 | , lncosh_e | ||
27 | , lncosh | ||
28 | , sin_err_e | ||
29 | , cos_err_e | ||
30 | , angle_restrict_symm | ||
31 | , angle_restrict_pos | ||
32 | , angle_restrict_symm_err_e | ||
33 | , angle_restrict_pos_err_e | ||
34 | ) where | ||
35 | |||
36 | import Foreign(Ptr) | ||
37 | import GSL.Special.Internal | ||
38 | |||
39 | -- | wrapper for int gsl_sf_sin_e(double x,gsl_sf_result* result); | ||
40 | sin_e :: Double -> (Double,Double) | ||
41 | sin_e x = createSFR "sin_e" $ gsl_sf_sin_e x | ||
42 | foreign import ccall "trig.h gsl_sf_sin_e" gsl_sf_sin_e :: Double -> Ptr Double -> IO(Int) | ||
43 | |||
44 | -- | wrapper for double gsl_sf_sin(double x); | ||
45 | sin :: Double -> Double | ||
46 | sin = gsl_sf_sin | ||
47 | foreign import ccall "trig.h gsl_sf_sin" gsl_sf_sin :: Double -> Double | ||
48 | |||
49 | -- | wrapper for int gsl_sf_cos_e(double x,gsl_sf_result* result); | ||
50 | cos_e :: Double -> (Double,Double) | ||
51 | cos_e x = createSFR "cos_e" $ gsl_sf_cos_e x | ||
52 | foreign import ccall "trig.h gsl_sf_cos_e" gsl_sf_cos_e :: Double -> Ptr Double -> IO(Int) | ||
53 | |||
54 | -- | wrapper for double gsl_sf_cos(double x); | ||
55 | cos :: Double -> Double | ||
56 | cos = gsl_sf_cos | ||
57 | foreign import ccall "trig.h gsl_sf_cos" gsl_sf_cos :: Double -> Double | ||
58 | |||
59 | -- | wrapper for int gsl_sf_hypot_e(double x,double y,gsl_sf_result* result); | ||
60 | hypot_e :: Double -> Double -> (Double,Double) | ||
61 | hypot_e x y = createSFR "hypot_e" $ gsl_sf_hypot_e x y | ||
62 | foreign import ccall "trig.h gsl_sf_hypot_e" gsl_sf_hypot_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
63 | |||
64 | -- | wrapper for double gsl_sf_hypot(double x,double y); | ||
65 | hypot :: Double -> Double -> Double | ||
66 | hypot = gsl_sf_hypot | ||
67 | foreign import ccall "trig.h gsl_sf_hypot" gsl_sf_hypot :: Double -> Double -> Double | ||
68 | |||
69 | -- | wrapper for int gsl_sf_complex_sin_e(double zr,double zi,gsl_sf_result* szr,gsl_sf_result* szi); | ||
70 | complex_sin_e :: Double -> Double -> Ptr Double -> (Double,Double) | ||
71 | complex_sin_e zr zi szr = createSFR "complex_sin_e" $ gsl_sf_complex_sin_e zr zi szr | ||
72 | foreign import ccall "trig.h gsl_sf_complex_sin_e" gsl_sf_complex_sin_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
73 | |||
74 | -- | wrapper for int gsl_sf_complex_cos_e(double zr,double zi,gsl_sf_result* czr,gsl_sf_result* czi); | ||
75 | complex_cos_e :: Double -> Double -> Ptr Double -> (Double,Double) | ||
76 | complex_cos_e zr zi czr = createSFR "complex_cos_e" $ gsl_sf_complex_cos_e zr zi czr | ||
77 | foreign import ccall "trig.h gsl_sf_complex_cos_e" gsl_sf_complex_cos_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
78 | |||
79 | -- | wrapper for int gsl_sf_complex_logsin_e(double zr,double zi,gsl_sf_result* lszr,gsl_sf_result* lszi); | ||
80 | complex_logsin_e :: Double -> Double -> Ptr Double -> (Double,Double) | ||
81 | complex_logsin_e zr zi lszr = createSFR "complex_logsin_e" $ gsl_sf_complex_logsin_e zr zi lszr | ||
82 | foreign import ccall "trig.h gsl_sf_complex_logsin_e" gsl_sf_complex_logsin_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
83 | |||
84 | -- | wrapper for int gsl_sf_sinc_e(double x,gsl_sf_result* result); | ||
85 | sinc_e :: Double -> (Double,Double) | ||
86 | sinc_e x = createSFR "sinc_e" $ gsl_sf_sinc_e x | ||
87 | foreign import ccall "trig.h gsl_sf_sinc_e" gsl_sf_sinc_e :: Double -> Ptr Double -> IO(Int) | ||
88 | |||
89 | -- | wrapper for double gsl_sf_sinc(double x); | ||
90 | sinc :: Double -> Double | ||
91 | sinc = gsl_sf_sinc | ||
92 | foreign import ccall "trig.h gsl_sf_sinc" gsl_sf_sinc :: Double -> Double | ||
93 | |||
94 | -- | wrapper for int gsl_sf_lnsinh_e(double x,gsl_sf_result* result); | ||
95 | lnsinh_e :: Double -> (Double,Double) | ||
96 | lnsinh_e x = createSFR "lnsinh_e" $ gsl_sf_lnsinh_e x | ||
97 | foreign import ccall "trig.h gsl_sf_lnsinh_e" gsl_sf_lnsinh_e :: Double -> Ptr Double -> IO(Int) | ||
98 | |||
99 | -- | wrapper for double gsl_sf_lnsinh(double x); | ||
100 | lnsinh :: Double -> Double | ||
101 | lnsinh = gsl_sf_lnsinh | ||
102 | foreign import ccall "trig.h gsl_sf_lnsinh" gsl_sf_lnsinh :: Double -> Double | ||
103 | |||
104 | -- | wrapper for int gsl_sf_lncosh_e(double x,gsl_sf_result* result); | ||
105 | lncosh_e :: Double -> (Double,Double) | ||
106 | lncosh_e x = createSFR "lncosh_e" $ gsl_sf_lncosh_e x | ||
107 | foreign import ccall "trig.h gsl_sf_lncosh_e" gsl_sf_lncosh_e :: Double -> Ptr Double -> IO(Int) | ||
108 | |||
109 | -- | wrapper for double gsl_sf_lncosh(double x); | ||
110 | lncosh :: Double -> Double | ||
111 | lncosh = gsl_sf_lncosh | ||
112 | foreign import ccall "trig.h gsl_sf_lncosh" gsl_sf_lncosh :: Double -> Double | ||
113 | |||
114 | -- | wrapper for int gsl_sf_polar_to_rect(double r,double theta,gsl_sf_result* x,gsl_sf_result* y); | ||
115 | polar_to_rect :: Double -> Double -> Ptr Double -> (Double,Double) | ||
116 | polar_to_rect r theta x = createSFR "polar_to_rect" $ gsl_sf_polar_to_rect r theta x | ||
117 | foreign import ccall "trig.h gsl_sf_polar_to_rect" gsl_sf_polar_to_rect :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
118 | |||
119 | -- | wrapper for int gsl_sf_rect_to_polar(double x,double y,gsl_sf_result* r,gsl_sf_result* theta); | ||
120 | rect_to_polar :: Double -> Double -> Ptr Double -> (Double,Double) | ||
121 | rect_to_polar x y r = createSFR "rect_to_polar" $ gsl_sf_rect_to_polar x y r | ||
122 | foreign import ccall "trig.h gsl_sf_rect_to_polar" gsl_sf_rect_to_polar :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
123 | |||
124 | -- | wrapper for int gsl_sf_sin_err_e(double x,double dx,gsl_sf_result* result); | ||
125 | sin_err_e :: Double -> Double -> (Double,Double) | ||
126 | sin_err_e x dx = createSFR "sin_err_e" $ gsl_sf_sin_err_e x dx | ||
127 | foreign import ccall "trig.h gsl_sf_sin_err_e" gsl_sf_sin_err_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
128 | |||
129 | -- | wrapper for int gsl_sf_cos_err_e(double x,double dx,gsl_sf_result* result); | ||
130 | cos_err_e :: Double -> Double -> (Double,Double) | ||
131 | cos_err_e x dx = createSFR "cos_err_e" $ gsl_sf_cos_err_e x dx | ||
132 | foreign import ccall "trig.h gsl_sf_cos_err_e" gsl_sf_cos_err_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
133 | |||
134 | -- | wrapper for int gsl_sf_angle_restrict_symm_e(double* theta); | ||
135 | angle_restrict_symm_e :: Ptr Double -> Int | ||
136 | angle_restrict_symm_e = gsl_sf_angle_restrict_symm_e | ||
137 | foreign import ccall "trig.h gsl_sf_angle_restrict_symm_e" gsl_sf_angle_restrict_symm_e :: Ptr Double -> Int | ||
138 | |||
139 | -- | wrapper for double gsl_sf_angle_restrict_symm(double theta); | ||
140 | angle_restrict_symm :: Double -> Double | ||
141 | angle_restrict_symm = gsl_sf_angle_restrict_symm | ||
142 | foreign import ccall "trig.h gsl_sf_angle_restrict_symm" gsl_sf_angle_restrict_symm :: Double -> Double | ||
143 | |||
144 | -- | wrapper for int gsl_sf_angle_restrict_pos_e(double* theta); | ||
145 | angle_restrict_pos_e :: Ptr Double -> Int | ||
146 | angle_restrict_pos_e = gsl_sf_angle_restrict_pos_e | ||
147 | foreign import ccall "trig.h gsl_sf_angle_restrict_pos_e" gsl_sf_angle_restrict_pos_e :: Ptr Double -> Int | ||
148 | |||
149 | -- | wrapper for double gsl_sf_angle_restrict_pos(double theta); | ||
150 | angle_restrict_pos :: Double -> Double | ||
151 | angle_restrict_pos = gsl_sf_angle_restrict_pos | ||
152 | foreign import ccall "trig.h gsl_sf_angle_restrict_pos" gsl_sf_angle_restrict_pos :: Double -> Double | ||
153 | |||
154 | -- | wrapper for int gsl_sf_angle_restrict_symm_err_e(double theta,gsl_sf_result* result); | ||
155 | angle_restrict_symm_err_e :: Double -> (Double,Double) | ||
156 | angle_restrict_symm_err_e theta = createSFR "angle_restrict_symm_err_e" $ gsl_sf_angle_restrict_symm_err_e theta | ||
157 | foreign import ccall "trig.h gsl_sf_angle_restrict_symm_err_e" gsl_sf_angle_restrict_symm_err_e :: Double -> Ptr Double -> IO(Int) | ||
158 | |||
159 | -- | wrapper for int gsl_sf_angle_restrict_pos_err_e(double theta,gsl_sf_result* result); | ||
160 | angle_restrict_pos_err_e :: Double -> (Double,Double) | ||
161 | angle_restrict_pos_err_e theta = createSFR "angle_restrict_pos_err_e" $ gsl_sf_angle_restrict_pos_err_e theta | ||
162 | foreign import ccall "trig.h gsl_sf_angle_restrict_pos_err_e" gsl_sf_angle_restrict_pos_err_e :: Double -> Ptr Double -> IO(Int) | ||