diff options
Diffstat (limited to 'lib/GSL/Special/Gamma.hs')
-rw-r--r-- | lib/GSL/Special/Gamma.hs | 277 |
1 files changed, 277 insertions, 0 deletions
diff --git a/lib/GSL/Special/Gamma.hs b/lib/GSL/Special/Gamma.hs new file mode 100644 index 0000000..4586cb5 --- /dev/null +++ b/lib/GSL/Special/Gamma.hs | |||
@@ -0,0 +1,277 @@ | |||
1 | ------------------------------------------------------------ | ||
2 | {- | | ||
3 | Module : GSL.Special.Gamma | ||
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 | Wrappers for selected functions described at: | ||
11 | |||
12 | <http://www.gnu.org/software/gsl/manual/html_node/Gamma-and-Beta-Functions.html> | ||
13 | |||
14 | |||
15 | -} | ||
16 | ------------------------------------------------------------ | ||
17 | |||
18 | module GSL.Special.Gamma( | ||
19 | lngamma_e | ||
20 | , lngamma | ||
21 | , gamma_e | ||
22 | , gamma | ||
23 | , gammastar_e | ||
24 | , gammastar | ||
25 | , gammainv_e | ||
26 | , gammainv | ||
27 | , taylorcoeff_e | ||
28 | , taylorcoeff | ||
29 | , fact_e | ||
30 | , fact | ||
31 | , doublefact_e | ||
32 | , doublefact | ||
33 | , lnfact_e | ||
34 | , lnfact | ||
35 | , lndoublefact_e | ||
36 | , lndoublefact | ||
37 | , lnchoose_e | ||
38 | , lnchoose | ||
39 | , choose_e | ||
40 | , choose | ||
41 | , lnpoch_e | ||
42 | , lnpoch | ||
43 | , poch_e | ||
44 | , poch | ||
45 | , pochrel_e | ||
46 | , pochrel | ||
47 | , gamma_inc_Q_e | ||
48 | , gamma_inc_Q | ||
49 | , gamma_inc_P_e | ||
50 | , gamma_inc_P | ||
51 | , gamma_inc_e | ||
52 | , gamma_inc | ||
53 | , lnbeta_e | ||
54 | , lnbeta | ||
55 | , beta_e | ||
56 | , beta | ||
57 | , beta_inc_e | ||
58 | , beta_inc | ||
59 | ) where | ||
60 | |||
61 | import Foreign(Ptr) | ||
62 | import GSL.Special.Internal | ||
63 | |||
64 | -- | wrapper for int gsl_sf_lngamma_e(double x,gsl_sf_result* result); | ||
65 | lngamma_e :: Double -> (Double,Double) | ||
66 | lngamma_e x = createSFR "lngamma_e" $ gsl_sf_lngamma_e x | ||
67 | foreign import ccall "gamma.h gsl_sf_lngamma_e" gsl_sf_lngamma_e :: Double -> Ptr Double -> IO(Int) | ||
68 | |||
69 | -- | wrapper for double gsl_sf_lngamma(double x); | ||
70 | lngamma :: Double -> Double | ||
71 | lngamma = gsl_sf_lngamma | ||
72 | foreign import ccall "gamma.h gsl_sf_lngamma" gsl_sf_lngamma :: Double -> Double | ||
73 | |||
74 | -- | wrapper for int gsl_sf_lngamma_sgn_e(double x,gsl_sf_result* result_lg,double* sgn); | ||
75 | lngamma_sgn_e :: Double -> Ptr Double -> Ptr Double -> Int | ||
76 | lngamma_sgn_e = gsl_sf_lngamma_sgn_e | ||
77 | foreign import ccall "gamma.h gsl_sf_lngamma_sgn_e" gsl_sf_lngamma_sgn_e :: Double -> Ptr Double -> Ptr Double -> Int | ||
78 | |||
79 | -- | wrapper for int gsl_sf_gamma_e(double x,gsl_sf_result* result); | ||
80 | gamma_e :: Double -> (Double,Double) | ||
81 | gamma_e x = createSFR "gamma_e" $ gsl_sf_gamma_e x | ||
82 | foreign import ccall "gamma.h gsl_sf_gamma_e" gsl_sf_gamma_e :: Double -> Ptr Double -> IO(Int) | ||
83 | |||
84 | -- | wrapper for double gsl_sf_gamma(double x); | ||
85 | gamma :: Double -> Double | ||
86 | gamma = gsl_sf_gamma | ||
87 | foreign import ccall "gamma.h gsl_sf_gamma" gsl_sf_gamma :: Double -> Double | ||
88 | |||
89 | -- | wrapper for int gsl_sf_gammastar_e(double x,gsl_sf_result* result); | ||
90 | gammastar_e :: Double -> (Double,Double) | ||
91 | gammastar_e x = createSFR "gammastar_e" $ gsl_sf_gammastar_e x | ||
92 | foreign import ccall "gamma.h gsl_sf_gammastar_e" gsl_sf_gammastar_e :: Double -> Ptr Double -> IO(Int) | ||
93 | |||
94 | -- | wrapper for double gsl_sf_gammastar(double x); | ||
95 | gammastar :: Double -> Double | ||
96 | gammastar = gsl_sf_gammastar | ||
97 | foreign import ccall "gamma.h gsl_sf_gammastar" gsl_sf_gammastar :: Double -> Double | ||
98 | |||
99 | -- | wrapper for int gsl_sf_gammainv_e(double x,gsl_sf_result* result); | ||
100 | gammainv_e :: Double -> (Double,Double) | ||
101 | gammainv_e x = createSFR "gammainv_e" $ gsl_sf_gammainv_e x | ||
102 | foreign import ccall "gamma.h gsl_sf_gammainv_e" gsl_sf_gammainv_e :: Double -> Ptr Double -> IO(Int) | ||
103 | |||
104 | -- | wrapper for double gsl_sf_gammainv(double x); | ||
105 | gammainv :: Double -> Double | ||
106 | gammainv = gsl_sf_gammainv | ||
107 | foreign import ccall "gamma.h gsl_sf_gammainv" gsl_sf_gammainv :: Double -> Double | ||
108 | |||
109 | -- | wrapper for int gsl_sf_lngamma_complex_e(double zr,double zi,gsl_sf_result* lnr,gsl_sf_result* arg); | ||
110 | lngamma_complex_e :: Double -> Double -> Ptr Double -> (Double,Double) | ||
111 | lngamma_complex_e zr zi lnr = createSFR "lngamma_complex_e" $ gsl_sf_lngamma_complex_e zr zi lnr | ||
112 | foreign import ccall "gamma.h gsl_sf_lngamma_complex_e" gsl_sf_lngamma_complex_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
113 | |||
114 | -- | wrapper for int gsl_sf_taylorcoeff_e(int n,double x,gsl_sf_result* result); | ||
115 | taylorcoeff_e :: Int -> Double -> (Double,Double) | ||
116 | taylorcoeff_e n x = createSFR "taylorcoeff_e" $ gsl_sf_taylorcoeff_e n x | ||
117 | foreign import ccall "gamma.h gsl_sf_taylorcoeff_e" gsl_sf_taylorcoeff_e :: Int -> Double -> Ptr Double -> IO(Int) | ||
118 | |||
119 | -- | wrapper for double gsl_sf_taylorcoeff(int n,double x); | ||
120 | taylorcoeff :: Int -> Double -> Double | ||
121 | taylorcoeff = gsl_sf_taylorcoeff | ||
122 | foreign import ccall "gamma.h gsl_sf_taylorcoeff" gsl_sf_taylorcoeff :: Int -> Double -> Double | ||
123 | |||
124 | -- | wrapper for int gsl_sf_fact_e(int n,gsl_sf_result* result); | ||
125 | fact_e :: Int -> (Double,Double) | ||
126 | fact_e n = createSFR "fact_e" $ gsl_sf_fact_e n | ||
127 | foreign import ccall "gamma.h gsl_sf_fact_e" gsl_sf_fact_e :: Int -> Ptr Double -> IO(Int) | ||
128 | |||
129 | -- | wrapper for double gsl_sf_fact(int n); | ||
130 | fact :: Int -> Double | ||
131 | fact = gsl_sf_fact | ||
132 | foreign import ccall "gamma.h gsl_sf_fact" gsl_sf_fact :: Int -> Double | ||
133 | |||
134 | -- | wrapper for int gsl_sf_doublefact_e(int n,gsl_sf_result* result); | ||
135 | doublefact_e :: Int -> (Double,Double) | ||
136 | doublefact_e n = createSFR "doublefact_e" $ gsl_sf_doublefact_e n | ||
137 | foreign import ccall "gamma.h gsl_sf_doublefact_e" gsl_sf_doublefact_e :: Int -> Ptr Double -> IO(Int) | ||
138 | |||
139 | -- | wrapper for double gsl_sf_doublefact(int n); | ||
140 | doublefact :: Int -> Double | ||
141 | doublefact = gsl_sf_doublefact | ||
142 | foreign import ccall "gamma.h gsl_sf_doublefact" gsl_sf_doublefact :: Int -> Double | ||
143 | |||
144 | -- | wrapper for int gsl_sf_lnfact_e(int n,gsl_sf_result* result); | ||
145 | lnfact_e :: Int -> (Double,Double) | ||
146 | lnfact_e n = createSFR "lnfact_e" $ gsl_sf_lnfact_e n | ||
147 | foreign import ccall "gamma.h gsl_sf_lnfact_e" gsl_sf_lnfact_e :: Int -> Ptr Double -> IO(Int) | ||
148 | |||
149 | -- | wrapper for double gsl_sf_lnfact(int n); | ||
150 | lnfact :: Int -> Double | ||
151 | lnfact = gsl_sf_lnfact | ||
152 | foreign import ccall "gamma.h gsl_sf_lnfact" gsl_sf_lnfact :: Int -> Double | ||
153 | |||
154 | -- | wrapper for int gsl_sf_lndoublefact_e(int n,gsl_sf_result* result); | ||
155 | lndoublefact_e :: Int -> (Double,Double) | ||
156 | lndoublefact_e n = createSFR "lndoublefact_e" $ gsl_sf_lndoublefact_e n | ||
157 | foreign import ccall "gamma.h gsl_sf_lndoublefact_e" gsl_sf_lndoublefact_e :: Int -> Ptr Double -> IO(Int) | ||
158 | |||
159 | -- | wrapper for double gsl_sf_lndoublefact(int n); | ||
160 | lndoublefact :: Int -> Double | ||
161 | lndoublefact = gsl_sf_lndoublefact | ||
162 | foreign import ccall "gamma.h gsl_sf_lndoublefact" gsl_sf_lndoublefact :: Int -> Double | ||
163 | |||
164 | -- | wrapper for int gsl_sf_lnchoose_e(int n,int m,gsl_sf_result* result); | ||
165 | lnchoose_e :: Int -> Int -> (Double,Double) | ||
166 | lnchoose_e n m = createSFR "lnchoose_e" $ gsl_sf_lnchoose_e n m | ||
167 | foreign import ccall "gamma.h gsl_sf_lnchoose_e" gsl_sf_lnchoose_e :: Int -> Int -> Ptr Double -> IO(Int) | ||
168 | |||
169 | -- | wrapper for double gsl_sf_lnchoose(int n,int m); | ||
170 | lnchoose :: Int -> Int -> Double | ||
171 | lnchoose = gsl_sf_lnchoose | ||
172 | foreign import ccall "gamma.h gsl_sf_lnchoose" gsl_sf_lnchoose :: Int -> Int -> Double | ||
173 | |||
174 | -- | wrapper for int gsl_sf_choose_e(int n,int m,gsl_sf_result* result); | ||
175 | choose_e :: Int -> Int -> (Double,Double) | ||
176 | choose_e n m = createSFR "choose_e" $ gsl_sf_choose_e n m | ||
177 | foreign import ccall "gamma.h gsl_sf_choose_e" gsl_sf_choose_e :: Int -> Int -> Ptr Double -> IO(Int) | ||
178 | |||
179 | -- | wrapper for double gsl_sf_choose(int n,int m); | ||
180 | choose :: Int -> Int -> Double | ||
181 | choose = gsl_sf_choose | ||
182 | foreign import ccall "gamma.h gsl_sf_choose" gsl_sf_choose :: Int -> Int -> Double | ||
183 | |||
184 | -- | wrapper for int gsl_sf_lnpoch_e(double a,double x,gsl_sf_result* result); | ||
185 | lnpoch_e :: Double -> Double -> (Double,Double) | ||
186 | lnpoch_e a x = createSFR "lnpoch_e" $ gsl_sf_lnpoch_e a x | ||
187 | foreign import ccall "gamma.h gsl_sf_lnpoch_e" gsl_sf_lnpoch_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
188 | |||
189 | -- | wrapper for double gsl_sf_lnpoch(double a,double x); | ||
190 | lnpoch :: Double -> Double -> Double | ||
191 | lnpoch = gsl_sf_lnpoch | ||
192 | foreign import ccall "gamma.h gsl_sf_lnpoch" gsl_sf_lnpoch :: Double -> Double -> Double | ||
193 | |||
194 | -- | wrapper for int gsl_sf_lnpoch_sgn_e(double a,double x,gsl_sf_result* result,double* sgn); | ||
195 | lnpoch_sgn_e :: Double -> Double -> Ptr Double -> Ptr Double -> Int | ||
196 | lnpoch_sgn_e = gsl_sf_lnpoch_sgn_e | ||
197 | foreign import ccall "gamma.h gsl_sf_lnpoch_sgn_e" gsl_sf_lnpoch_sgn_e :: Double -> Double -> Ptr Double -> Ptr Double -> Int | ||
198 | |||
199 | -- | wrapper for int gsl_sf_poch_e(double a,double x,gsl_sf_result* result); | ||
200 | poch_e :: Double -> Double -> (Double,Double) | ||
201 | poch_e a x = createSFR "poch_e" $ gsl_sf_poch_e a x | ||
202 | foreign import ccall "gamma.h gsl_sf_poch_e" gsl_sf_poch_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
203 | |||
204 | -- | wrapper for double gsl_sf_poch(double a,double x); | ||
205 | poch :: Double -> Double -> Double | ||
206 | poch = gsl_sf_poch | ||
207 | foreign import ccall "gamma.h gsl_sf_poch" gsl_sf_poch :: Double -> Double -> Double | ||
208 | |||
209 | -- | wrapper for int gsl_sf_pochrel_e(double a,double x,gsl_sf_result* result); | ||
210 | pochrel_e :: Double -> Double -> (Double,Double) | ||
211 | pochrel_e a x = createSFR "pochrel_e" $ gsl_sf_pochrel_e a x | ||
212 | foreign import ccall "gamma.h gsl_sf_pochrel_e" gsl_sf_pochrel_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
213 | |||
214 | -- | wrapper for double gsl_sf_pochrel(double a,double x); | ||
215 | pochrel :: Double -> Double -> Double | ||
216 | pochrel = gsl_sf_pochrel | ||
217 | foreign import ccall "gamma.h gsl_sf_pochrel" gsl_sf_pochrel :: Double -> Double -> Double | ||
218 | |||
219 | -- | wrapper for int gsl_sf_gamma_inc_Q_e(double a,double x,gsl_sf_result* result); | ||
220 | gamma_inc_Q_e :: Double -> Double -> (Double,Double) | ||
221 | gamma_inc_Q_e a x = createSFR "gamma_inc_Q_e" $ gsl_sf_gamma_inc_Q_e a x | ||
222 | foreign import ccall "gamma.h gsl_sf_gamma_inc_Q_e" gsl_sf_gamma_inc_Q_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
223 | |||
224 | -- | wrapper for double gsl_sf_gamma_inc_Q(double a,double x); | ||
225 | gamma_inc_Q :: Double -> Double -> Double | ||
226 | gamma_inc_Q = gsl_sf_gamma_inc_Q | ||
227 | foreign import ccall "gamma.h gsl_sf_gamma_inc_Q" gsl_sf_gamma_inc_Q :: Double -> Double -> Double | ||
228 | |||
229 | -- | wrapper for int gsl_sf_gamma_inc_P_e(double a,double x,gsl_sf_result* result); | ||
230 | gamma_inc_P_e :: Double -> Double -> (Double,Double) | ||
231 | gamma_inc_P_e a x = createSFR "gamma_inc_P_e" $ gsl_sf_gamma_inc_P_e a x | ||
232 | foreign import ccall "gamma.h gsl_sf_gamma_inc_P_e" gsl_sf_gamma_inc_P_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
233 | |||
234 | -- | wrapper for double gsl_sf_gamma_inc_P(double a,double x); | ||
235 | gamma_inc_P :: Double -> Double -> Double | ||
236 | gamma_inc_P = gsl_sf_gamma_inc_P | ||
237 | foreign import ccall "gamma.h gsl_sf_gamma_inc_P" gsl_sf_gamma_inc_P :: Double -> Double -> Double | ||
238 | |||
239 | -- | wrapper for int gsl_sf_gamma_inc_e(double a,double x,gsl_sf_result* result); | ||
240 | gamma_inc_e :: Double -> Double -> (Double,Double) | ||
241 | gamma_inc_e a x = createSFR "gamma_inc_e" $ gsl_sf_gamma_inc_e a x | ||
242 | foreign import ccall "gamma.h gsl_sf_gamma_inc_e" gsl_sf_gamma_inc_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
243 | |||
244 | -- | wrapper for double gsl_sf_gamma_inc(double a,double x); | ||
245 | gamma_inc :: Double -> Double -> Double | ||
246 | gamma_inc = gsl_sf_gamma_inc | ||
247 | foreign import ccall "gamma.h gsl_sf_gamma_inc" gsl_sf_gamma_inc :: Double -> Double -> Double | ||
248 | |||
249 | -- | wrapper for int gsl_sf_lnbeta_e(double a,double b,gsl_sf_result* result); | ||
250 | lnbeta_e :: Double -> Double -> (Double,Double) | ||
251 | lnbeta_e a b = createSFR "lnbeta_e" $ gsl_sf_lnbeta_e a b | ||
252 | foreign import ccall "gamma.h gsl_sf_lnbeta_e" gsl_sf_lnbeta_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
253 | |||
254 | -- | wrapper for double gsl_sf_lnbeta(double a,double b); | ||
255 | lnbeta :: Double -> Double -> Double | ||
256 | lnbeta = gsl_sf_lnbeta | ||
257 | foreign import ccall "gamma.h gsl_sf_lnbeta" gsl_sf_lnbeta :: Double -> Double -> Double | ||
258 | |||
259 | -- | wrapper for int gsl_sf_beta_e(double a,double b,gsl_sf_result* result); | ||
260 | beta_e :: Double -> Double -> (Double,Double) | ||
261 | beta_e a b = createSFR "beta_e" $ gsl_sf_beta_e a b | ||
262 | foreign import ccall "gamma.h gsl_sf_beta_e" gsl_sf_beta_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
263 | |||
264 | -- | wrapper for double gsl_sf_beta(double a,double b); | ||
265 | beta :: Double -> Double -> Double | ||
266 | beta = gsl_sf_beta | ||
267 | foreign import ccall "gamma.h gsl_sf_beta" gsl_sf_beta :: Double -> Double -> Double | ||
268 | |||
269 | -- | wrapper for int gsl_sf_beta_inc_e(double a,double b,double x,gsl_sf_result* result); | ||
270 | beta_inc_e :: Double -> Double -> Double -> (Double,Double) | ||
271 | beta_inc_e a b x = createSFR "beta_inc_e" $ gsl_sf_beta_inc_e a b x | ||
272 | foreign import ccall "gamma.h gsl_sf_beta_inc_e" gsl_sf_beta_inc_e :: Double -> Double -> Double -> Ptr Double -> IO(Int) | ||
273 | |||
274 | -- | wrapper for double gsl_sf_beta_inc(double a,double b,double x); | ||
275 | beta_inc :: Double -> Double -> Double -> Double | ||
276 | beta_inc = gsl_sf_beta_inc | ||
277 | foreign import ccall "gamma.h gsl_sf_beta_inc" gsl_sf_beta_inc :: Double -> Double -> Double -> Double | ||