gsl 1.12.108
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +29 -0
- data/Rakefile +54 -0
- data/VERSION +2 -0
- data/ext/MANIFEST +119 -0
- data/ext/alf.c +206 -0
- data/ext/array.c +666 -0
- data/ext/array_complex.c +247 -0
- data/ext/blas.c +29 -0
- data/ext/blas1.c +731 -0
- data/ext/blas2.c +1093 -0
- data/ext/blas3.c +881 -0
- data/ext/block.c +44 -0
- data/ext/block_source.c +886 -0
- data/ext/bspline.c +130 -0
- data/ext/bundle.c +3 -0
- data/ext/cdf.c +754 -0
- data/ext/cheb.c +542 -0
- data/ext/combination.c +283 -0
- data/ext/common.c +325 -0
- data/ext/complex.c +1004 -0
- data/ext/const.c +673 -0
- data/ext/const_additional.c +120 -0
- data/ext/cqp.c +283 -0
- data/ext/deriv.c +195 -0
- data/ext/dht.c +361 -0
- data/ext/diff.c +166 -0
- data/ext/dirac.c +395 -0
- data/ext/eigen.c +2373 -0
- data/ext/error.c +194 -0
- data/ext/extconf.rb +281 -0
- data/ext/fcmp.c +66 -0
- data/ext/fft.c +1092 -0
- data/ext/fit.c +205 -0
- data/ext/fresnel.c +312 -0
- data/ext/function.c +524 -0
- data/ext/geometry.c +139 -0
- data/ext/graph.c +1638 -0
- data/ext/gsl.c +271 -0
- data/ext/gsl_narray.c +653 -0
- data/ext/histogram.c +1995 -0
- data/ext/histogram2d.c +1068 -0
- data/ext/histogram3d.c +884 -0
- data/ext/histogram3d_source.c +750 -0
- data/ext/histogram_find.c +101 -0
- data/ext/histogram_oper.c +159 -0
- data/ext/ieee.c +98 -0
- data/ext/integration.c +1138 -0
- data/ext/interp.c +512 -0
- data/ext/jacobi.c +739 -0
- data/ext/linalg.c +4047 -0
- data/ext/linalg_complex.c +741 -0
- data/ext/math.c +725 -0
- data/ext/matrix.c +39 -0
- data/ext/matrix_complex.c +1732 -0
- data/ext/matrix_double.c +560 -0
- data/ext/matrix_int.c +256 -0
- data/ext/matrix_source.c +2733 -0
- data/ext/min.c +250 -0
- data/ext/monte.c +992 -0
- data/ext/multifit.c +1879 -0
- data/ext/multimin.c +808 -0
- data/ext/multimin_fsdf.c +156 -0
- data/ext/multiroots.c +955 -0
- data/ext/ndlinear.c +321 -0
- data/ext/nmf.c +167 -0
- data/ext/nmf_wrap.c +72 -0
- data/ext/ntuple.c +469 -0
- data/ext/odeiv.c +959 -0
- data/ext/ool.c +879 -0
- data/ext/oper_complex_source.c +253 -0
- data/ext/permutation.c +596 -0
- data/ext/poly.c +42 -0
- data/ext/poly2.c +265 -0
- data/ext/poly_source.c +1885 -0
- data/ext/qrng.c +171 -0
- data/ext/randist.c +1873 -0
- data/ext/rational.c +480 -0
- data/ext/rng.c +612 -0
- data/ext/root.c +408 -0
- data/ext/sf.c +1494 -0
- data/ext/sf_airy.c +200 -0
- data/ext/sf_bessel.c +867 -0
- data/ext/sf_clausen.c +28 -0
- data/ext/sf_coulomb.c +206 -0
- data/ext/sf_coupling.c +118 -0
- data/ext/sf_dawson.c +29 -0
- data/ext/sf_debye.c +157 -0
- data/ext/sf_dilog.c +42 -0
- data/ext/sf_elementary.c +44 -0
- data/ext/sf_ellint.c +206 -0
- data/ext/sf_elljac.c +29 -0
- data/ext/sf_erfc.c +93 -0
- data/ext/sf_exp.c +164 -0
- data/ext/sf_expint.c +211 -0
- data/ext/sf_fermi_dirac.c +148 -0
- data/ext/sf_gamma.c +344 -0
- data/ext/sf_gegenbauer.c +96 -0
- data/ext/sf_hyperg.c +197 -0
- data/ext/sf_laguerre.c +112 -0
- data/ext/sf_lambert.c +47 -0
- data/ext/sf_legendre.c +367 -0
- data/ext/sf_log.c +104 -0
- data/ext/sf_mathieu.c +238 -0
- data/ext/sf_power.c +46 -0
- data/ext/sf_psi.c +98 -0
- data/ext/sf_synchrotron.c +48 -0
- data/ext/sf_transport.c +76 -0
- data/ext/sf_trigonometric.c +207 -0
- data/ext/sf_zeta.c +119 -0
- data/ext/signal.c +310 -0
- data/ext/siman.c +718 -0
- data/ext/sort.c +208 -0
- data/ext/spline.c +395 -0
- data/ext/stats.c +799 -0
- data/ext/sum.c +168 -0
- data/ext/tamu_anova.c +56 -0
- data/ext/tensor.c +38 -0
- data/ext/tensor_source.c +1123 -0
- data/ext/vector.c +38 -0
- data/ext/vector_complex.c +2236 -0
- data/ext/vector_double.c +1433 -0
- data/ext/vector_int.c +204 -0
- data/ext/vector_source.c +3329 -0
- data/ext/wavelet.c +937 -0
- data/include/rb_gsl.h +151 -0
- data/include/rb_gsl_array.h +238 -0
- data/include/rb_gsl_cheb.h +21 -0
- data/include/rb_gsl_common.h +343 -0
- data/include/rb_gsl_complex.h +25 -0
- data/include/rb_gsl_const.h +29 -0
- data/include/rb_gsl_dirac.h +13 -0
- data/include/rb_gsl_eigen.h +17 -0
- data/include/rb_gsl_fft.h +62 -0
- data/include/rb_gsl_fit.h +25 -0
- data/include/rb_gsl_function.h +27 -0
- data/include/rb_gsl_graph.h +70 -0
- data/include/rb_gsl_histogram.h +63 -0
- data/include/rb_gsl_histogram3d.h +97 -0
- data/include/rb_gsl_integration.h +17 -0
- data/include/rb_gsl_interp.h +46 -0
- data/include/rb_gsl_linalg.h +25 -0
- data/include/rb_gsl_math.h +26 -0
- data/include/rb_gsl_odeiv.h +21 -0
- data/include/rb_gsl_poly.h +71 -0
- data/include/rb_gsl_rational.h +37 -0
- data/include/rb_gsl_rng.h +21 -0
- data/include/rb_gsl_root.h +22 -0
- data/include/rb_gsl_sf.h +119 -0
- data/include/rb_gsl_statistics.h +17 -0
- data/include/rb_gsl_tensor.h +45 -0
- data/include/rb_gsl_with_narray.h +22 -0
- data/include/templates_off.h +87 -0
- data/include/templates_on.h +241 -0
- data/lib/gsl/gnuplot.rb +41 -0
- data/lib/gsl/oper.rb +68 -0
- data/lib/ool.rb +22 -0
- data/lib/ool/conmin.rb +30 -0
- metadata +224 -0
data/ext/bspline.c
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
|
2
|
+
#include "rb_gsl.h"
|
3
|
+
#ifdef GSL_1_9_LATER
|
4
|
+
#include "gsl/gsl_bspline.h"
|
5
|
+
|
6
|
+
static VALUE cBSWS;
|
7
|
+
|
8
|
+
static VALUE rb_gsl_bspline_alloc(VALUE klass, VALUE k, VALUE n)
|
9
|
+
{
|
10
|
+
gsl_bspline_workspace *w;
|
11
|
+
w = gsl_bspline_alloc(FIX2INT(k), FIX2INT(n));
|
12
|
+
return Data_Wrap_Struct(klass, 0, gsl_bspline_free, w);
|
13
|
+
}
|
14
|
+
|
15
|
+
static VALUE rb_gsl_bspline_ncoeffs(VALUE obj)
|
16
|
+
{
|
17
|
+
gsl_bspline_workspace *w;
|
18
|
+
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
19
|
+
return INT2FIX((int)gsl_bspline_ncoeffs(w));
|
20
|
+
}
|
21
|
+
static VALUE rb_gsl_bspline_order(VALUE obj)
|
22
|
+
{
|
23
|
+
gsl_bspline_workspace *w;
|
24
|
+
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
25
|
+
return INT2FIX((int)gsl_bspline_order(w));
|
26
|
+
}
|
27
|
+
static VALUE rb_gsl_bspline_nbreak(VALUE obj)
|
28
|
+
{
|
29
|
+
gsl_bspline_workspace *w;
|
30
|
+
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
31
|
+
return INT2FIX((int)gsl_bspline_nbreak(w));
|
32
|
+
}
|
33
|
+
static VALUE rb_gsl_bspline_breakpoint(VALUE obj, VALUE i)
|
34
|
+
{
|
35
|
+
gsl_bspline_workspace *w;
|
36
|
+
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
37
|
+
return rb_float_new(gsl_bspline_breakpoint(FIX2INT(i), w));
|
38
|
+
}
|
39
|
+
static VALUE rb_gsl_bspline_knots(VALUE obj, VALUE b)
|
40
|
+
{
|
41
|
+
gsl_bspline_workspace *w;
|
42
|
+
gsl_vector *bpts;
|
43
|
+
CHECK_VECTOR(b);
|
44
|
+
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
45
|
+
Data_Get_Struct(b, gsl_vector, bpts);
|
46
|
+
gsl_bspline_knots(bpts, w);
|
47
|
+
return Data_Wrap_Struct(cgsl_vector_view_ro, 0, NULL, w->knots);
|
48
|
+
}
|
49
|
+
static VALUE rb_gsl_bspline_knots_uniform(int argc, VALUE *argv, VALUE obj)
|
50
|
+
{
|
51
|
+
gsl_bspline_workspace *w;
|
52
|
+
int argc2;
|
53
|
+
switch (TYPE(obj)) {
|
54
|
+
case T_MODULE:
|
55
|
+
case T_CLASS:
|
56
|
+
case T_OBJECT:
|
57
|
+
if (!rb_obj_is_kind_of(argv[argc-1], cBSWS)) {
|
58
|
+
rb_raise(rb_eTypeError, "Wrong argument type %s (GSL::BSpline expected)",
|
59
|
+
rb_class2name(CLASS_OF(argv[argc-1])));
|
60
|
+
}
|
61
|
+
Data_Get_Struct(argv[argc-1], gsl_bspline_workspace, w);
|
62
|
+
argc2 = argc-1;
|
63
|
+
break;
|
64
|
+
default:
|
65
|
+
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
66
|
+
argc2 = argc;
|
67
|
+
}
|
68
|
+
if (argc2 != 2) rb_raise(rb_eArgError, "Wrong number of arguments.");
|
69
|
+
gsl_bspline_knots_uniform(NUM2DBL(argv[0]), NUM2DBL(argv[1]), w);
|
70
|
+
return Data_Wrap_Struct(cgsl_vector_view_ro, 0, NULL, w->knots);
|
71
|
+
}
|
72
|
+
static VALUE rb_gsl_bspline_eval(int argc, VALUE *argv, VALUE obj)
|
73
|
+
{
|
74
|
+
gsl_bspline_workspace *w;
|
75
|
+
double x;
|
76
|
+
gsl_vector *B;
|
77
|
+
VALUE vB;
|
78
|
+
|
79
|
+
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
80
|
+
|
81
|
+
switch (argc) {
|
82
|
+
case 2:
|
83
|
+
CHECK_VECTOR(argv[1]);
|
84
|
+
Data_Get_Struct(argv[1], gsl_vector, B);
|
85
|
+
vB = argv[1];
|
86
|
+
x = NUM2DBL(argv[0]);
|
87
|
+
break;
|
88
|
+
case 1:
|
89
|
+
x = NUM2DBL(argv[0]);
|
90
|
+
B = gsl_vector_alloc(w->nbreak+w->k-2);
|
91
|
+
vB = Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, B);
|
92
|
+
break;
|
93
|
+
default:
|
94
|
+
rb_raise(rb_eArgError, "Wrong number of arguments (%d for 1 or 2)", argc);
|
95
|
+
}
|
96
|
+
|
97
|
+
gsl_bspline_eval(x, B, w);
|
98
|
+
|
99
|
+
return vB;
|
100
|
+
}
|
101
|
+
#ifdef GSL_1_13_LATER
|
102
|
+
static VALUE rb_gsl_bspline_greville_abscissa(VALUE obj, VALUE i)
|
103
|
+
{
|
104
|
+
gsl_bspline_workspace *w;
|
105
|
+
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
106
|
+
return rb_float_new(gsl_bspline_greville_abscissa(i, w));
|
107
|
+
}
|
108
|
+
#endif
|
109
|
+
|
110
|
+
void Init_bspline(VALUE module)
|
111
|
+
{
|
112
|
+
cBSWS = rb_define_class_under(module, "BSpline", cGSL_Object);
|
113
|
+
|
114
|
+
rb_define_singleton_method(cBSWS, "alloc", rb_gsl_bspline_alloc, 2);
|
115
|
+
|
116
|
+
rb_define_method(cBSWS, "ncoeffs", rb_gsl_bspline_ncoeffs, 0);
|
117
|
+
rb_define_method(cBSWS, "order", rb_gsl_bspline_order, 0);
|
118
|
+
rb_define_method(cBSWS, "nbreak", rb_gsl_bspline_nbreak, 0);
|
119
|
+
rb_define_method(cBSWS, "breakpoint", rb_gsl_bspline_breakpoint, 1);
|
120
|
+
rb_define_method(cBSWS, "knots", rb_gsl_bspline_knots, 1);
|
121
|
+
rb_define_method(cBSWS, "knots_uniform", rb_gsl_bspline_knots_uniform, -1);
|
122
|
+
rb_define_singleton_method(cBSWS, "knots_uniform", rb_gsl_bspline_knots_uniform, -1);
|
123
|
+
rb_define_method(cBSWS, "eval", rb_gsl_bspline_eval, -1);
|
124
|
+
|
125
|
+
#ifdef GSL_1_13_LATER
|
126
|
+
rb_define_method(cBSWS, "greville_abscissa", rb_gsl_bspline_greville_abscissa, 1);
|
127
|
+
#endif
|
128
|
+
|
129
|
+
}
|
130
|
+
#endif
|
data/ext/bundle.c
ADDED
data/ext/cdf.c
ADDED
@@ -0,0 +1,754 @@
|
|
1
|
+
/*
|
2
|
+
cdf.c
|
3
|
+
Ruby/GSL: Ruby extension library for GSL (GNU Scientific Library)
|
4
|
+
(C) Copyright 2001-2006 by Yoshiki Tsunesada
|
5
|
+
|
6
|
+
Ruby/GSL is free software: you can redistribute it and/or modify it
|
7
|
+
under the terms of the GNU General Public License.
|
8
|
+
This library is distributed in the hope that it will be useful, but
|
9
|
+
WITHOUT ANY WARRANTY.
|
10
|
+
*/
|
11
|
+
|
12
|
+
#include "rb_gsl_config.h"
|
13
|
+
|
14
|
+
#ifdef GSL_1_4_LATER
|
15
|
+
#include "rb_gsl_array.h"
|
16
|
+
#include "rb_gsl_common.h"
|
17
|
+
#include "rb_gsl_rng.h"
|
18
|
+
#include <gsl/gsl_randist.h>
|
19
|
+
#include <gsl/gsl_cdf.h>
|
20
|
+
|
21
|
+
VALUE rb_gsl_eval_pdf_cdf(VALUE xx, double (*f)(double));
|
22
|
+
VALUE rb_gsl_eval_pdf_cdf2(VALUE xx, VALUE aa, double (*f)(double, double));
|
23
|
+
VALUE rb_gsl_eval_pdf_cdf3(VALUE xx, VALUE aa, VALUE bb,
|
24
|
+
double (*f)(double, double, double));
|
25
|
+
VALUE rb_gsl_eval_pdf_cdf2_uint(VALUE xx, VALUE aa,
|
26
|
+
double (*f)(unsigned int, double));
|
27
|
+
|
28
|
+
|
29
|
+
static VALUE rb_gsl_cdf_gaussian_P(int argc, VALUE *argv, VALUE obj)
|
30
|
+
{
|
31
|
+
if (argc == 1) {
|
32
|
+
return rb_gsl_eval_pdf_cdf(argv[0], gsl_cdf_ugaussian_P);
|
33
|
+
} else if (argc == 2) {
|
34
|
+
return rb_gsl_eval_pdf_cdf2(argv[0], argv[1], gsl_cdf_gaussian_P);
|
35
|
+
} else {
|
36
|
+
rb_raise(rb_eArgError, "wrong number of arguments (%d for 1 or 2)", argc);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
static VALUE rb_gsl_cdf_gaussian_Q(int argc, VALUE *argv, VALUE obj)
|
40
|
+
{
|
41
|
+
if (argc == 1) {
|
42
|
+
return rb_gsl_eval_pdf_cdf(argv[0], gsl_cdf_ugaussian_Q);
|
43
|
+
} else if (argc == 2) {
|
44
|
+
return rb_gsl_eval_pdf_cdf2(argv[0], argv[1], gsl_cdf_gaussian_Q);
|
45
|
+
} else {
|
46
|
+
rb_raise(rb_eArgError, "wrong number of arguments (%d for 1 or 2)", argc);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
static VALUE rb_gsl_cdf_gaussian_Pinv(int argc, VALUE *argv, VALUE obj)
|
51
|
+
{
|
52
|
+
if (argc == 1) {
|
53
|
+
return rb_gsl_eval_pdf_cdf(argv[0], gsl_cdf_ugaussian_Pinv);
|
54
|
+
} else if (argc == 2) {
|
55
|
+
return rb_gsl_eval_pdf_cdf2(argv[0], argv[1], gsl_cdf_gaussian_Pinv);
|
56
|
+
} else {
|
57
|
+
rb_raise(rb_eArgError, "wrong number of arguments (%d for 1 or 2)", argc);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
static VALUE rb_gsl_cdf_gaussian_Qinv(int argc, VALUE *argv, VALUE obj)
|
62
|
+
{
|
63
|
+
if (argc == 1) {
|
64
|
+
return rb_gsl_eval_pdf_cdf(argv[0], gsl_cdf_ugaussian_Qinv);
|
65
|
+
} else if (argc == 2) {
|
66
|
+
return rb_gsl_eval_pdf_cdf2(argv[0], argv[1], gsl_cdf_gaussian_Qinv);
|
67
|
+
} else {
|
68
|
+
rb_raise(rb_eArgError, "wrong number of arguments (%d for 1 or 2)", argc);
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
static VALUE rb_gsl_cdf_exponential_P(VALUE obj, VALUE x, VALUE mu)
|
73
|
+
{
|
74
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_exponential_P);
|
75
|
+
}
|
76
|
+
|
77
|
+
static VALUE rb_gsl_cdf_exponential_Q(VALUE obj, VALUE x, VALUE mu)
|
78
|
+
{
|
79
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_exponential_Q);
|
80
|
+
}
|
81
|
+
|
82
|
+
static VALUE rb_gsl_cdf_exponential_Pinv(VALUE obj, VALUE x, VALUE mu)
|
83
|
+
{
|
84
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_exponential_Pinv);
|
85
|
+
}
|
86
|
+
|
87
|
+
static VALUE rb_gsl_cdf_exponential_Qinv(VALUE obj, VALUE x, VALUE mu)
|
88
|
+
{
|
89
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_exponential_Qinv);
|
90
|
+
}
|
91
|
+
|
92
|
+
static VALUE rb_gsl_cdf_laplace_P(VALUE obj, VALUE x, VALUE mu)
|
93
|
+
{
|
94
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_laplace_P);
|
95
|
+
}
|
96
|
+
|
97
|
+
static VALUE rb_gsl_cdf_laplace_Q(VALUE obj, VALUE x, VALUE mu)
|
98
|
+
{
|
99
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_laplace_Q);
|
100
|
+
}
|
101
|
+
|
102
|
+
static VALUE rb_gsl_cdf_laplace_Pinv(VALUE obj, VALUE x, VALUE mu)
|
103
|
+
{
|
104
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_laplace_Pinv);
|
105
|
+
}
|
106
|
+
|
107
|
+
static VALUE rb_gsl_cdf_laplace_Qinv(VALUE obj, VALUE x, VALUE mu)
|
108
|
+
{
|
109
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_laplace_Qinv);
|
110
|
+
}
|
111
|
+
|
112
|
+
static VALUE rb_gsl_cdf_cauchy_P(VALUE obj, VALUE x, VALUE mu)
|
113
|
+
{
|
114
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_cauchy_P);
|
115
|
+
}
|
116
|
+
|
117
|
+
static VALUE rb_gsl_cdf_cauchy_Q(VALUE obj, VALUE x, VALUE mu)
|
118
|
+
{
|
119
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_cauchy_Q);
|
120
|
+
}
|
121
|
+
|
122
|
+
static VALUE rb_gsl_cdf_cauchy_Pinv(VALUE obj, VALUE x, VALUE mu)
|
123
|
+
{
|
124
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_cauchy_Pinv);
|
125
|
+
}
|
126
|
+
|
127
|
+
static VALUE rb_gsl_cdf_cauchy_Qinv(VALUE obj, VALUE x, VALUE mu)
|
128
|
+
{
|
129
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_cauchy_Qinv);
|
130
|
+
}
|
131
|
+
|
132
|
+
static VALUE rb_gsl_cdf_rayleigh_P(VALUE obj, VALUE x, VALUE mu)
|
133
|
+
{
|
134
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_rayleigh_P);
|
135
|
+
}
|
136
|
+
|
137
|
+
static VALUE rb_gsl_cdf_rayleigh_Q(VALUE obj, VALUE x, VALUE mu)
|
138
|
+
{
|
139
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_rayleigh_Q);
|
140
|
+
}
|
141
|
+
|
142
|
+
static VALUE rb_gsl_cdf_rayleigh_Pinv(VALUE obj, VALUE x, VALUE mu)
|
143
|
+
{
|
144
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_rayleigh_Pinv);
|
145
|
+
}
|
146
|
+
|
147
|
+
static VALUE rb_gsl_cdf_rayleigh_Qinv(VALUE obj, VALUE x, VALUE mu)
|
148
|
+
{
|
149
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_rayleigh_Qinv);
|
150
|
+
}
|
151
|
+
|
152
|
+
static VALUE rb_gsl_cdf_gamma_P(VALUE obj, VALUE x, VALUE a, VALUE b)
|
153
|
+
{
|
154
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gamma_P);
|
155
|
+
}
|
156
|
+
|
157
|
+
static VALUE rb_gsl_cdf_gamma_Q(VALUE obj, VALUE x, VALUE a, VALUE b)
|
158
|
+
{
|
159
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gamma_Q);
|
160
|
+
}
|
161
|
+
|
162
|
+
static VALUE rb_gsl_cdf_gamma_Pinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
163
|
+
{
|
164
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gamma_Pinv);
|
165
|
+
}
|
166
|
+
|
167
|
+
static VALUE rb_gsl_cdf_gamma_Qinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
168
|
+
{
|
169
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gamma_Qinv);
|
170
|
+
}
|
171
|
+
|
172
|
+
static VALUE rb_gsl_cdf_flat_P(VALUE obj, VALUE x, VALUE a, VALUE b)
|
173
|
+
{
|
174
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_flat_P);
|
175
|
+
}
|
176
|
+
|
177
|
+
static VALUE rb_gsl_cdf_flat_Q(VALUE obj, VALUE x, VALUE a, VALUE b)
|
178
|
+
{
|
179
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_flat_Q);
|
180
|
+
}
|
181
|
+
|
182
|
+
static VALUE rb_gsl_cdf_flat_Pinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
183
|
+
{
|
184
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_flat_Pinv);
|
185
|
+
}
|
186
|
+
|
187
|
+
static VALUE rb_gsl_cdf_flat_Qinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
188
|
+
{
|
189
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_flat_Qinv);
|
190
|
+
}
|
191
|
+
|
192
|
+
static VALUE rb_gsl_cdf_lognormal_P(VALUE obj, VALUE x, VALUE a, VALUE b)
|
193
|
+
{
|
194
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_lognormal_P);
|
195
|
+
}
|
196
|
+
|
197
|
+
static VALUE rb_gsl_cdf_lognormal_Q(VALUE obj, VALUE x, VALUE a, VALUE b)
|
198
|
+
{
|
199
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_lognormal_Q);
|
200
|
+
}
|
201
|
+
|
202
|
+
static VALUE rb_gsl_cdf_lognormal_Pinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
203
|
+
{
|
204
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_lognormal_Pinv);
|
205
|
+
}
|
206
|
+
|
207
|
+
static VALUE rb_gsl_cdf_lognormal_Qinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
208
|
+
{
|
209
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_lognormal_Qinv);
|
210
|
+
}
|
211
|
+
|
212
|
+
#ifdef GSL_1_6_LATER
|
213
|
+
static VALUE rb_gsl_cdf_exppow_P(VALUE obj, VALUE x, VALUE a, VALUE b)
|
214
|
+
{
|
215
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_exppow_P);
|
216
|
+
}
|
217
|
+
|
218
|
+
static VALUE rb_gsl_cdf_exppow_Q(VALUE obj, VALUE x, VALUE a, VALUE b)
|
219
|
+
{
|
220
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_exppow_Q);
|
221
|
+
}
|
222
|
+
#endif
|
223
|
+
|
224
|
+
static VALUE rb_gsl_cdf_chisq_P(VALUE obj, VALUE x, VALUE mu)
|
225
|
+
{
|
226
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_chisq_P);
|
227
|
+
}
|
228
|
+
|
229
|
+
static VALUE rb_gsl_cdf_chisq_Q(VALUE obj, VALUE x, VALUE mu)
|
230
|
+
{
|
231
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_chisq_Q);
|
232
|
+
}
|
233
|
+
|
234
|
+
static VALUE rb_gsl_cdf_chisq_Pinv(VALUE obj, VALUE x, VALUE mu)
|
235
|
+
{
|
236
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_chisq_Pinv);
|
237
|
+
}
|
238
|
+
|
239
|
+
static VALUE rb_gsl_cdf_chisq_Qinv(VALUE obj, VALUE x, VALUE mu)
|
240
|
+
{
|
241
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_chisq_Qinv);
|
242
|
+
}
|
243
|
+
|
244
|
+
static VALUE rb_gsl_cdf_fdist_P(VALUE obj, VALUE x, VALUE nu1, VALUE nu2)
|
245
|
+
{
|
246
|
+
return rb_gsl_eval_pdf_cdf3(x, nu1, nu2, gsl_cdf_fdist_P);
|
247
|
+
}
|
248
|
+
|
249
|
+
static VALUE rb_gsl_cdf_fdist_Q(VALUE obj, VALUE x, VALUE nu1, VALUE nu2)
|
250
|
+
{
|
251
|
+
return rb_gsl_eval_pdf_cdf3(x, nu1, nu2, gsl_cdf_fdist_Q);
|
252
|
+
}
|
253
|
+
|
254
|
+
static VALUE rb_gsl_cdf_tdist_P(VALUE obj, VALUE x, VALUE mu)
|
255
|
+
{
|
256
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_tdist_P);
|
257
|
+
}
|
258
|
+
|
259
|
+
static VALUE rb_gsl_cdf_tdist_Q(VALUE obj, VALUE x, VALUE mu)
|
260
|
+
{
|
261
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_tdist_Q);
|
262
|
+
}
|
263
|
+
|
264
|
+
static VALUE rb_gsl_cdf_tdist_Pinv(VALUE obj, VALUE x, VALUE mu)
|
265
|
+
{
|
266
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_tdist_Pinv);
|
267
|
+
}
|
268
|
+
|
269
|
+
static VALUE rb_gsl_cdf_tdist_Qinv(VALUE obj, VALUE x, VALUE mu)
|
270
|
+
{
|
271
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_tdist_Qinv);
|
272
|
+
}
|
273
|
+
|
274
|
+
static VALUE rb_gsl_cdf_beta_P(VALUE obj, VALUE x, VALUE nu1, VALUE nu2)
|
275
|
+
{
|
276
|
+
return rb_gsl_eval_pdf_cdf3(x, nu1, nu2, gsl_cdf_beta_P);
|
277
|
+
}
|
278
|
+
|
279
|
+
static VALUE rb_gsl_cdf_beta_Q(VALUE obj, VALUE x, VALUE nu1, VALUE nu2)
|
280
|
+
{
|
281
|
+
return rb_gsl_eval_pdf_cdf3(x, nu1, nu2, gsl_cdf_beta_Q);
|
282
|
+
}
|
283
|
+
|
284
|
+
static VALUE rb_gsl_cdf_logistic_P(VALUE obj, VALUE x, VALUE mu)
|
285
|
+
{
|
286
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_logistic_P);
|
287
|
+
}
|
288
|
+
|
289
|
+
static VALUE rb_gsl_cdf_logistic_Q(VALUE obj, VALUE x, VALUE mu)
|
290
|
+
{
|
291
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_logistic_Q);
|
292
|
+
}
|
293
|
+
|
294
|
+
static VALUE rb_gsl_cdf_logistic_Pinv(VALUE obj, VALUE x, VALUE mu)
|
295
|
+
{
|
296
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_logistic_Pinv);
|
297
|
+
}
|
298
|
+
|
299
|
+
static VALUE rb_gsl_cdf_logistic_Qinv(VALUE obj, VALUE x, VALUE mu)
|
300
|
+
{
|
301
|
+
return rb_gsl_eval_pdf_cdf2(x, mu, gsl_cdf_logistic_Qinv);
|
302
|
+
}
|
303
|
+
|
304
|
+
static VALUE rb_gsl_cdf_pareto_P(VALUE obj, VALUE x, VALUE a, VALUE b)
|
305
|
+
{
|
306
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_pareto_P);
|
307
|
+
}
|
308
|
+
|
309
|
+
static VALUE rb_gsl_cdf_pareto_Q(VALUE obj, VALUE x, VALUE a, VALUE b)
|
310
|
+
{
|
311
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_pareto_Q);
|
312
|
+
}
|
313
|
+
|
314
|
+
static VALUE rb_gsl_cdf_pareto_Pinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
315
|
+
{
|
316
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_pareto_Pinv);
|
317
|
+
}
|
318
|
+
|
319
|
+
static VALUE rb_gsl_cdf_pareto_Qinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
320
|
+
{
|
321
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_pareto_Qinv);
|
322
|
+
}
|
323
|
+
|
324
|
+
static VALUE rb_gsl_cdf_weibull_P(VALUE obj, VALUE x, VALUE a, VALUE b)
|
325
|
+
{
|
326
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_weibull_P);
|
327
|
+
}
|
328
|
+
|
329
|
+
static VALUE rb_gsl_cdf_weibull_Q(VALUE obj, VALUE x, VALUE a, VALUE b)
|
330
|
+
{
|
331
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_weibull_Q);
|
332
|
+
}
|
333
|
+
|
334
|
+
static VALUE rb_gsl_cdf_weibull_Pinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
335
|
+
{
|
336
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_weibull_Pinv);
|
337
|
+
}
|
338
|
+
|
339
|
+
static VALUE rb_gsl_cdf_weibull_Qinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
340
|
+
{
|
341
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_weibull_Qinv);
|
342
|
+
}
|
343
|
+
|
344
|
+
static VALUE rb_gsl_cdf_gumbel1_P(VALUE obj, VALUE x, VALUE a, VALUE b)
|
345
|
+
{
|
346
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gumbel1_P);
|
347
|
+
}
|
348
|
+
|
349
|
+
static VALUE rb_gsl_cdf_gumbel1_Q(VALUE obj, VALUE x, VALUE a, VALUE b)
|
350
|
+
{
|
351
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gumbel1_Q);
|
352
|
+
}
|
353
|
+
|
354
|
+
static VALUE rb_gsl_cdf_gumbel1_Pinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
355
|
+
{
|
356
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gumbel1_Pinv);
|
357
|
+
}
|
358
|
+
|
359
|
+
static VALUE rb_gsl_cdf_gumbel1_Qinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
360
|
+
{
|
361
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gumbel1_Qinv);
|
362
|
+
}
|
363
|
+
|
364
|
+
static VALUE rb_gsl_cdf_gumbel2_P(VALUE obj, VALUE x, VALUE a, VALUE b)
|
365
|
+
{
|
366
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gumbel2_P);
|
367
|
+
}
|
368
|
+
|
369
|
+
static VALUE rb_gsl_cdf_gumbel2_Q(VALUE obj, VALUE x, VALUE a, VALUE b)
|
370
|
+
{
|
371
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gumbel2_Q);
|
372
|
+
}
|
373
|
+
|
374
|
+
static VALUE rb_gsl_cdf_gumbel2_Pinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
375
|
+
{
|
376
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gumbel2_Pinv);
|
377
|
+
}
|
378
|
+
|
379
|
+
static VALUE rb_gsl_cdf_gumbel2_Qinv(VALUE obj, VALUE x, VALUE a, VALUE b)
|
380
|
+
{
|
381
|
+
return rb_gsl_eval_pdf_cdf3(x, a, b, gsl_cdf_gumbel2_Qinv);
|
382
|
+
}
|
383
|
+
|
384
|
+
#ifdef GSL_1_8_LATER
|
385
|
+
static VALUE rb_gsl_cdf_binomial_P(VALUE obj, VALUE kk, VALUE pp, VALUE nn)
|
386
|
+
{
|
387
|
+
unsigned int k, n;
|
388
|
+
double p;
|
389
|
+
k = NUM2UINT(kk);
|
390
|
+
n = NUM2UINT(nn);
|
391
|
+
p = NUM2DBL(pp);
|
392
|
+
return rb_float_new(gsl_cdf_binomial_P(k, p, n));
|
393
|
+
}
|
394
|
+
static VALUE rb_gsl_cdf_binomial_Q(VALUE obj, VALUE kk, VALUE pp, VALUE nn)
|
395
|
+
{
|
396
|
+
unsigned int k, n;
|
397
|
+
double p;
|
398
|
+
k = NUM2UINT(kk);
|
399
|
+
n = NUM2UINT(nn);
|
400
|
+
p = NUM2DBL(pp);
|
401
|
+
return rb_float_new(gsl_cdf_binomial_Q(k, p, n));
|
402
|
+
}
|
403
|
+
static VALUE rb_gsl_cdf_poisson_P(VALUE obj, VALUE kk, VALUE mm)
|
404
|
+
{
|
405
|
+
unsigned int k;
|
406
|
+
double mu;
|
407
|
+
k = NUM2UINT(kk);
|
408
|
+
mu = NUM2DBL(mm);
|
409
|
+
return rb_float_new(gsl_cdf_poisson_P(k, mu));
|
410
|
+
}
|
411
|
+
static VALUE rb_gsl_cdf_poisson_Q(VALUE obj, VALUE kk, VALUE mm)
|
412
|
+
{
|
413
|
+
unsigned int k;
|
414
|
+
double mu;
|
415
|
+
k = NUM2UINT(kk);
|
416
|
+
mu = NUM2DBL(mm);
|
417
|
+
return rb_float_new(gsl_cdf_poisson_Q(k, mu));
|
418
|
+
}
|
419
|
+
static VALUE rb_gsl_cdf_geometric_P(VALUE obj, VALUE kk, VALUE mm)
|
420
|
+
{
|
421
|
+
unsigned int k;
|
422
|
+
double mu;
|
423
|
+
k = NUM2UINT(kk);
|
424
|
+
mu = NUM2DBL(mm);
|
425
|
+
return rb_float_new(gsl_cdf_geometric_P(k, mu));
|
426
|
+
}
|
427
|
+
static VALUE rb_gsl_cdf_geometric_Q(VALUE obj, VALUE kk, VALUE mm)
|
428
|
+
{
|
429
|
+
unsigned int k;
|
430
|
+
double mu;
|
431
|
+
k = NUM2UINT(kk);
|
432
|
+
mu = NUM2DBL(mm);
|
433
|
+
return rb_float_new(gsl_cdf_geometric_Q(k, mu));
|
434
|
+
}
|
435
|
+
static VALUE rb_gsl_cdf_negative_binomial_P(VALUE obj, VALUE kk, VALUE pp, VALUE nn)
|
436
|
+
{
|
437
|
+
unsigned int k;
|
438
|
+
double p, n;
|
439
|
+
k = NUM2UINT(kk);
|
440
|
+
p = NUM2DBL(pp);
|
441
|
+
n = NUM2DBL(nn);
|
442
|
+
return rb_float_new(gsl_cdf_negative_binomial_P(k, p, n));
|
443
|
+
}
|
444
|
+
static VALUE rb_gsl_cdf_negative_binomial_Q(VALUE obj, VALUE kk, VALUE pp, VALUE nn)
|
445
|
+
{
|
446
|
+
unsigned int k;
|
447
|
+
double p, n;
|
448
|
+
k = NUM2UINT(kk);
|
449
|
+
p = NUM2DBL(pp);
|
450
|
+
n = NUM2DBL(nn);
|
451
|
+
return rb_float_new(gsl_cdf_negative_binomial_Q(k, p, n));
|
452
|
+
}
|
453
|
+
static VALUE rb_gsl_cdf_pascal_P(VALUE obj, VALUE kk, VALUE pp, VALUE nn)
|
454
|
+
{
|
455
|
+
unsigned int k, n;
|
456
|
+
double p;
|
457
|
+
k = NUM2UINT(kk);
|
458
|
+
n = NUM2UINT(nn);
|
459
|
+
p = NUM2DBL(pp);
|
460
|
+
return rb_float_new(gsl_cdf_pascal_P(k, p, n));
|
461
|
+
}
|
462
|
+
static VALUE rb_gsl_cdf_pascal_Q(VALUE obj, VALUE kk, VALUE pp, VALUE nn)
|
463
|
+
{
|
464
|
+
unsigned int k, n;
|
465
|
+
double p;
|
466
|
+
k = NUM2UINT(kk);
|
467
|
+
n = NUM2UINT(nn);
|
468
|
+
p = NUM2DBL(pp);
|
469
|
+
return rb_float_new(gsl_cdf_pascal_Q(k, p, n));
|
470
|
+
}
|
471
|
+
static VALUE rb_gsl_cdf_hypergeometric_P(VALUE obj, VALUE kk, VALUE nn1, VALUE nn2, VALUE tt)
|
472
|
+
{
|
473
|
+
unsigned int k, n1, n2, t;
|
474
|
+
k = NUM2UINT(kk);
|
475
|
+
n1 = NUM2UINT(nn1);
|
476
|
+
n2 = NUM2UINT(nn2);
|
477
|
+
t = NUM2UINT(tt);
|
478
|
+
return rb_float_new(gsl_cdf_hypergeometric_P(k, n1, n2, t));
|
479
|
+
}
|
480
|
+
static VALUE rb_gsl_cdf_hypergeometric_Q(VALUE obj, VALUE kk, VALUE nn1, VALUE nn2, VALUE tt)
|
481
|
+
{
|
482
|
+
unsigned int k, n1, n2, t;
|
483
|
+
k = NUM2UINT(kk);
|
484
|
+
n1 = NUM2UINT(nn1);
|
485
|
+
n2 = NUM2UINT(nn2);
|
486
|
+
t = NUM2UINT(tt);
|
487
|
+
return rb_float_new(gsl_cdf_hypergeometric_Q(k, n1, n2, t));
|
488
|
+
}
|
489
|
+
static VALUE rb_gsl_cdf_beta_Pinv(VALUE obj, VALUE pp, VALUE aa, VALUE bb)
|
490
|
+
{
|
491
|
+
double P, a, b;
|
492
|
+
P = NUM2DBL(pp);
|
493
|
+
a = NUM2DBL(aa);
|
494
|
+
b = NUM2DBL(bb);
|
495
|
+
return rb_float_new(gsl_cdf_beta_Pinv(P, a, b));
|
496
|
+
}
|
497
|
+
static VALUE rb_gsl_cdf_beta_Qinv(VALUE obj, VALUE qq, VALUE aa, VALUE bb)
|
498
|
+
{
|
499
|
+
double Q, a, b;
|
500
|
+
Q = NUM2DBL(qq);
|
501
|
+
a = NUM2DBL(aa);
|
502
|
+
b = NUM2DBL(bb);
|
503
|
+
return rb_float_new(gsl_cdf_beta_Qinv(Q, a, b));
|
504
|
+
}
|
505
|
+
static VALUE rb_gsl_cdf_fdist_Pinv(VALUE obj, VALUE pp, VALUE aa, VALUE bb)
|
506
|
+
{
|
507
|
+
double P, a, b;
|
508
|
+
P = NUM2DBL(pp);
|
509
|
+
a = NUM2DBL(aa);
|
510
|
+
b = NUM2DBL(bb);
|
511
|
+
return rb_float_new(gsl_cdf_fdist_Pinv(P, a, b));
|
512
|
+
}
|
513
|
+
static VALUE rb_gsl_cdf_fdist_Qinv(VALUE obj, VALUE qq, VALUE aa, VALUE bb)
|
514
|
+
{
|
515
|
+
double Q, a, b;
|
516
|
+
Q = NUM2DBL(qq);
|
517
|
+
a = NUM2DBL(aa);
|
518
|
+
b = NUM2DBL(bb);
|
519
|
+
return rb_float_new(gsl_cdf_fdist_Qinv(Q, a, b));
|
520
|
+
}
|
521
|
+
#endif
|
522
|
+
|
523
|
+
void Init_gsl_cdf(VALUE module)
|
524
|
+
{
|
525
|
+
VALUE mgsl_cdf;
|
526
|
+
|
527
|
+
mgsl_cdf = rb_define_module_under(module, "Cdf");
|
528
|
+
|
529
|
+
/***** Cumulative distribution functions *****/
|
530
|
+
rb_define_module_function(module, "cdf_gaussian_P", rb_gsl_cdf_gaussian_P, -1);
|
531
|
+
rb_define_module_function(module, "cdf_ugaussian_P", rb_gsl_cdf_gaussian_P, -1);
|
532
|
+
rb_define_module_function(module, "cdf_gaussian_Q", rb_gsl_cdf_gaussian_Q, -1);
|
533
|
+
rb_define_module_function(module, "cdf_ugaussian_Q", rb_gsl_cdf_gaussian_Q, -1);
|
534
|
+
rb_define_module_function(module, "cdf_gaussian_Pinv", rb_gsl_cdf_gaussian_Pinv, -1);
|
535
|
+
rb_define_module_function(module, "cdf_ugaussian_Pinv", rb_gsl_cdf_gaussian_Pinv, -1);
|
536
|
+
rb_define_module_function(module, "cdf_gaussian_Qinv", rb_gsl_cdf_gaussian_Qinv, -1);
|
537
|
+
rb_define_module_function(module, "cdf_ugaussian_Qinv", rb_gsl_cdf_gaussian_Qinv, -1);
|
538
|
+
|
539
|
+
rb_define_module_function(module, "cdf_exponential_P", rb_gsl_cdf_exponential_P, 2);
|
540
|
+
rb_define_module_function(module, "cdf_exponential_Q", rb_gsl_cdf_exponential_Q, 2);
|
541
|
+
rb_define_module_function(module, "cdf_exponential_Pinv", rb_gsl_cdf_exponential_Pinv, 2);
|
542
|
+
rb_define_module_function(module, "cdf_exponential_Qinv", rb_gsl_cdf_exponential_Qinv, 2);
|
543
|
+
|
544
|
+
rb_define_module_function(module, "cdf_laplace_P", rb_gsl_cdf_laplace_P, 2);
|
545
|
+
rb_define_module_function(module, "cdf_laplace_Q", rb_gsl_cdf_laplace_Q, 2);
|
546
|
+
rb_define_module_function(module, "cdf_laplace_Pinv", rb_gsl_cdf_laplace_Pinv, 2);
|
547
|
+
rb_define_module_function(module, "cdf_laplace_Qinv", rb_gsl_cdf_laplace_Qinv, 2);
|
548
|
+
|
549
|
+
rb_define_module_function(module, "cdf_cauchy_P", rb_gsl_cdf_cauchy_P, 2);
|
550
|
+
rb_define_module_function(module, "cdf_cauchy_Q", rb_gsl_cdf_cauchy_Q, 2);
|
551
|
+
rb_define_module_function(module, "cdf_cauchy_Pinv", rb_gsl_cdf_cauchy_Pinv, 2);
|
552
|
+
rb_define_module_function(module, "cdf_cauchy_Qinv", rb_gsl_cdf_cauchy_Qinv, 2);
|
553
|
+
|
554
|
+
rb_define_module_function(module, "cdf_rayleigh_P", rb_gsl_cdf_rayleigh_P, 2);
|
555
|
+
rb_define_module_function(module, "cdf_rayleigh_Q", rb_gsl_cdf_rayleigh_Q, 2);
|
556
|
+
rb_define_module_function(module, "cdf_rayleigh_Pinv", rb_gsl_cdf_rayleigh_Pinv, 2);
|
557
|
+
rb_define_module_function(module, "cdf_rayleigh_Qinv", rb_gsl_cdf_rayleigh_Qinv, 2);
|
558
|
+
|
559
|
+
rb_define_module_function(module, "cdf_gamma_P", rb_gsl_cdf_gamma_P, 3);
|
560
|
+
rb_define_module_function(module, "cdf_gamma_Q", rb_gsl_cdf_gamma_Q, 3);
|
561
|
+
rb_define_module_function(module, "cdf_gamma_Pinv", rb_gsl_cdf_gamma_Pinv, 3);
|
562
|
+
rb_define_module_function(module, "cdf_gamma_Qinv", rb_gsl_cdf_gamma_Qinv, 3);
|
563
|
+
|
564
|
+
rb_define_module_function(module, "cdf_flat_P", rb_gsl_cdf_flat_P, 3);
|
565
|
+
rb_define_module_function(module, "cdf_flat_Q", rb_gsl_cdf_flat_Q, 3);
|
566
|
+
rb_define_module_function(module, "cdf_flat_Pinv", rb_gsl_cdf_flat_Pinv, 3);
|
567
|
+
rb_define_module_function(module, "cdf_flat_Qinv", rb_gsl_cdf_flat_Qinv, 3);
|
568
|
+
|
569
|
+
rb_define_module_function(module, "cdf_lognormal_P", rb_gsl_cdf_lognormal_P, 3);
|
570
|
+
rb_define_module_function(module, "cdf_lognormal_Q", rb_gsl_cdf_lognormal_Q, 3);
|
571
|
+
rb_define_module_function(module, "cdf_lognormal_Pinv", rb_gsl_cdf_lognormal_Pinv, 3);
|
572
|
+
rb_define_module_function(module, "cdf_lognormal_Qinv", rb_gsl_cdf_lognormal_Qinv, 3);
|
573
|
+
|
574
|
+
rb_define_module_function(module, "cdf_chisq_P", rb_gsl_cdf_chisq_P, 2);
|
575
|
+
rb_define_module_function(module, "cdf_chisq_Q", rb_gsl_cdf_chisq_Q, 2);
|
576
|
+
rb_define_module_function(module, "cdf_chisq_Pinv", rb_gsl_cdf_chisq_Pinv, 2);
|
577
|
+
rb_define_module_function(module, "cdf_chisq_Qinv", rb_gsl_cdf_chisq_Qinv, 2);
|
578
|
+
|
579
|
+
rb_define_module_function(module, "cdf_fdist_P", rb_gsl_cdf_fdist_P, 3);
|
580
|
+
rb_define_module_function(module, "cdf_fdist_Q", rb_gsl_cdf_fdist_Q, 3);
|
581
|
+
|
582
|
+
rb_define_module_function(module, "cdf_tdist_P", rb_gsl_cdf_tdist_P, 2);
|
583
|
+
rb_define_module_function(module, "cdf_tdist_Q", rb_gsl_cdf_tdist_Q, 2);
|
584
|
+
rb_define_module_function(module, "cdf_tdist_Pinv", rb_gsl_cdf_tdist_Pinv, 2);
|
585
|
+
rb_define_module_function(module, "cdf_tdist_Qinv", rb_gsl_cdf_tdist_Qinv, 2);
|
586
|
+
|
587
|
+
rb_define_module_function(module, "cdf_beta_P", rb_gsl_cdf_beta_P, 3);
|
588
|
+
rb_define_module_function(module, "cdf_beta_Q", rb_gsl_cdf_beta_Q, 3);
|
589
|
+
|
590
|
+
rb_define_module_function(module, "cdf_logistic_P", rb_gsl_cdf_logistic_P, 2);
|
591
|
+
rb_define_module_function(module, "cdf_logistic_Q", rb_gsl_cdf_logistic_Q, 2);
|
592
|
+
rb_define_module_function(module, "cdf_logistic_Pinv", rb_gsl_cdf_logistic_Pinv, 2);
|
593
|
+
rb_define_module_function(module, "cdf_logistic_Qinv", rb_gsl_cdf_logistic_Qinv, 2);
|
594
|
+
|
595
|
+
rb_define_module_function(module, "cdf_pareto_P", rb_gsl_cdf_pareto_P, 3);
|
596
|
+
rb_define_module_function(module, "cdf_pareto_Q", rb_gsl_cdf_pareto_Q, 3);
|
597
|
+
rb_define_module_function(module, "cdf_pareto_Pinv", rb_gsl_cdf_pareto_Pinv, 3);
|
598
|
+
rb_define_module_function(module, "cdf_pareto_Qinv", rb_gsl_cdf_pareto_Qinv, 3);
|
599
|
+
|
600
|
+
rb_define_module_function(module, "cdf_weibull_P", rb_gsl_cdf_weibull_P, 3);
|
601
|
+
rb_define_module_function(module, "cdf_weibull_Q", rb_gsl_cdf_weibull_Q, 3);
|
602
|
+
rb_define_module_function(module, "cdf_weibull_Pinv", rb_gsl_cdf_weibull_Pinv, 3);
|
603
|
+
rb_define_module_function(module, "cdf_weibull_Qinv", rb_gsl_cdf_weibull_Qinv, 3);
|
604
|
+
|
605
|
+
rb_define_module_function(module, "cdf_gumbel1_P", rb_gsl_cdf_gumbel1_P, 3);
|
606
|
+
rb_define_module_function(module, "cdf_gumbel1_Q", rb_gsl_cdf_gumbel1_Q, 3);
|
607
|
+
rb_define_module_function(module, "cdf_gumbel1_Pinv", rb_gsl_cdf_gumbel1_Pinv, 3);
|
608
|
+
rb_define_module_function(module, "cdf_gumbel1_Qinv", rb_gsl_cdf_gumbel1_Qinv, 3);
|
609
|
+
|
610
|
+
rb_define_module_function(module, "cdf_gumbel2_P", rb_gsl_cdf_gumbel2_P, 3);
|
611
|
+
rb_define_module_function(module, "cdf_gumbel2_Q", rb_gsl_cdf_gumbel2_Q, 3);
|
612
|
+
rb_define_module_function(module, "cdf_gumbel2_Pinv", rb_gsl_cdf_gumbel2_Pinv, 3);
|
613
|
+
rb_define_module_function(module, "cdf_gumbel2_Qinv", rb_gsl_cdf_gumbel2_Qinv, 3);
|
614
|
+
|
615
|
+
/*****/
|
616
|
+
|
617
|
+
rb_define_module_function(mgsl_cdf, "gaussian_P", rb_gsl_cdf_gaussian_P, -1);
|
618
|
+
rb_define_module_function(mgsl_cdf, "gaussian_Q", rb_gsl_cdf_gaussian_Q, -1);
|
619
|
+
rb_define_module_function(mgsl_cdf, "gaussian_Pinv", rb_gsl_cdf_gaussian_Pinv, -1);
|
620
|
+
rb_define_module_function(mgsl_cdf, "gaussian_Qinv", rb_gsl_cdf_gaussian_Qinv, -1);
|
621
|
+
rb_define_module_function(mgsl_cdf, "ugaussian_P", rb_gsl_cdf_gaussian_P, -1);
|
622
|
+
rb_define_module_function(mgsl_cdf, "ugaussian_Q", rb_gsl_cdf_gaussian_Q, -1);
|
623
|
+
rb_define_module_function(mgsl_cdf, "ugaussian_Pinv", rb_gsl_cdf_gaussian_Pinv, -1);
|
624
|
+
rb_define_module_function(mgsl_cdf, "ugaussian_Qinv", rb_gsl_cdf_gaussian_Qinv, -1);
|
625
|
+
|
626
|
+
rb_define_module_function(mgsl_cdf, "exponential_P", rb_gsl_cdf_exponential_P, 2);
|
627
|
+
rb_define_module_function(mgsl_cdf, "exponential_Q", rb_gsl_cdf_exponential_Q, 2);
|
628
|
+
rb_define_module_function(mgsl_cdf, "exponential_Pinv", rb_gsl_cdf_exponential_Pinv, 2);
|
629
|
+
rb_define_module_function(mgsl_cdf, "exponential_Qinv", rb_gsl_cdf_exponential_Qinv, 2);
|
630
|
+
|
631
|
+
rb_define_module_function(mgsl_cdf, "laplace_P", rb_gsl_cdf_laplace_P, 2);
|
632
|
+
rb_define_module_function(mgsl_cdf, "laplace_Q", rb_gsl_cdf_laplace_Q, 2);
|
633
|
+
rb_define_module_function(mgsl_cdf, "laplace_Pinv", rb_gsl_cdf_laplace_Pinv, 2);
|
634
|
+
rb_define_module_function(mgsl_cdf, "laplace_Qinv", rb_gsl_cdf_laplace_Qinv, 2);
|
635
|
+
|
636
|
+
rb_define_module_function(mgsl_cdf, "cauchy_P", rb_gsl_cdf_cauchy_P, 2);
|
637
|
+
rb_define_module_function(mgsl_cdf, "cauchy_Q", rb_gsl_cdf_cauchy_Q, 2);
|
638
|
+
rb_define_module_function(mgsl_cdf, "cauchy_Pinv", rb_gsl_cdf_cauchy_Pinv, 2);
|
639
|
+
rb_define_module_function(mgsl_cdf, "cauchy_Qinv", rb_gsl_cdf_cauchy_Qinv, 2);
|
640
|
+
|
641
|
+
rb_define_module_function(mgsl_cdf, "rayleigh_P", rb_gsl_cdf_rayleigh_P, 2);
|
642
|
+
rb_define_module_function(mgsl_cdf, "rayleigh_Q", rb_gsl_cdf_rayleigh_Q, 2);
|
643
|
+
rb_define_module_function(mgsl_cdf, "rayleigh_Pinv", rb_gsl_cdf_rayleigh_Pinv, 2);
|
644
|
+
rb_define_module_function(mgsl_cdf, "rayleigh_Qinv", rb_gsl_cdf_rayleigh_Qinv, 2);
|
645
|
+
|
646
|
+
rb_define_module_function(mgsl_cdf, "gamma_P", rb_gsl_cdf_gamma_P, 3);
|
647
|
+
rb_define_module_function(mgsl_cdf, "gamma_Q", rb_gsl_cdf_gamma_Q, 3);
|
648
|
+
rb_define_module_function(mgsl_cdf, "gamma_Pinv", rb_gsl_cdf_gamma_Pinv, 3);
|
649
|
+
rb_define_module_function(mgsl_cdf, "gamma_Qinv", rb_gsl_cdf_gamma_Qinv, 3);
|
650
|
+
|
651
|
+
rb_define_module_function(mgsl_cdf, "flat_P", rb_gsl_cdf_flat_P, 3);
|
652
|
+
rb_define_module_function(mgsl_cdf, "flat_Q", rb_gsl_cdf_flat_Q, 3);
|
653
|
+
rb_define_module_function(mgsl_cdf, "flat_Pinv", rb_gsl_cdf_flat_Pinv, 3);
|
654
|
+
rb_define_module_function(mgsl_cdf, "flat_Qinv", rb_gsl_cdf_flat_Qinv, 3);
|
655
|
+
|
656
|
+
rb_define_module_function(mgsl_cdf, "lognormal_P", rb_gsl_cdf_lognormal_P, 3);
|
657
|
+
rb_define_module_function(mgsl_cdf, "lognormal_Q", rb_gsl_cdf_lognormal_Q, 3);
|
658
|
+
rb_define_module_function(mgsl_cdf, "lognormal_Pinv", rb_gsl_cdf_lognormal_Pinv, 3);
|
659
|
+
rb_define_module_function(mgsl_cdf, "lognormal_Qinv", rb_gsl_cdf_lognormal_Qinv, 3);
|
660
|
+
|
661
|
+
rb_define_module_function(mgsl_cdf, "chisq_P", rb_gsl_cdf_chisq_P, 2);
|
662
|
+
rb_define_module_function(mgsl_cdf, "chisq_Q", rb_gsl_cdf_chisq_Q, 2);
|
663
|
+
rb_define_module_function(mgsl_cdf, "chisq_Pinv", rb_gsl_cdf_chisq_Pinv, 2);
|
664
|
+
rb_define_module_function(mgsl_cdf, "chisq_Qinv", rb_gsl_cdf_chisq_Qinv, 2);
|
665
|
+
|
666
|
+
rb_define_module_function(mgsl_cdf, "fdist_P", rb_gsl_cdf_fdist_P, 3);
|
667
|
+
rb_define_module_function(mgsl_cdf, "fdist_Q", rb_gsl_cdf_fdist_Q, 3);
|
668
|
+
|
669
|
+
rb_define_module_function(mgsl_cdf, "tdist_P", rb_gsl_cdf_tdist_P, 2);
|
670
|
+
rb_define_module_function(mgsl_cdf, "tdist_Q", rb_gsl_cdf_tdist_Q, 2);
|
671
|
+
rb_define_module_function(mgsl_cdf, "tdist_Pinv", rb_gsl_cdf_tdist_Pinv, 2);
|
672
|
+
rb_define_module_function(mgsl_cdf, "tdist_Qinv", rb_gsl_cdf_tdist_Qinv, 2);
|
673
|
+
|
674
|
+
rb_define_module_function(mgsl_cdf, "beta_P", rb_gsl_cdf_beta_P, 3);
|
675
|
+
rb_define_module_function(mgsl_cdf, "beta_Q", rb_gsl_cdf_beta_Q, 3);
|
676
|
+
|
677
|
+
rb_define_module_function(mgsl_cdf, "logistic_P", rb_gsl_cdf_logistic_P, 2);
|
678
|
+
rb_define_module_function(mgsl_cdf, "logistic_Q", rb_gsl_cdf_logistic_Q, 2);
|
679
|
+
rb_define_module_function(mgsl_cdf, "logistic_Pinv", rb_gsl_cdf_logistic_Pinv, 2);
|
680
|
+
rb_define_module_function(mgsl_cdf, "logistic_Qinv", rb_gsl_cdf_logistic_Qinv, 2);
|
681
|
+
|
682
|
+
rb_define_module_function(mgsl_cdf, "pareto_P", rb_gsl_cdf_pareto_P, 3);
|
683
|
+
rb_define_module_function(mgsl_cdf, "pareto_Q", rb_gsl_cdf_pareto_Q, 3);
|
684
|
+
rb_define_module_function(mgsl_cdf, "pareto_Pinv", rb_gsl_cdf_pareto_Pinv, 3);
|
685
|
+
rb_define_module_function(mgsl_cdf, "pareto_Qinv", rb_gsl_cdf_pareto_Qinv, 3);
|
686
|
+
|
687
|
+
rb_define_module_function(mgsl_cdf, "weibull_P", rb_gsl_cdf_weibull_P, 3);
|
688
|
+
rb_define_module_function(mgsl_cdf, "weibull_Q", rb_gsl_cdf_weibull_Q, 3);
|
689
|
+
rb_define_module_function(mgsl_cdf, "weibull_Pinv", rb_gsl_cdf_weibull_Pinv, 3);
|
690
|
+
rb_define_module_function(mgsl_cdf, "weibull_Qinv", rb_gsl_cdf_weibull_Qinv, 3);
|
691
|
+
|
692
|
+
rb_define_module_function(mgsl_cdf, "gumbel1_P", rb_gsl_cdf_gumbel1_P, 3);
|
693
|
+
rb_define_module_function(mgsl_cdf, "gumbel1_Q", rb_gsl_cdf_gumbel1_Q, 3);
|
694
|
+
rb_define_module_function(mgsl_cdf, "gumbel1_Pinv", rb_gsl_cdf_gumbel1_Pinv, 3);
|
695
|
+
rb_define_module_function(mgsl_cdf, "gumbel1_Qinv", rb_gsl_cdf_gumbel1_Qinv, 3);
|
696
|
+
|
697
|
+
rb_define_module_function(mgsl_cdf, "gumbel2_P", rb_gsl_cdf_gumbel2_P, 3);
|
698
|
+
rb_define_module_function(mgsl_cdf, "gumbel2_Q", rb_gsl_cdf_gumbel2_Q, 3);
|
699
|
+
rb_define_module_function(mgsl_cdf, "gumbel2_Pinv", rb_gsl_cdf_gumbel2_Pinv, 3);
|
700
|
+
rb_define_module_function(mgsl_cdf, "gumbel2_Qinv", rb_gsl_cdf_gumbel2_Qinv, 3);
|
701
|
+
|
702
|
+
|
703
|
+
#ifdef GSL_1_6_LATER
|
704
|
+
rb_define_module_function(module, "cdf_exppow_P", rb_gsl_cdf_exppow_P, 3);
|
705
|
+
rb_define_module_function(module, "cdf_exppow_Q", rb_gsl_cdf_exppow_Q, 3);
|
706
|
+
|
707
|
+
rb_define_module_function(mgsl_cdf, "exppow_P", rb_gsl_cdf_exppow_P, 3);
|
708
|
+
rb_define_module_function(mgsl_cdf, "exppow_Q", rb_gsl_cdf_exppow_Q, 3);
|
709
|
+
#endif
|
710
|
+
|
711
|
+
#ifdef GSL_1_8_LATER
|
712
|
+
rb_define_module_function(module, "cdf_binomial_P", rb_gsl_cdf_binomial_P, 3);
|
713
|
+
rb_define_module_function(module, "cdf_binomial_Q", rb_gsl_cdf_binomial_Q, 3);
|
714
|
+
rb_define_module_function(mgsl_cdf, "binomial_P", rb_gsl_cdf_binomial_P, 3);
|
715
|
+
rb_define_module_function(mgsl_cdf, "binomial_Q", rb_gsl_cdf_binomial_Q, 3);
|
716
|
+
|
717
|
+
rb_define_module_function(module, "cdf_poisson_P", rb_gsl_cdf_poisson_P, 2);
|
718
|
+
rb_define_module_function(module, "cdf_poisson_Q", rb_gsl_cdf_poisson_Q, 2);
|
719
|
+
rb_define_module_function(mgsl_cdf, "poisson_P", rb_gsl_cdf_poisson_P, 2);
|
720
|
+
rb_define_module_function(mgsl_cdf, "poisson_Q", rb_gsl_cdf_poisson_Q, 2);
|
721
|
+
|
722
|
+
rb_define_module_function(module, "cdf_geometric_P", rb_gsl_cdf_geometric_P, 2);
|
723
|
+
rb_define_module_function(module, "cdf_geometric_Q", rb_gsl_cdf_geometric_Q, 2);
|
724
|
+
rb_define_module_function(mgsl_cdf, "geometric_P", rb_gsl_cdf_geometric_P, 2);
|
725
|
+
rb_define_module_function(mgsl_cdf, "geometric_Q", rb_gsl_cdf_geometric_Q, 2);
|
726
|
+
|
727
|
+
rb_define_module_function(module, "cdf_negative_binomial_P", rb_gsl_cdf_negative_binomial_P, 3);
|
728
|
+
rb_define_module_function(module, "cdf_negative_binomial_Q", rb_gsl_cdf_negative_binomial_Q, 3);
|
729
|
+
rb_define_module_function(mgsl_cdf, "negative_binomial_P", rb_gsl_cdf_negative_binomial_P, 3);
|
730
|
+
rb_define_module_function(mgsl_cdf, "negative_binomial_Q", rb_gsl_cdf_negative_binomial_Q, 3);
|
731
|
+
|
732
|
+
rb_define_module_function(module, "cdf_pascal_P", rb_gsl_cdf_pascal_P, 3);
|
733
|
+
rb_define_module_function(module, "cdf_pascal_Q", rb_gsl_cdf_pascal_Q, 3);
|
734
|
+
rb_define_module_function(mgsl_cdf, "pascal_P", rb_gsl_cdf_pascal_P, 3);
|
735
|
+
rb_define_module_function(mgsl_cdf, "pascal_Q", rb_gsl_cdf_pascal_Q, 3);
|
736
|
+
|
737
|
+
rb_define_module_function(module, "cdf_hypergeometric_P", rb_gsl_cdf_hypergeometric_P, 4);
|
738
|
+
rb_define_module_function(module, "cdf_hypergeometric_Q", rb_gsl_cdf_hypergeometric_Q, 4);
|
739
|
+
rb_define_module_function(mgsl_cdf, "hypergeometric_P", rb_gsl_cdf_hypergeometric_P, 4);
|
740
|
+
rb_define_module_function(mgsl_cdf, "hypergeometric_Q", rb_gsl_cdf_hypergeometric_Q, 4);
|
741
|
+
|
742
|
+
rb_define_module_function(module, "cdf_beta_Pinv", rb_gsl_cdf_beta_Pinv, 3);
|
743
|
+
rb_define_module_function(mgsl_cdf, "beta_Pinv", rb_gsl_cdf_beta_Pinv, 3);
|
744
|
+
rb_define_module_function(module, "cdf_beta_Qinv", rb_gsl_cdf_beta_Qinv, 3);
|
745
|
+
rb_define_module_function(mgsl_cdf, "beta_Qinv", rb_gsl_cdf_beta_Qinv, 3);
|
746
|
+
|
747
|
+
rb_define_module_function(module, "cdf_fdist_Pinv", rb_gsl_cdf_fdist_Pinv, 3);
|
748
|
+
rb_define_module_function(mgsl_cdf, "fdist_Pinv", rb_gsl_cdf_fdist_Pinv, 3);
|
749
|
+
rb_define_module_function(module, "cdf_fdist_Qinv", rb_gsl_cdf_fdist_Qinv, 3);
|
750
|
+
rb_define_module_function(mgsl_cdf, "fdist_Qinv", rb_gsl_cdf_fdist_Qinv, 3);
|
751
|
+
#endif
|
752
|
+
|
753
|
+
}
|
754
|
+
#endif
|