Modifying the documentation to make it look better.
[Math-GSL.git] / Randist.i
blobedd484797987ea87abc2c848f6b0ae53928b41a0
1 %module Randist
2 %{
3 #include "/usr/local/include/gsl/gsl_randist.h"
4 %}
6 %include "/usr/local/include/gsl/gsl_randist.h"
8 %perlcode %{
10 our @EXPORT_OK = qw/gsl_ran_bernoulli gsl_ran_bernoulli_pdf gsl_ran_beta
11 gsl_ran_beta_pdf gsl_ran_binomial gsl_ran_binomial_knuth
12 gsl_ran_binomial_tpe gsl_ran_binomial_pdf gsl_ran_exponential
13 gsl_ran_exponential_pdf gsl_ran_exppow gsl_ran_exppow_pdf
14 gsl_ran_cauchy gsl_ran_cauchy_pdf gsl_ran_chisq
15 gsl_ran_chisq_pdf gsl_ran_dirichlet gsl_ran_dirichlet_pdf
16 gsl_ran_dirichlet_lnpdf gsl_ran_erlang gsl_ran_erlang_pdf
17 gsl_ran_fdist gsl_ran_fdist_pdf gsl_ran_flat
18 gsl_ran_flat_pdf gsl_ran_gamma gsl_ran_gamma_int
19 gsl_ran_gamma_pdf gsl_ran_gamma_mt gsl_ran_gamma_knuth
20 gsl_ran_gaussian gsl_ran_gaussian_ratio_method gsl_ran_gaussian_ziggurat
21 gsl_ran_gaussian_pdf gsl_ran_ugaussian gsl_ran_ugaussian_ratio_method
22 gsl_ran_ugaussian_pdf gsl_ran_gaussian_tail gsl_ran_gaussian_tail_pdf
23 gsl_ran_ugaussian_tail gsl_ran_ugaussian_tail_pdf gsl_ran_bivariate_gaussian
24 gsl_ran_bivariate_gaussian_pdf gsl_ran_landau gsl_ran_landau_pdf
25 gsl_ran_geometric gsl_ran_geometric_pdf gsl_ran_hypergeometric
26 gsl_ran_hypergeometric_pdf gsl_ran_gumbel1 gsl_ran_gumbel1_pdf
27 gsl_ran_gumbel2 gsl_ran_gumbel2_pdf gsl_ran_logistic
28 gsl_ran_logistic_pdf gsl_ran_lognormal gsl_ran_lognormal_pdf
29 gsl_ran_logarithmic gsl_ran_logarithmic_pdf gsl_ran_multinomial
30 gsl_ran_multinomial_pdf gsl_ran_multinomial_lnpdf
31 gsl_ran_negative_binomial gsl_ran_negative_binomial_pdf gsl_ran_pascal
32 gsl_ran_pascal_pdf gsl_ran_pareto gsl_ran_pareto_pdf
33 gsl_ran_poisson gsl_ran_poisson_array
34 gsl_ran_poisson_pdf gsl_ran_rayleigh gsl_ran_rayleigh_pdf
35 gsl_ran_rayleigh_tail gsl_ran_rayleigh_tail_pdf gsl_ran_tdist
36 gsl_ran_tdist_pdf gsl_ran_laplace gsl_ran_laplace_pdf
37 gsl_ran_levy gsl_ran_levy_skew gsl_ran_weibull
38 gsl_ran_weibull_pdf gsl_ran_dir_2d gsl_ran_dir_2d_trig_method
39 gsl_ran_dir_3d gsl_ran_dir_nd gsl_ran_shuffle
40 gsl_ran_choose gsl_ran_sample
41 gsl_ran_discrete_t gsl_ran_discrete_free
42 gsl_ran_discrete gsl_ran_discrete_pdf
45 our %EXPORT_TAGS = (
46 all => [ @EXPORT_OK ],
47 logarithmic => [ gsl_ran_logarithmic , gsl_ran_logarithmic_pdf ],
48 choose => [ gsl_ran_choose ],
49 exponential => [ gsl_ran_exponential , gsl_ran_exponential_pdf ],
50 gumbel1 => [ gsl_ran_gumbel1 , gsl_ran_gumbel1_pdf ],
51 exppow => [ gsl_ran_exppow , gsl_ran_exppow_pdf ],
52 sample => [ gsl_ran_sample ],
53 logistic => [ gsl_ran_logistic , gsl_ran_logistic_pdf ],
54 gaussian => [
55 gsl_ran_gaussian , gsl_ran_gaussian_ratio_method , gsl_ran_gaussian_ziggurat,
56 gsl_ran_gaussian_pdf , gsl_ran_gaussian_tail , gsl_ran_gaussian_tail_pdf
58 poisson => [ gsl_ran_poisson , gsl_ran_poisson_array , gsl_ran_poisson_pdf ],
59 binomial => [ gsl_ran_binomial , gsl_ran_binomial_knuth , gsl_ran_binomial_tpe ,
60 gsl_ran_binomial_pdf ],
61 fdist => [ gsl_ran_fdist , gsl_ran_fdist_pdf ],
62 chisq => [ gsl_ran_chisq , gsl_ran_chisq_pdf ],
63 gamma => [ gsl_ran_gamma , gsl_ran_gamma_int , gsl_ran_gamma_pdf , gsl_ran_gamma_mt , gsl_ran_gamma_knuth ],
64 hypergeometric => [ gsl_ran_hypergeometric , gsl_ran_hypergeometric_pdf ],
65 dirichlet => [ gsl_ran_dirichlet , gsl_ran_dirichlet_pdf , gsl_ran_dirichlet_lnpdf ],
66 negative => [ gsl_ran_negative_binomial , gsl_ran_negative_binomial_pdf ],
67 flat => [ gsl_ran_flat , gsl_ran_flat_pdf ],
68 geometric => [ gsl_ran_geometric , gsl_ran_geometric_pdf ],
69 discrete => [ gsl_ran_discrete , gsl_ran_discrete_pdf],
70 tdist => [ gsl_ran_tdist , gsl_ran_tdist_pdf ],
71 ugaussian => [ gsl_ran_ugaussian , gsl_ran_ugaussian_ratio_method , gsl_ran_ugaussian_pdf ,
72 gsl_ran_ugaussian_tail , gsl_ran_ugaussian_tail_pdf ],
73 rayleigh => [ gsl_ran_rayleigh , gsl_ran_rayleigh_pdf , gsl_ran_rayleigh_tail ,
74 gsl_ran_rayleigh_tail_pdf ],
75 dir => [ gsl_ran_dir_2d , gsl_ran_dir_2d_trig_method , gsl_ran_dir_3d , gsl_ran_dir_nd ],
76 pascal => [ gsl_ran_pascal , gsl_ran_pascal_pdf ],
77 gumbel2 => [ gsl_ran_gumbel2 , gsl_ran_gumbel2_pdf ],
78 shuffle => [ gsl_ran_shuffle ],
79 landau => [ gsl_ran_landau , gsl_ran_landau_pdf ],
80 bernoulli => [ gsl_ran_bernoulli , gsl_ran_bernoulli_pdf ],
81 weibull => [ gsl_ran_weibull , gsl_ran_weibull_pdf ],
82 multinomial => [ gsl_ran_multinomial , gsl_ran_multinomial_pdf , gsl_ran_multinomial_lnpdf ],
83 beta => [ gsl_ran_beta , gsl_ran_beta_pdf ],
84 lognormal => [ gsl_ran_lognormal , gsl_ran_lognormal_pdf ],
85 laplace => [ gsl_ran_laplace , gsl_ran_laplace_pdf ],
86 erlang => [ gsl_ran_erlang , gsl_ran_erlang_pdf ],
87 cauchy => [ gsl_ran_cauchy , gsl_ran_cauchy_pdf ],
88 levy => [ gsl_ran_levy , gsl_ran_levy_skew ],
89 bivariate => [ gsl_ran_bivariate_gaussian , gsl_ran_bivariate_gaussian_pdf ],
90 pareto => [ gsl_ran_pareto , gsl_ran_pareto_pdf ]
93 __END__
95 =head1 NAME
97 Math::GSL::Randist - Probability Distributions
99 =head1 SYPNOPSIS
101 use Math::GSL::Randist qw/put_functions_here/;
103 =head1 DESCRIPTION
105 Here is a list of all the functions included in this module :
107 gsl_ran_bernoulli gsl_ran_bernoulli_pdf gsl_ran_beta
108 gsl_ran_beta_pdf gsl_ran_binomial gsl_ran_binomial_knuth
109 gsl_ran_binomial_tpe gsl_ran_binomial_pdf gsl_ran_exponential
110 gsl_ran_exponential_pdf gsl_ran_exppow gsl_ran_exppow_pdf
111 gsl_ran_cauchy gsl_ran_cauchy_pdf gsl_ran_chisq
112 gsl_ran_chisq_pdf gsl_ran_dirichlet gsl_ran_dirichlet_pdf
113 gsl_ran_dirichlet_lnpdf gsl_ran_erlang gsl_ran_erlang_pdf
114 gsl_ran_fdist gsl_ran_fdist_pdf gsl_ran_flat
115 gsl_ran_flat_pdf gsl_ran_gamma gsl_ran_gamma_int
116 gsl_ran_gamma_pdf gsl_ran_gamma_mt gsl_ran_gamma_knuth
117 gsl_ran_gaussian gsl_ran_gaussian_ratio_method gsl_ran_gaussian_ziggurat
118 gsl_ran_gaussian_pdf gsl_ran_ugaussian gsl_ran_ugaussian_ratio_method
119 gsl_ran_ugaussian_pdf gsl_ran_gaussian_tail gsl_ran_gaussian_tail_pdf
120 gsl_ran_ugaussian_tail gsl_ran_ugaussian_tail_pdf gsl_ran_bivariate_gaussian
121 gsl_ran_bivariate_gaussian_pdf gsl_ran_landau gsl_ran_landau_pdf
122 gsl_ran_geometric gsl_ran_geometric_pdf gsl_ran_hypergeometric
123 gsl_ran_hypergeometric_pdf gsl_ran_gumbel1 gsl_ran_gumbel1_pdf
124 gsl_ran_gumbel2 gsl_ran_gumbel2_pdf gsl_ran_logistic
125 gsl_ran_logistic_pdf gsl_ran_lognormal gsl_ran_lognormal_pdf
126 gsl_ran_logarithmic gsl_ran_logarithmic_pdf gsl_ran_multinomial
127 gsl_ran_multinomial_pdf gsl_ran_multinomial_lnpdf
128 gsl_ran_negative_binomial gsl_ran_negative_binomial_pdf gsl_ran_pascal
129 gsl_ran_pascal_pdf gsl_ran_pareto gsl_ran_pareto_pdf
130 gsl_ran_poisson gsl_ran_poisson_array
131 gsl_ran_poisson_pdf gsl_ran_rayleigh gsl_ran_rayleigh_pdf
132 gsl_ran_rayleigh_tail gsl_ran_rayleigh_tail_pdf gsl_ran_tdist
133 gsl_ran_tdist_pdf gsl_ran_laplace gsl_ran_laplace_pdf
134 gsl_ran_levy gsl_ran_levy_skew gsl_ran_weibull
135 gsl_ran_weibull_pdf gsl_ran_dir_2d gsl_ran_dir_2d_trig_method
136 gsl_ran_dir_3d gsl_ran_dir_nd gsl_ran_shuffle
137 gsl_ran_choose gsl_ran_sample
138 gsl_ran_discrete gsl_ran_discrete_pdf
140 You have to add the functions you want to use inside the qw /put_funtion_here /. You can also write
142 use Math::GSL::Randist qw/:name_of_tag/
144 to use all avaible functions of the module. Other tags are also avaible, here is a complete list of all tags for this module :
146 logarithmic
147 choose
148 exponential
149 gumbel1
150 exppow
151 sample
152 logistic
153 gaussian
154 poisson
155 binomial
156 fdist
157 chisq
158 gamma
159 hypergeometric
160 dirichlet
161 negative
162 flat
163 geometric
164 discrete
165 tdist
166 ugaussian
167 rayleigh
169 pascal
170 gumbel2
171 shuffle
172 landau
173 bernoulli
174 weibull
175 multinomial
176 beta
177 lognormal
178 laplace
179 erlang
180 cauchy
181 levy
182 bivariate
183 pareto
185 For example the beta tag contains theses functions : gsl_ran_beta, gsl_ran_beta_pdf.
187 For more informations on the functions, we refer you to the GSL offcial documentation: http://www.gnu.org/software/gsl/manual/html_node/
188 Tip : search on google: site:http://www.gnu.org/software/gsl/manual/html_node/ name_of_the_function_you_want
190 You might also want to write
192 use Math::GSL::RNG qw/:all/;
194 since a lot of the functions of Math::GSL::Randist take as argument a structure that is created by Math::GSL::RNG. Refer to Math::GSL::RNG documentation to see how to create such a structure.
196 Math::GSL::CDF also contains a structure named gsl_ran_discrete_t. An example is given in the EXAMPLES part on how to use the function related to this structure.
199 =head1 EXAMPLES
201 use Math::GSL::Randist qw/:all/;
202 print gsl_ran_exponential_pdf(5,2) . "\n";
204 use Math::GSL::Randist qw/:all/;
205 $x= Math::GSL::gsl_ran_discrete_t::new;
208 =head1 AUTHOR
210 Jonathan Leto <jaleto@gmail.com> and Thierry Moisan <thierry.moisan@gmail.com>
212 =head1 COPYRIGHT AND LICENSE
214 Copyright (C) 2008 Jonathan Leto and Thierry Moisan
216 This program is free software; you can redistribute it and/or modify it
217 under the same terms as Perl itself.
219 =cut