numo-gsl 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/README.md +84 -0
- data/Rakefile +16 -0
- data/ext/numo/gsl/cdf/depend +17 -0
- data/ext/numo/gsl/cdf/erbpp_cdf.rb +44 -0
- data/ext/numo/gsl/cdf/extconf.rb +9 -0
- data/ext/numo/gsl/cdf/func_def.rb +610 -0
- data/ext/numo/gsl/const/const_def.rb +419 -0
- data/ext/numo/gsl/const/depend +17 -0
- data/ext/numo/gsl/const/erbpp_const.rb +30 -0
- data/ext/numo/gsl/const/extconf.rb +9 -0
- data/ext/numo/gsl/err/depend +1 -0
- data/ext/numo/gsl/err/err.c +22 -0
- data/ext/numo/gsl/err/extconf.rb +9 -0
- data/ext/numo/gsl/extconf_gsl.rb +44 -0
- data/ext/numo/gsl/fit/depend +17 -0
- data/ext/numo/gsl/fit/erbpp_fit.rb +74 -0
- data/ext/numo/gsl/fit/extconf.rb +9 -0
- data/ext/numo/gsl/fit/func_def.rb +129 -0
- data/ext/numo/gsl/fit/tmpl/check_1d.c +9 -0
- data/ext/numo/gsl/fit/tmpl/fit_linear.c +53 -0
- data/ext/numo/gsl/fit/tmpl/fit_linear_est.c +56 -0
- data/ext/numo/gsl/fit/tmpl/fit_mul.c +50 -0
- data/ext/numo/gsl/fit/tmpl/fit_mul_est.c +47 -0
- data/ext/numo/gsl/fit/tmpl/fit_wlinear.c +59 -0
- data/ext/numo/gsl/fit/tmpl/fit_wmul.c +56 -0
- data/ext/numo/gsl/gen/erbpp2.rb +306 -0
- data/ext/numo/gsl/gen/erbpp_gsl.rb +166 -0
- data/ext/numo/gsl/gen/func_parser.rb +520 -0
- data/ext/numo/gsl/gen/tmpl/c_DFloat_f_DFloat.c +40 -0
- data/ext/numo/gsl/gen/tmpl/c_DFloat_f_SZ.c +41 -0
- data/ext/numo/gsl/gen/tmpl/c_DFloat_f_SZ_x2.c +44 -0
- data/ext/numo/gsl/gen/tmpl/c_DFloat_x2_f_DFloat_x2.c +45 -0
- data/ext/numo/gsl/gen/tmpl/c_double_f_double.c +16 -0
- data/ext/numo/gsl/gen/tmpl/c_double_f_sizet.c +16 -0
- data/ext/numo/gsl/gen/tmpl/c_double_f_sizet_x2.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_double_f_void.c +15 -0
- data/ext/numo/gsl/gen/tmpl/c_double_x2_f_void.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_new_DFloat.c +29 -0
- data/ext/numo/gsl/gen/tmpl/c_new_double.c +22 -0
- data/ext/numo/gsl/gen/tmpl/c_new_f_other.c +25 -0
- data/ext/numo/gsl/gen/tmpl/c_new_sizet.c +22 -0
- data/ext/numo/gsl/gen/tmpl/c_new_sizet_double.c +23 -0
- data/ext/numo/gsl/gen/tmpl/c_new_sizet_x2.c +23 -0
- data/ext/numo/gsl/gen/tmpl/c_new_void.c +21 -0
- data/ext/numo/gsl/gen/tmpl/c_other_f_void.c +19 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat.c +46 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x2.c +41 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x3.c +44 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x4.c +47 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_SZ_x2_DFloat.c +45 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_double.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_other.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_sizet.c +21 -0
- data/ext/numo/gsl/gen/tmpl/c_self_f_void.c +14 -0
- data/ext/numo/gsl/gen/tmpl/c_sizet_f_void.c +15 -0
- data/ext/numo/gsl/gen/tmpl/c_sizet_x2_f_void.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_str_f_void.c +15 -0
- data/ext/numo/gsl/gen/tmpl/c_super_new_void.c +18 -0
- data/ext/numo/gsl/gen/tmpl/c_uint_f_void.c +15 -0
- data/ext/numo/gsl/gen/tmpl/c_ulong_f_void.c +15 -0
- data/ext/numo/gsl/gen/tmpl/c_void_f_double.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_void_f_double_x2.c +18 -0
- data/ext/numo/gsl/gen/tmpl/c_void_f_double_x4.c +20 -0
- data/ext/numo/gsl/gen/tmpl/c_void_f_ulong.c +17 -0
- data/ext/numo/gsl/gen/tmpl/c_void_f_void.c +14 -0
- data/ext/numo/gsl/gen/tmpl/cast_1d_contiguous.c +15 -0
- data/ext/numo/gsl/gen/tmpl/cast_2d_contiguous.c +15 -0
- data/ext/numo/gsl/gen/tmpl/class.c +26 -0
- data/ext/numo/gsl/gen/tmpl/create_new_narray.c +26 -0
- data/ext/numo/gsl/gen/tmpl/init_class.c +10 -0
- data/ext/numo/gsl/gen/tmpl/init_module.c +12 -0
- data/ext/numo/gsl/gen/tmpl/lib.c +41 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_Int_f_DFloat.c +38 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat.c +35 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_Int.c +39 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_UInt.c +39 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_double.c +42 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_double_x2.c +47 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_int.c +42 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_x2.c +38 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_x3.c +41 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_Int.c +36 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt.c +36 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32.c +36 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double.c +43 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double_uint.c +49 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double_x2.c +48 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_uint_x3.c +51 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double.c +43 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double_uint.c +50 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double_x2.c +48 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_uint_x3.c +51 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_DFloat.c +41 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_DFloat_x2.c +44 -0
- data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_x2_DFloat_x2.c +46 -0
- data/ext/numo/gsl/gen/tmpl/m_Int_f_DFloat.c +36 -0
- data/ext/numo/gsl/gen/tmpl/m_Int_f_DFloat_x3.c +42 -0
- data/ext/numo/gsl/gen/tmpl/m_Int_f_int_DFloat.c +42 -0
- data/ext/numo/gsl/gen/tmpl/m_Int_f_int_DFloat_x2.c +45 -0
- data/ext/numo/gsl/gen/tmpl/mod_func_noloop.c +54 -0
- data/ext/numo/gsl/gen/tmpl/mod_func_scalar.c +27 -0
- data/ext/numo/gsl/gen/tmpl/module.c +9 -0
- data/ext/numo/gsl/histogram/depend +17 -0
- data/ext/numo/gsl/histogram/erbpp_histogram.rb +109 -0
- data/ext/numo/gsl/histogram/extconf.rb +9 -0
- data/ext/numo/gsl/histogram/func_def.rb +763 -0
- data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_2d_get.c +54 -0
- data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_field.c +35 -0
- data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_get.c +47 -0
- data/ext/numo/gsl/histogram/tmpl/c_DFloat_x2_f_get_range.c +56 -0
- data/ext/numo/gsl/histogram/tmpl/c_bool_f_other.c +19 -0
- data/ext/numo/gsl/histogram/tmpl/c_bool_f_pdf_init.c +24 -0
- data/ext/numo/gsl/histogram/tmpl/c_self_f_2d_set_ranges.c +26 -0
- data/ext/numo/gsl/histogram/tmpl/c_self_f_set_ranges.c +21 -0
- data/ext/numo/gsl/histogram/tmpl/c_sizet_f_field.c +15 -0
- data/ext/numo/gsl/interp/depend +17 -0
- data/ext/numo/gsl/interp/erbpp_interp.rb +59 -0
- data/ext/numo/gsl/interp/extconf.rb +9 -0
- data/ext/numo/gsl/interp/func_def.rb +816 -0
- data/ext/numo/gsl/interp/parse_interp.rb +67 -0
- data/ext/numo/gsl/interp/tmpl/interp2d_new.c +36 -0
- data/ext/numo/gsl/interp/tmpl/interp2d_type_new.c +17 -0
- data/ext/numo/gsl/interp/tmpl/interp_bsearch.c +57 -0
- data/ext/numo/gsl/interp/tmpl/interp_new.c +29 -0
- data/ext/numo/gsl/interp/tmpl/interp_type_new.c +16 -0
- data/ext/numo/gsl/interp/tmpl/spline2d_eval.c +61 -0
- data/ext/numo/gsl/interp/tmpl/spline_eval.c +55 -0
- data/ext/numo/gsl/interp/tmpl/spline_integ.c +56 -0
- data/ext/numo/gsl/interp/type_def.rb +9 -0
- data/ext/numo/gsl/multifit/depend +17 -0
- data/ext/numo/gsl/multifit/erbpp_multifit.rb +99 -0
- data/ext/numo/gsl/multifit/extconf.rb +9 -0
- data/ext/numo/gsl/multifit/func_2.1.rb +1035 -0
- data/ext/numo/gsl/multifit/func_2.2.1.rb +736 -0
- data/ext/numo/gsl/multifit/func_2.2.rb +736 -0
- data/ext/numo/gsl/multifit/func_2.3.rb +872 -0
- data/ext/numo/gsl/multifit/func_def.rb +1012 -0
- data/ext/numo/gsl/multifit/tmpl/multifit_linear.c +66 -0
- data/ext/numo/gsl/multifit/tmpl/multifit_linear_est.c +48 -0
- data/ext/numo/gsl/multifit/tmpl/multifit_linear_residuals.c +47 -0
- data/ext/numo/gsl/multifit/tmpl/multifit_wlinear.c +70 -0
- data/ext/numo/gsl/multifit/type_def.rb +1 -0
- data/ext/numo/gsl/numo_gsl.h +117 -0
- data/ext/numo/gsl/pdf/depend +17 -0
- data/ext/numo/gsl/pdf/erbpp_pdf.rb +26 -0
- data/ext/numo/gsl/pdf/extconf.rb +9 -0
- data/ext/numo/gsl/pdf/func_2.2.1.rb +306 -0
- data/ext/numo/gsl/pdf/func_2.2.rb +306 -0
- data/ext/numo/gsl/pdf/func_2.3.rb +306 -0
- data/ext/numo/gsl/pdf/func_def.rb +282 -0
- data/ext/numo/gsl/pdf/parse_pdf.rb +42 -0
- data/ext/numo/gsl/pdf/tmpl/dirichlet.c +39 -0
- data/ext/numo/gsl/pdf/tmpl/multinomial.c +39 -0
- data/ext/numo/gsl/poly/depend +17 -0
- data/ext/numo/gsl/poly/erbpp_poly.rb +70 -0
- data/ext/numo/gsl/poly/extconf.rb +9 -0
- data/ext/numo/gsl/poly/func_def.rb +234 -0
- data/ext/numo/gsl/poly/tmpl/poly_complex_solve.c +59 -0
- data/ext/numo/gsl/poly/tmpl/poly_eval.c +70 -0
- data/ext/numo/gsl/poly/tmpl/poly_eval_derivs.c +40 -0
- data/ext/numo/gsl/ran/depend +17 -0
- data/ext/numo/gsl/ran/erbpp_ran.rb +42 -0
- data/ext/numo/gsl/ran/extconf.rb +9 -0
- data/ext/numo/gsl/ran/func_2.2.1.rb +1658 -0
- data/ext/numo/gsl/ran/func_2.2.rb +1658 -0
- data/ext/numo/gsl/ran/func_2.3.rb +1658 -0
- data/ext/numo/gsl/ran/func_def.rb +1594 -0
- data/ext/numo/gsl/ran/parse_ran.rb +10 -0
- data/ext/numo/gsl/rng/depend +17 -0
- data/ext/numo/gsl/rng/erbpp_rng.rb +58 -0
- data/ext/numo/gsl/rng/extconf.rb +9 -0
- data/ext/numo/gsl/rng/func_def.rb +230 -0
- data/ext/numo/gsl/rng/parse_rng.rb +125 -0
- data/ext/numo/gsl/rng/tmpl/ran.c +40 -0
- data/ext/numo/gsl/rng/tmpl/ran_DFloat_f_DFloat.c +28 -0
- data/ext/numo/gsl/rng/tmpl/ran_DFloat_x2.c +45 -0
- data/ext/numo/gsl/rng/tmpl/ran_DFloat_x3.c +51 -0
- data/ext/numo/gsl/rng/tmpl/ran_multinomial.c +32 -0
- data/ext/numo/gsl/rng/tmpl/rng_DFloat.c +29 -0
- data/ext/numo/gsl/rng/tmpl/rng_UInt.c +44 -0
- data/ext/numo/gsl/rng/tmpl/rng_alloc.c +24 -0
- data/ext/numo/gsl/rng/tmpl/rng_type_new.c +14 -0
- data/ext/numo/gsl/rng/type_def.rb +63 -0
- data/ext/numo/gsl/rstat/depend +17 -0
- data/ext/numo/gsl/rstat/erbpp_rstat.rb +64 -0
- data/ext/numo/gsl/rstat/extconf.rb +9 -0
- data/ext/numo/gsl/rstat/func_2.2.1.rb +116 -0
- data/ext/numo/gsl/rstat/func_2.2.rb +116 -0
- data/ext/numo/gsl/rstat/func_2.3.rb +123 -0
- data/ext/numo/gsl/rstat/func_def.rb +102 -0
- data/ext/numo/gsl/sf/depend +17 -0
- data/ext/numo/gsl/sf/erbpp_sf.rb +51 -0
- data/ext/numo/gsl/sf/extconf.rb +9 -0
- data/ext/numo/gsl/sf/func_def.rb +4703 -0
- data/ext/numo/gsl/sf/parse_sf.rb +277 -0
- data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x2_DFloat.c +50 -0
- data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x2_DFloat_x2.c +52 -0
- data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x3_DFloat_x2.c +55 -0
- data/ext/numo/gsl/sf/tmpl/m_DFloat_f_DFloat_mode.c +47 -0
- data/ext/numo/gsl/sf/tmpl/m_DFloat_f_lmax_array.c +41 -0
- data/ext/numo/gsl/sf/tmpl/m_DFloat_f_nmin_nmax_array.c +49 -0
- data/ext/numo/gsl/spmatrix/const_2.2.1.rb +3 -0
- data/ext/numo/gsl/spmatrix/const_2.2.rb +3 -0
- data/ext/numo/gsl/spmatrix/const_2.3.rb +3 -0
- data/ext/numo/gsl/spmatrix/const_def.rb +2 -0
- data/ext/numo/gsl/spmatrix/depend +17 -0
- data/ext/numo/gsl/spmatrix/erbpp_spmatrix.rb +100 -0
- data/ext/numo/gsl/spmatrix/extconf.rb +9 -0
- data/ext/numo/gsl/spmatrix/func_2.2.1.rb +297 -0
- data/ext/numo/gsl/spmatrix/func_2.2.rb +297 -0
- data/ext/numo/gsl/spmatrix/func_2.3.rb +297 -0
- data/ext/numo/gsl/spmatrix/func_def.rb +218 -0
- data/ext/numo/gsl/spmatrix/parse_spmatrix.rb +70 -0
- data/ext/numo/gsl/spmatrix/tmpl/itersolve_iterate.c +47 -0
- data/ext/numo/gsl/spmatrix/tmpl/itersolve_new.c +22 -0
- data/ext/numo/gsl/spmatrix/tmpl/itersolve_type_new.c +16 -0
- data/ext/numo/gsl/spmatrix/tmpl/spblas_dgemm.c +35 -0
- data/ext/numo/gsl/spmatrix/tmpl/spblas_dgemv.c +43 -0
- data/ext/numo/gsl/spmatrix/tmpl/spmatrix_add.c +22 -0
- data/ext/numo/gsl/spmatrix/tmpl/spmatrix_d2sp.c +28 -0
- data/ext/numo/gsl/spmatrix/tmpl/spmatrix_new.c +40 -0
- data/ext/numo/gsl/spmatrix/tmpl/spmatrix_sp2d.c +25 -0
- data/ext/numo/gsl/spmatrix/type_def.rb +1 -0
- data/ext/numo/gsl/stats/depend +17 -0
- data/ext/numo/gsl/stats/erbpp_stats.rb +29 -0
- data/ext/numo/gsl/stats/extconf.rb +9 -0
- data/ext/numo/gsl/stats/func_2.2.1.rb +608 -0
- data/ext/numo/gsl/stats/func_2.2.rb +608 -0
- data/ext/numo/gsl/stats/func_2.3.rb +608 -0
- data/ext/numo/gsl/stats/func_def.rb +608 -0
- data/ext/numo/gsl/stats/parse_stats.rb +63 -0
- data/ext/numo/gsl/stats/tmpl/stats_1a0p.c +37 -0
- data/ext/numo/gsl/stats/tmpl/stats_1a0p_index.c +60 -0
- data/ext/numo/gsl/stats/tmpl/stats_1a1p.c +41 -0
- data/ext/numo/gsl/stats/tmpl/stats_1a2p.c +42 -0
- data/ext/numo/gsl/stats/tmpl/stats_2a0p.c +39 -0
- data/ext/numo/gsl/stats/tmpl/stats_2a1p.c +43 -0
- data/ext/numo/gsl/stats/tmpl/stats_2a2p.c +44 -0
- data/ext/numo/gsl/stats/tmpl/stats_minmax.c +37 -0
- data/ext/numo/gsl/stats/tmpl/stats_minmax_index.c +67 -0
- data/ext/numo/gsl/stats/tmpl/stats_spearman.c +46 -0
- data/ext/numo/gsl/sys/const_def.rb +21 -0
- data/ext/numo/gsl/sys/depend +17 -0
- data/ext/numo/gsl/sys/enum_def.rb +75 -0
- data/ext/numo/gsl/sys/erbpp_sys.rb +60 -0
- data/ext/numo/gsl/sys/extconf.rb +9 -0
- data/ext/numo/gsl/sys/func_def.rb +249 -0
- data/ext/numo/gsl/version.h +1 -0
- data/ext/numo/gsl/wavelet/depend +17 -0
- data/ext/numo/gsl/wavelet/erbpp_wavelet.rb +48 -0
- data/ext/numo/gsl/wavelet/extconf.rb +9 -0
- data/ext/numo/gsl/wavelet/func_def.rb +337 -0
- data/ext/numo/gsl/wavelet/parse_wavelet.rb +47 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet2d_transform.c +56 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_array_check.c +56 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_macro.c +1 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_new.c +20 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_transform.c +55 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_transform2.c +22 -0
- data/ext/numo/gsl/wavelet/tmpl/wavelet_type_new.c +15 -0
- data/ext/numo/gsl/wavelet/type_def.rb +6 -0
- data/lib/numo/gsl.rb +17 -0
- data/numo-gsl.gemspec +33 -0
- metadata +367 -0
@@ -0,0 +1,54 @@
|
|
1
|
+
static void
|
2
|
+
iter_<%=c_func%>(na_loop_t *const lp)
|
3
|
+
{
|
4
|
+
<% @parsed_args.each do |a| %>
|
5
|
+
<%= a.def_var %><%end%>
|
6
|
+
<% if n_param > 1 %>
|
7
|
+
void **opt = (void**)(lp->opt_ptr);
|
8
|
+
<% args_param.each_with_index do |a,i| %>
|
9
|
+
<%= a.get_param("opt[#{i}]") %><%end%>
|
10
|
+
<% elsif n_param == 1 %>
|
11
|
+
void *opt = (void*)(lp->opt_ptr);
|
12
|
+
<%= args_param[0].get_param("opt") %><%end%>
|
13
|
+
|
14
|
+
<% args_in.each do |a| %>
|
15
|
+
<%= a.get_data("lp") %><%end%>
|
16
|
+
<% args_out.each do |a| %>
|
17
|
+
<%= a.get_ptr("lp") %><%end%>
|
18
|
+
<%=recv%><%=func_name%>(<%=c_args%>);
|
19
|
+
<% args_out.each do |a| %>
|
20
|
+
<%= a.set_data("lp") %><%end%>
|
21
|
+
}
|
22
|
+
|
23
|
+
/*
|
24
|
+
@overload <%=name%>(<%=method_args%>)
|
25
|
+
<% desc_param.each do |x|%>
|
26
|
+
<%=x%><%end%>
|
27
|
+
|
28
|
+
<%=desc%>
|
29
|
+
*/
|
30
|
+
static VALUE
|
31
|
+
<%=c_func%>(<%=cdef_args%>)
|
32
|
+
{
|
33
|
+
<% args_param.each do |a| %>
|
34
|
+
<%= a.def_var %><%end%>
|
35
|
+
<% if generate_array %>
|
36
|
+
size_t shape[1]; <%end%>
|
37
|
+
|
38
|
+
ndfunc_arg_in_t ain[<%=n_in%>] = {<%=def_ain%>};
|
39
|
+
ndfunc_arg_out_t aout[<%=n_out%>] = {<%=def_aout%>};
|
40
|
+
ndfunc_t ndf = {iter_<%=c_func%>,NO_LOOP|NDF_INPLACE|NDF_EXTRACT,
|
41
|
+
<%=n_in%>,<%=n_out%>,ain,aout};
|
42
|
+
<% if n_param == 1 %>
|
43
|
+
void *opt;
|
44
|
+
<%= args_param[0].set_param("opt") %>
|
45
|
+
<% elsif n_param > 1 %>
|
46
|
+
void *opt[<%=n_param%>];
|
47
|
+
<% args_param.each_with_index do |a,i| %>
|
48
|
+
<%= a.set_param("opt[#{i}]") %><%end%>
|
49
|
+
<% end %>
|
50
|
+
<%= @preproc_code %>
|
51
|
+
<% if n_param == 0 %>
|
52
|
+
return na_ndloop(&ndf,<%=n_in%>,<%=ndl_args%>); <%else%>
|
53
|
+
return na_ndloop3(&ndf,opt,<%=n_in%>,<%=ndl_args%>); <%end%>
|
54
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/*
|
2
|
+
@overload <%=name%>(<%=method_args%>)
|
3
|
+
<% desc_param_scalar.each do |x| %>
|
4
|
+
<%= x %><%end%>
|
5
|
+
|
6
|
+
<%=desc%>
|
7
|
+
*/
|
8
|
+
static VALUE
|
9
|
+
<%=c_func%>(<%=cdef_args%>)
|
10
|
+
{
|
11
|
+
<% @parsed_args.each do |a| %>
|
12
|
+
<%= a.def_var %><%end%>
|
13
|
+
<% args_param.each do |a| %>
|
14
|
+
<%= a.set_value %><%end%>
|
15
|
+
<%= @preproc_code %>
|
16
|
+
<%=recv%><%=func_name%>(<%=c_args%>);
|
17
|
+
<% if args_out.size == 1 %>
|
18
|
+
return <%= args_out[0].get_value %>;
|
19
|
+
<% else %>
|
20
|
+
{
|
21
|
+
VALUE va = rb_ary_new();
|
22
|
+
<% args_out.each do |a| %>
|
23
|
+
<%= a.store_to_array("va") %><%end%>
|
24
|
+
return va;
|
25
|
+
}
|
26
|
+
<% end %>
|
27
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
COGEN=ruby erbpp_histogram.rb
|
2
|
+
GENSRC=gsl_histogram.c
|
3
|
+
GENDEPS=erbpp_histogram.rb ../gen/*.rb ../gen/tmpl/*.c tmpl/*.c
|
4
|
+
|
5
|
+
src : $(GENSRC)
|
6
|
+
|
7
|
+
$(GENSRC) : $(GENDEPS)
|
8
|
+
$(COGEN) > $@
|
9
|
+
|
10
|
+
doc : $(GENSRC)
|
11
|
+
yard doc $(GENSRC)
|
12
|
+
|
13
|
+
clean: cleansrc cleandoc
|
14
|
+
cleansrc:
|
15
|
+
-$(Q)$(RM) $(GENSRC)
|
16
|
+
cleandoc:
|
17
|
+
-$(Q)$(RM_RF) doc .yardoc
|
@@ -0,0 +1,109 @@
|
|
1
|
+
require_relative "../gen/erbpp_gsl"
|
2
|
+
require "erbpp/line_number"
|
3
|
+
|
4
|
+
hist_list =
|
5
|
+
[
|
6
|
+
{func_name:"gsl_histogram_n",func_type:"size_t",args:[["struct",""]]},
|
7
|
+
{func_name:"gsl_histogram_range",func_type:"double *",args:[["struct",""]]},
|
8
|
+
{func_name:"gsl_histogram_bin",func_type:"double *",args:[["struct",""]]},
|
9
|
+
]
|
10
|
+
hist_pdf_list =
|
11
|
+
[
|
12
|
+
{func_name:"gsl_histogram_pdf_n",func_type:"size_t",args:[["struct",""]]},
|
13
|
+
{func_name:"gsl_histogram_pdf_range",func_type:"double *",args:[["struct",""]]},
|
14
|
+
{func_name:"gsl_histogram_pdf_sum",func_type:"double *",args:[["struct",""]]},
|
15
|
+
]
|
16
|
+
hist2d_list =
|
17
|
+
[
|
18
|
+
#{func_name:"gsl_histogram2d_nx",func_type:"size_t",args:[["struct",""]]},
|
19
|
+
#{func_name:"gsl_histogram2d_ny",func_type:"size_t",args:[["struct",""]]},
|
20
|
+
{func_name:"gsl_histogram2d_xrange",func_type:"double *",args:[["struct",""]]},
|
21
|
+
{func_name:"gsl_histogram2d_yrange",func_type:"double *",args:[["struct",""]]},
|
22
|
+
{func_name:"gsl_histogram2d_bin",func_type:"double *",args:[["struct",""]]},
|
23
|
+
]
|
24
|
+
hist2d_pdf_list =
|
25
|
+
[
|
26
|
+
{func_name:"gsl_histogram2d_pdf_nx",func_type:"size_t",args:[["struct",""]]},
|
27
|
+
{func_name:"gsl_histogram2d_pdf_ny",func_type:"size_t",args:[["struct",""]]},
|
28
|
+
{func_name:"gsl_histogram2d_pdf_xrange",func_type:"double *",args:[["struct",""]]},
|
29
|
+
{func_name:"gsl_histogram2d_pdf_yrange",func_type:"double *",args:[["struct",""]]},
|
30
|
+
{func_name:"gsl_histogram2d_pdf_sum",func_type:"double *",args:[["struct",""]]},
|
31
|
+
]
|
32
|
+
|
33
|
+
ErbppGsl.read_func_pattern(
|
34
|
+
[/^gsl_histogram2d_pdf_(\w+)$/, hist2d_pdf_list],
|
35
|
+
[/^gsl_histogram2d_(\w+)$/, hist2d_list],
|
36
|
+
[/^gsl_histogram_pdf_(\w+)$/, hist_pdf_list],
|
37
|
+
[/^gsl_histogram_(\w+)$/, hist_list],
|
38
|
+
)
|
39
|
+
|
40
|
+
class DefHistogram < DefGslClass
|
41
|
+
def lookup(h)
|
42
|
+
case h
|
43
|
+
when FM(name:/_free$/); false
|
44
|
+
when FM(szt, name:/_alloc$/); "c_new_sizet"
|
45
|
+
when FM(szt,szt, name:/_alloc$/); "c_new_sizet_x2"
|
46
|
+
when FM(name:/2d_set_ranges$/); "c_self_f_2d_set_ranges"
|
47
|
+
when FM(name:/_set_ranges$/); "c_self_f_set_ranges"
|
48
|
+
when FM(name:/(2d)?_get_[xy]?range$/); "c_DFloat_x2_f_get_range"
|
49
|
+
when FM(name:/2d_get$/); "c_DFloat_f_2d_get"
|
50
|
+
when FM(name:/_get$/); "c_DFloat_f_get"
|
51
|
+
when FM(name:/2d_increment$/); "c_self_f_DFloat_x2"
|
52
|
+
when FM(name:/_increment$/); "c_self_f_DFloat"
|
53
|
+
when FM(name:/2d_accumulate$/); "c_self_f_DFloat_x3"
|
54
|
+
when FM(name:/_accumulate$/); "c_self_f_DFloat_x2"
|
55
|
+
when FM(name:/(2d)?_pdf_init$/); "c_bool_f_pdf_init"
|
56
|
+
when FM(name:/2d_pdf_sample$/); "c_DFloat_x2_f_DFloat_x2"
|
57
|
+
when FM(name:/_pdf_sample$/); "c_DFloat_f_DFloat"
|
58
|
+
when FM(tp, type:dbl); "c_double_f_void"
|
59
|
+
when FM(tp,dbl, type:dbl); "c_double_f_double"
|
60
|
+
when FM(tp,szt, type:dbl); "c_double_f_sizet"
|
61
|
+
when FM(tp,szt,szt, type:dbl); "c_double_f_sizet_x2"
|
62
|
+
when FM("struct", type:dblp); "c_DFloat_f_field"
|
63
|
+
when FM(tp, type:szt); "c_sizet_f_void"
|
64
|
+
when FM(tp,dbl, type:szt); "c_sizet_f_double"
|
65
|
+
when FM(tp,szt, type:szt); "c_sizet_f_sizet"
|
66
|
+
when FM("struct", type:szt); "c_sizet_f_field"
|
67
|
+
when FM(tp, type:int); "c_void_f_void"
|
68
|
+
when FM(tp,dbl, type:int); "c_void_f_double"
|
69
|
+
when FM(tp,*[dbl]*2, type:int); "c_void_f_double_x2"
|
70
|
+
when FM(tp,*[dbl]*4, type:int); "c_void_f_double_x4"
|
71
|
+
when FM(tp,szt, type:int); "c_void_f_sizet"
|
72
|
+
when FM(tp,tp, type:int); "c_bool_f_other"
|
73
|
+
when FM(tp, type:void); "c_void_f_void"
|
74
|
+
when FM(tp,*[sztp]*2, type:void); "c_sizet_x2_f_void"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
DefLib.new do
|
80
|
+
set erb_dir: %w[tmpl ../gen/tmpl]
|
81
|
+
set erb_suffix: ".c"
|
82
|
+
set ns_var: "mG"
|
83
|
+
|
84
|
+
ErbPP.new(self,"cast_1d_contiguous",call_init:"")
|
85
|
+
|
86
|
+
name = "Histogram"
|
87
|
+
set file_name: "gsl_#{name}.c"
|
88
|
+
set include_files: %w[gsl/gsl_histogram.h gsl/gsl_histogram2d.h]
|
89
|
+
set lib_name: name.downcase
|
90
|
+
|
91
|
+
[["Histogram", "histogram", hist_list],
|
92
|
+
["HistogramPdf", "histogram_pdf", hist_pdf_list],
|
93
|
+
["Histogram2D", "histogram2d", hist2d_list],
|
94
|
+
["Histogram2DPdf","histogram2d_pdf", hist2d_pdf_list],
|
95
|
+
].each do |name,base,list|
|
96
|
+
DefHistogram.new(self) do
|
97
|
+
set name: base
|
98
|
+
set class_name: name
|
99
|
+
set class_var: "c"+name
|
100
|
+
set full_class_name: "Numo::GSL::"+name
|
101
|
+
set struct: "gsl_"+base
|
102
|
+
|
103
|
+
undef_alloc_func
|
104
|
+
list.each do |h|
|
105
|
+
check_func(h)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end.run
|
@@ -0,0 +1,763 @@
|
|
1
|
+
[{:func_name=>"gsl_histogram_alloc",
|
2
|
+
:func_type=>"gsl_histogram *",
|
3
|
+
:args=>[["size_t", "n"]],
|
4
|
+
:desc=>
|
5
|
+
"This function allocates memory for a histogram with n bins, and\n" +
|
6
|
+
"returns a pointer to a newly created gsl_histogram struct. If\n" +
|
7
|
+
"insufficient memory is available a null pointer is returned and the\n" +
|
8
|
+
"error handler is invoked with an error code of GSL_ENOMEM. The\n" +
|
9
|
+
"bins and ranges are not initialized, and should be prepared using one of\n" +
|
10
|
+
"the range-setting functions below in order to make the histogram ready\n" +
|
11
|
+
"for use."},
|
12
|
+
{:func_name=>"gsl_histogram_set_ranges",
|
13
|
+
:func_type=>"int",
|
14
|
+
:args=>
|
15
|
+
[["gsl_histogram *", "h"], ["const double", "range[]"], ["size_t", "size"]],
|
16
|
+
:desc=>
|
17
|
+
"This function sets the ranges of the existing histogram h using\n" +
|
18
|
+
"the array range of size size. The values of the histogram\n" +
|
19
|
+
"bins are reset to zero. The range array should contain the\n" +
|
20
|
+
"desired bin limits. The ranges can be arbitrary, subject to the\n" +
|
21
|
+
"restriction that they are monotonically increasing.\n" +
|
22
|
+
"\n" +
|
23
|
+
"The following example shows how to create a histogram with logarithmic\n" +
|
24
|
+
"bins with ranges [1,10), [10,100) and [100,1000).\n" +
|
25
|
+
"\n" +
|
26
|
+
"gsl_histogram * h = gsl_histogram_alloc (3);\n" +
|
27
|
+
"\n" +
|
28
|
+
"/* bin[0] covers the range 1 <= x < 10 */\n" +
|
29
|
+
"/* bin[1] covers the range 10 <= x < 100 */\n" +
|
30
|
+
"/* bin[2] covers the range 100 <= x < 1000 */\n" +
|
31
|
+
"\n" +
|
32
|
+
"double range[4] = @{ 1.0, 10.0, 100.0, 1000.0 @};\n" +
|
33
|
+
"\n" +
|
34
|
+
"gsl_histogram_set_ranges (h, range, 4);\n" +
|
35
|
+
"\n" +
|
36
|
+
"Note that the size of the range array should be defined to be one\n" +
|
37
|
+
"element bigger than the number of bins. The additional element is\n" +
|
38
|
+
"required for the upper value of the final bin."},
|
39
|
+
{:func_name=>"gsl_histogram_set_ranges_uniform",
|
40
|
+
:func_type=>"int",
|
41
|
+
:args=>[["gsl_histogram *", "h"], ["double", "xmin"], ["double", "xmax"]],
|
42
|
+
:desc=>
|
43
|
+
"This function sets the ranges of the existing histogram h to cover\n" +
|
44
|
+
"the range xmin to xmax uniformly. The values of the\n" +
|
45
|
+
"histogram bins are reset to zero. The bin ranges are shown in the table\n" +
|
46
|
+
"below,\n" +
|
47
|
+
"\n" +
|
48
|
+
"where d is the bin spacing, d = (xmax-xmin)/n."},
|
49
|
+
{:func_name=>"gsl_histogram_free",
|
50
|
+
:func_type=>"void",
|
51
|
+
:args=>[["gsl_histogram *", "h"]],
|
52
|
+
:desc=>
|
53
|
+
"This function frees the histogram h and all of the memory\n" +
|
54
|
+
"associated with it."},
|
55
|
+
{:func_name=>"gsl_histogram_memcpy",
|
56
|
+
:func_type=>"int",
|
57
|
+
:args=>[["gsl_histogram *", "dest"], ["const gsl_histogram *", "src"]],
|
58
|
+
:desc=>
|
59
|
+
"This function copies the histogram src into the pre-existing\n" +
|
60
|
+
"histogram dest, making dest into an exact copy of src.\n" +
|
61
|
+
"The two histograms must be of the same size."},
|
62
|
+
{:func_name=>"gsl_histogram_clone",
|
63
|
+
:func_type=>"gsl_histogram *",
|
64
|
+
:args=>[["const gsl_histogram *", "src"]],
|
65
|
+
:desc=>
|
66
|
+
"This function returns a pointer to a newly created histogram which is an\n" +
|
67
|
+
"exact copy of the histogram src."},
|
68
|
+
{:func_name=>"gsl_histogram_increment",
|
69
|
+
:func_type=>"int",
|
70
|
+
:args=>[["gsl_histogram *", "h"], ["double", "x"]],
|
71
|
+
:desc=>
|
72
|
+
"This function updates the histogram h by adding one (1.0) to the\n" +
|
73
|
+
"bin whose range contains the coordinate x. \n" +
|
74
|
+
"\n" +
|
75
|
+
"If x lies in the valid range of the histogram then the function\n" +
|
76
|
+
"returns zero to indicate success. If x is less than the lower\n" +
|
77
|
+
"limit of the histogram then the function returns GSL_EDOM, and\n" +
|
78
|
+
"none of bins are modified. Similarly, if the value of x is greater\n" +
|
79
|
+
"than or equal to the upper limit of the histogram then the function\n" +
|
80
|
+
"returns GSL_EDOM, and none of the bins are modified. The error\n" +
|
81
|
+
"handler is not called, however, since it is often necessary to compute\n" +
|
82
|
+
"histograms for a small range of a larger dataset, ignoring the values\n" +
|
83
|
+
"outside the range of interest."},
|
84
|
+
{:func_name=>"gsl_histogram_accumulate",
|
85
|
+
:func_type=>"int",
|
86
|
+
:args=>[["gsl_histogram *", "h"], ["double", "x"], ["double", "weight"]],
|
87
|
+
:desc=>
|
88
|
+
"This function is similar to gsl_histogram_increment but increases\n" +
|
89
|
+
"the value of the appropriate bin in the histogram h by the\n" +
|
90
|
+
"floating-point number weight."},
|
91
|
+
{:func_name=>"gsl_histogram_get",
|
92
|
+
:func_type=>"double",
|
93
|
+
:args=>[["const gsl_histogram *", "h"], ["size_t", "i"]],
|
94
|
+
:desc=>
|
95
|
+
"This function returns the contents of the i-th bin of the histogram\n" +
|
96
|
+
"h. If i lies outside the valid range of indices for the\n" +
|
97
|
+
"histogram then the error handler is called with an error code of\n" +
|
98
|
+
"GSL_EDOM and the function returns 0."},
|
99
|
+
{:func_name=>"gsl_histogram_get_range",
|
100
|
+
:func_type=>"int",
|
101
|
+
:args=>
|
102
|
+
[["const gsl_histogram *", "h"],
|
103
|
+
["size_t", "i"],
|
104
|
+
["double *", "lower"],
|
105
|
+
["double *", "upper"]],
|
106
|
+
:desc=>
|
107
|
+
"This function finds the upper and lower range limits of the i-th\n" +
|
108
|
+
"bin of the histogram h. If the index i is valid then the\n" +
|
109
|
+
"corresponding range limits are stored in lower and upper.\n" +
|
110
|
+
"The lower limit is inclusive (i.e. events with this coordinate are\n" +
|
111
|
+
"included in the bin) and the upper limit is exclusive (i.e. events with\n" +
|
112
|
+
"the coordinate of the upper limit are excluded and fall in the\n" +
|
113
|
+
"neighboring higher bin, if it exists). The function returns 0 to\n" +
|
114
|
+
"indicate success. If i lies outside the valid range of indices for\n" +
|
115
|
+
"the histogram then the error handler is called and the function returns\n" +
|
116
|
+
"an error code of GSL_EDOM."},
|
117
|
+
{:func_name=>"gsl_histogram_max",
|
118
|
+
:func_type=>"double",
|
119
|
+
:args=>[["const gsl_histogram *", "h"]],
|
120
|
+
:desc=>
|
121
|
+
"These functions return the maximum upper and minimum lower range limits\n" +
|
122
|
+
"and the number of bins of the histogram h. They provide a way of\n" +
|
123
|
+
"determining these values without accessing the gsl_histogram\n" +
|
124
|
+
"struct directly."},
|
125
|
+
{:func_name=>"gsl_histogram_min",
|
126
|
+
:func_type=>"double",
|
127
|
+
:args=>[["const gsl_histogram *", "h"]],
|
128
|
+
:desc=>
|
129
|
+
"These functions return the maximum upper and minimum lower range limits\n" +
|
130
|
+
"and the number of bins of the histogram h. They provide a way of\n" +
|
131
|
+
"determining these values without accessing the gsl_histogram\n" +
|
132
|
+
"struct directly."},
|
133
|
+
{:func_name=>"gsl_histogram_bins",
|
134
|
+
:func_type=>"size_t",
|
135
|
+
:args=>[["const gsl_histogram *", "h"]],
|
136
|
+
:desc=>
|
137
|
+
"These functions return the maximum upper and minimum lower range limits\n" +
|
138
|
+
"and the number of bins of the histogram h. They provide a way of\n" +
|
139
|
+
"determining these values without accessing the gsl_histogram\n" +
|
140
|
+
"struct directly."},
|
141
|
+
{:func_name=>"gsl_histogram_reset",
|
142
|
+
:func_type=>"void",
|
143
|
+
:args=>[["gsl_histogram *", "h"]],
|
144
|
+
:desc=>"This function resets all the bins in the histogram h to zero."},
|
145
|
+
{:func_name=>"gsl_histogram_find",
|
146
|
+
:func_type=>"int",
|
147
|
+
:args=>[["const gsl_histogram *", "h"], ["double", "x"], ["size_t *", "i"]],
|
148
|
+
:desc=>
|
149
|
+
"This function finds and sets the index i to the bin number which\n" +
|
150
|
+
"covers the coordinate x in the histogram h. The bin is\n" +
|
151
|
+
"located using a binary search. The search includes an optimization for\n" +
|
152
|
+
"histograms with uniform range, and will return the correct bin\n" +
|
153
|
+
"immediately in this case. If x is found in the range of the\n" +
|
154
|
+
"histogram then the function sets the index i and returns\n" +
|
155
|
+
"GSL_SUCCESS. If x lies outside the valid range of the\n" +
|
156
|
+
"histogram then the function returns GSL_EDOM and the error\n" +
|
157
|
+
"handler is invoked."},
|
158
|
+
{:func_name=>"gsl_histogram_max_val",
|
159
|
+
:func_type=>"double",
|
160
|
+
:args=>[["const gsl_histogram *", "h"]],
|
161
|
+
:desc=>
|
162
|
+
"This function returns the maximum value contained in the histogram bins."},
|
163
|
+
{:func_name=>"gsl_histogram_max_bin",
|
164
|
+
:func_type=>"size_t",
|
165
|
+
:args=>[["const gsl_histogram *", "h"]],
|
166
|
+
:desc=>
|
167
|
+
"This function returns the index of the bin containing the maximum\n" +
|
168
|
+
"value. In the case where several bins contain the same maximum value the\n" +
|
169
|
+
"smallest index is returned."},
|
170
|
+
{:func_name=>"gsl_histogram_min_val",
|
171
|
+
:func_type=>"double",
|
172
|
+
:args=>[["const gsl_histogram *", "h"]],
|
173
|
+
:desc=>
|
174
|
+
"This function returns the minimum value contained in the histogram bins."},
|
175
|
+
{:func_name=>"gsl_histogram_min_bin",
|
176
|
+
:func_type=>"size_t",
|
177
|
+
:args=>[["const gsl_histogram *", "h"]],
|
178
|
+
:desc=>
|
179
|
+
"This function returns the index of the bin containing the minimum\n" +
|
180
|
+
"value. In the case where several bins contain the same maximum value the\n" +
|
181
|
+
"smallest index is returned."},
|
182
|
+
{:func_name=>"gsl_histogram_mean",
|
183
|
+
:func_type=>"double",
|
184
|
+
:args=>[["const gsl_histogram *", "h"]],
|
185
|
+
:desc=>
|
186
|
+
"This function returns the mean of the histogrammed variable, where the\n" +
|
187
|
+
"histogram is regarded as a probability distribution. Negative bin values\n" +
|
188
|
+
"are ignored for the purposes of this calculation. The accuracy of the\n" +
|
189
|
+
"result is limited by the bin width."},
|
190
|
+
{:func_name=>"gsl_histogram_sigma",
|
191
|
+
:func_type=>"double",
|
192
|
+
:args=>[["const gsl_histogram *", "h"]],
|
193
|
+
:desc=>
|
194
|
+
"This function returns the standard deviation of the histogrammed\n" +
|
195
|
+
"variable, where the histogram is regarded as a probability\n" +
|
196
|
+
"distribution. Negative bin values are ignored for the purposes of this\n" +
|
197
|
+
"calculation. The accuracy of the result is limited by the bin width."},
|
198
|
+
{:func_name=>"gsl_histogram_sum",
|
199
|
+
:func_type=>"double",
|
200
|
+
:args=>[["const gsl_histogram *", "h"]],
|
201
|
+
:desc=>
|
202
|
+
"This function returns the sum of all bin values. Negative bin values\n" +
|
203
|
+
"are included in the sum."},
|
204
|
+
{:func_name=>"gsl_histogram_equal_bins_p",
|
205
|
+
:func_type=>"int",
|
206
|
+
:args=>[["const gsl_histogram *", "h1"], ["const gsl_histogram *", "h2"]],
|
207
|
+
:desc=>
|
208
|
+
"This function returns 1 if the all of the individual bin\n" +
|
209
|
+
"ranges of the two histograms are identical, and 0\n" +
|
210
|
+
"otherwise."},
|
211
|
+
{:func_name=>"gsl_histogram_add",
|
212
|
+
:func_type=>"int",
|
213
|
+
:args=>[["gsl_histogram *", "h1"], ["const gsl_histogram *", "h2"]],
|
214
|
+
:desc=>
|
215
|
+
"This function adds the contents of the bins in histogram h2 to the\n" +
|
216
|
+
"corresponding bins of histogram h1, i.e. h'_1(i) = h_1(i) +\n" +
|
217
|
+
"h_2(i). The two histograms must have identical bin ranges."},
|
218
|
+
{:func_name=>"gsl_histogram_sub",
|
219
|
+
:func_type=>"int",
|
220
|
+
:args=>[["gsl_histogram *", "h1"], ["const gsl_histogram *", "h2"]],
|
221
|
+
:desc=>
|
222
|
+
"This function subtracts the contents of the bins in histogram h2\n" +
|
223
|
+
"from the corresponding bins of histogram h1, i.e. h'_1(i) =\n" +
|
224
|
+
"h_1(i) - h_2(i). The two histograms must have identical bin ranges."},
|
225
|
+
{:func_name=>"gsl_histogram_mul",
|
226
|
+
:func_type=>"int",
|
227
|
+
:args=>[["gsl_histogram *", "h1"], ["const gsl_histogram *", "h2"]],
|
228
|
+
:desc=>
|
229
|
+
"This function multiplies the contents of the bins of histogram h1\n" +
|
230
|
+
"by the contents of the corresponding bins in histogram h2,\n" +
|
231
|
+
"i.e. h'_1(i) = h_1(i) * h_2(i). The two histograms must have\n" +
|
232
|
+
"identical bin ranges."},
|
233
|
+
{:func_name=>"gsl_histogram_div",
|
234
|
+
:func_type=>"int",
|
235
|
+
:args=>[["gsl_histogram *", "h1"], ["const gsl_histogram *", "h2"]],
|
236
|
+
:desc=>
|
237
|
+
"This function divides the contents of the bins of histogram h1 by\n" +
|
238
|
+
"the contents of the corresponding bins in histogram h2,\n" +
|
239
|
+
"i.e. h'_1(i) = h_1(i) / h_2(i). The two histograms must have\n" +
|
240
|
+
"identical bin ranges."},
|
241
|
+
{:func_name=>"gsl_histogram_scale",
|
242
|
+
:func_type=>"int",
|
243
|
+
:args=>[["gsl_histogram *", "h"], ["double", "scale"]],
|
244
|
+
:desc=>
|
245
|
+
"This function multiplies the contents of the bins of histogram h\n" +
|
246
|
+
"by the constant scale, i.e. $h'_1(i) = h_1(i) * \\hbox{\\it scale}$\n" +
|
247
|
+
"h'_1(i) = h_1(i) * scale."},
|
248
|
+
{:func_name=>"gsl_histogram_shift",
|
249
|
+
:func_type=>"int",
|
250
|
+
:args=>[["gsl_histogram *", "h"], ["double", "offset"]],
|
251
|
+
:desc=>
|
252
|
+
"This function shifts the contents of the bins of histogram h by\n" +
|
253
|
+
"the constant offset, i.e. $h'_1(i) = h_1(i) + \\hbox{\\it offset}$\n" +
|
254
|
+
"h'_1(i) = h_1(i) + offset."},
|
255
|
+
{:func_name=>"gsl_histogram_fwrite",
|
256
|
+
:func_type=>"int",
|
257
|
+
:args=>[["FILE *", "stream"], ["const gsl_histogram *", "h"]],
|
258
|
+
:desc=>
|
259
|
+
"This function writes the ranges and bins of the histogram h to the\n" +
|
260
|
+
"stream stream in binary format. The return value is 0 for success\n" +
|
261
|
+
"and GSL_EFAILED if there was a problem writing to the file. Since\n" +
|
262
|
+
"the data is written in the native binary format it may not be portable\n" +
|
263
|
+
"between different architectures."},
|
264
|
+
{:func_name=>"gsl_histogram_fread",
|
265
|
+
:func_type=>"int",
|
266
|
+
:args=>[["FILE *", "stream"], ["gsl_histogram *", "h"]],
|
267
|
+
:desc=>
|
268
|
+
"This function reads into the histogram h from the open stream\n" +
|
269
|
+
"stream in binary format. The histogram h must be\n" +
|
270
|
+
"preallocated with the correct size since the function uses the number of\n" +
|
271
|
+
"bins in h to determine how many bytes to read. The return value is\n" +
|
272
|
+
"0 for success and GSL_EFAILED if there was a problem reading from\n" +
|
273
|
+
"the file. The data is assumed to have been written in the native binary\n" +
|
274
|
+
"format on the same architecture."},
|
275
|
+
{:func_name=>"gsl_histogram_fprintf",
|
276
|
+
:func_type=>"int",
|
277
|
+
:args=>
|
278
|
+
[["FILE *", "stream"],
|
279
|
+
["const gsl_histogram *", "h"],
|
280
|
+
["const char *", "range_format"],
|
281
|
+
["const char *", "bin_format"]],
|
282
|
+
:desc=>
|
283
|
+
"This function writes the ranges and bins of the histogram h\n" +
|
284
|
+
"line-by-line to the stream stream using the format specifiers\n" +
|
285
|
+
"range_format and bin_format. These should be one of the\n" +
|
286
|
+
"%g, %e or %f formats for floating point\n" +
|
287
|
+
"numbers. The function returns 0 for success and GSL_EFAILED if\n" +
|
288
|
+
"there was a problem writing to the file. The histogram output is\n" +
|
289
|
+
"formatted in three columns, and the columns are separated by spaces,\n" +
|
290
|
+
"like this,\n" +
|
291
|
+
"\n" +
|
292
|
+
"range[0] range[1] bin[0]\n" +
|
293
|
+
"range[1] range[2] bin[1]\n" +
|
294
|
+
"range[2] range[3] bin[2]\n" +
|
295
|
+
"....\n" +
|
296
|
+
"range[n-1] range[n] bin[n-1]\n" +
|
297
|
+
"\n" +
|
298
|
+
"The values of the ranges are formatted using range_format and the\n" +
|
299
|
+
"value of the bins are formatted using bin_format. Each line\n" +
|
300
|
+
"contains the lower and upper limit of the range of the bins and the\n" +
|
301
|
+
"value of the bin itself. Since the upper limit of one bin is the lower\n" +
|
302
|
+
"limit of the next there is duplication of these values between lines but\n" +
|
303
|
+
"this allows the histogram to be manipulated with line-oriented tools."},
|
304
|
+
{:func_name=>"gsl_histogram_fscanf",
|
305
|
+
:func_type=>"int",
|
306
|
+
:args=>[["FILE *", "stream"], ["gsl_histogram *", "h"]],
|
307
|
+
:desc=>
|
308
|
+
"This function reads formatted data from the stream stream into the\n" +
|
309
|
+
"histogram h. The data is assumed to be in the three-column format\n" +
|
310
|
+
"used by gsl_histogram_fprintf. The histogram h must be\n" +
|
311
|
+
"preallocated with the correct length since the function uses the size of\n" +
|
312
|
+
"h to determine how many numbers to read. The function returns 0\n" +
|
313
|
+
"for success and GSL_EFAILED if there was a problem reading from\n" +
|
314
|
+
"the file."},
|
315
|
+
{:func_name=>"gsl_histogram_pdf_alloc",
|
316
|
+
:func_type=>"gsl_histogram_pdf *",
|
317
|
+
:args=>[["size_t", "n"]],
|
318
|
+
:desc=>
|
319
|
+
"This function allocates memory for a probability distribution with\n" +
|
320
|
+
"n bins and returns a pointer to a newly initialized\n" +
|
321
|
+
"gsl_histogram_pdf struct. If insufficient memory is available a\n" +
|
322
|
+
"null pointer is returned and the error handler is invoked with an error\n" +
|
323
|
+
"code of GSL_ENOMEM."},
|
324
|
+
{:func_name=>"gsl_histogram_pdf_init",
|
325
|
+
:func_type=>"int",
|
326
|
+
:args=>[["gsl_histogram_pdf *", "p"], ["const gsl_histogram *", "h"]],
|
327
|
+
:desc=>
|
328
|
+
"This function initializes the probability distribution p with\n" +
|
329
|
+
"the contents of the histogram h. If any of the bins of h are\n" +
|
330
|
+
"negative then the error handler is invoked with an error code of\n" +
|
331
|
+
"GSL_EDOM because a probability distribution cannot contain\n" +
|
332
|
+
"negative values."},
|
333
|
+
{:func_name=>"gsl_histogram_pdf_free",
|
334
|
+
:func_type=>"void",
|
335
|
+
:args=>[["gsl_histogram_pdf *", "p"]],
|
336
|
+
:desc=>
|
337
|
+
"This function frees the probability distribution function p and\n" +
|
338
|
+
"all of the memory associated with it."},
|
339
|
+
{:func_name=>"gsl_histogram_pdf_sample",
|
340
|
+
:func_type=>"double",
|
341
|
+
:args=>[["const gsl_histogram_pdf *", "p"], ["double", "r"]],
|
342
|
+
:desc=>
|
343
|
+
"This function uses r, a uniform random number between zero and\n" +
|
344
|
+
"one, to compute a single random sample from the probability distribution\n" +
|
345
|
+
"p. The algorithm used to compute the sample s is given by\n" +
|
346
|
+
"the following formula,\n" +
|
347
|
+
"\n" +
|
348
|
+
"s = range[i] + delta * (range[i+1] - range[i])\n" +
|
349
|
+
"\n" +
|
350
|
+
"where i is the index which satisfies \n" +
|
351
|
+
"$sum[i] \\le r < sum[i+1]$\n" +
|
352
|
+
"sum[i] <= r < sum[i+1] and \n" +
|
353
|
+
"delta is \n" +
|
354
|
+
"$(r - sum[i])/(sum[i+1] - sum[i])$\n" +
|
355
|
+
"(r - sum[i])/(sum[i+1] - sum[i])."},
|
356
|
+
{:func_name=>"gsl_histogram2d_alloc",
|
357
|
+
:func_type=>"gsl_histogram2d *",
|
358
|
+
:args=>[["size_t", "nx"], ["size_t", "ny"]],
|
359
|
+
:desc=>
|
360
|
+
"This function allocates memory for a two-dimensional histogram with\n" +
|
361
|
+
"nx bins in the x direction and ny bins in the y direction.\n" +
|
362
|
+
"The function returns a pointer to a newly created gsl_histogram2d\n" +
|
363
|
+
"struct. If insufficient memory is available a null pointer is returned\n" +
|
364
|
+
"and the error handler is invoked with an error code of\n" +
|
365
|
+
"GSL_ENOMEM. The bins and ranges must be initialized with one of\n" +
|
366
|
+
"the functions below before the histogram is ready for use."},
|
367
|
+
{:func_name=>"gsl_histogram2d_set_ranges",
|
368
|
+
:func_type=>"int",
|
369
|
+
:args=>
|
370
|
+
[["gsl_histogram2d *", "h"],
|
371
|
+
["const double", "xrange[]"],
|
372
|
+
["size_t", "xsize"],
|
373
|
+
["const double", "yrange[]"],
|
374
|
+
["size_t", "ysize"]],
|
375
|
+
:desc=>
|
376
|
+
"This function sets the ranges of the existing histogram h using\n" +
|
377
|
+
"the arrays xrange and yrange of size xsize and\n" +
|
378
|
+
"ysize respectively. The values of the histogram bins are reset to\n" +
|
379
|
+
"zero."},
|
380
|
+
{:func_name=>"gsl_histogram2d_set_ranges_uniform",
|
381
|
+
:func_type=>"int",
|
382
|
+
:args=>
|
383
|
+
[["gsl_histogram2d *", "h"],
|
384
|
+
["double", "xmin"],
|
385
|
+
["double", "xmax"],
|
386
|
+
["double", "ymin"],
|
387
|
+
["double", "ymax"]],
|
388
|
+
:desc=>
|
389
|
+
"This function sets the ranges of the existing histogram h to cover\n" +
|
390
|
+
"the ranges xmin to xmax and ymin to ymax\n" +
|
391
|
+
"uniformly. The values of the histogram bins are reset to zero."},
|
392
|
+
{:func_name=>"gsl_histogram2d_free",
|
393
|
+
:func_type=>"void",
|
394
|
+
:args=>[["gsl_histogram2d *", "h"]],
|
395
|
+
:desc=>
|
396
|
+
"This function frees the 2D histogram h and all of the memory\n" +
|
397
|
+
"associated with it."},
|
398
|
+
{:func_name=>"gsl_histogram2d_memcpy",
|
399
|
+
:func_type=>"int",
|
400
|
+
:args=>[["gsl_histogram2d *", "dest"], ["const gsl_histogram2d *", "src"]],
|
401
|
+
:desc=>
|
402
|
+
"This function copies the histogram src into the pre-existing\n" +
|
403
|
+
"histogram dest, making dest into an exact copy of src.\n" +
|
404
|
+
"The two histograms must be of the same size."},
|
405
|
+
{:func_name=>"gsl_histogram2d_clone",
|
406
|
+
:func_type=>"gsl_histogram2d *",
|
407
|
+
:args=>[["const gsl_histogram2d *", "src"]],
|
408
|
+
:desc=>
|
409
|
+
"This function returns a pointer to a newly created histogram which is an\n" +
|
410
|
+
"exact copy of the histogram src."},
|
411
|
+
{:func_name=>"gsl_histogram2d_increment",
|
412
|
+
:func_type=>"int",
|
413
|
+
:args=>[["gsl_histogram2d *", "h"], ["double", "x"], ["double", "y"]],
|
414
|
+
:desc=>
|
415
|
+
"This function updates the histogram h by adding one (1.0) to the\n" +
|
416
|
+
"bin whose x and y ranges contain the coordinates (x,y).\n" +
|
417
|
+
"\n" +
|
418
|
+
"If the point (x,y) lies inside the valid ranges of the\n" +
|
419
|
+
"histogram then the function returns zero to indicate success. If\n" +
|
420
|
+
"(x,y) lies outside the limits of the histogram then the\n" +
|
421
|
+
"function returns GSL_EDOM, and none of the bins are modified. The\n" +
|
422
|
+
"error handler is not called, since it is often necessary to compute\n" +
|
423
|
+
"histograms for a small range of a larger dataset, ignoring any\n" +
|
424
|
+
"coordinates outside the range of interest."},
|
425
|
+
{:func_name=>"gsl_histogram2d_accumulate",
|
426
|
+
:func_type=>"int",
|
427
|
+
:args=>
|
428
|
+
[["gsl_histogram2d *", "h"],
|
429
|
+
["double", "x"],
|
430
|
+
["double", "y"],
|
431
|
+
["double", "weight"]],
|
432
|
+
:desc=>
|
433
|
+
"This function is similar to gsl_histogram2d_increment but increases\n" +
|
434
|
+
"the value of the appropriate bin in the histogram h by the\n" +
|
435
|
+
"floating-point number weight."},
|
436
|
+
{:func_name=>"gsl_histogram2d_get",
|
437
|
+
:func_type=>"double",
|
438
|
+
:args=>[["const gsl_histogram2d *", "h"], ["size_t", "i"], ["size_t", "j"]],
|
439
|
+
:desc=>
|
440
|
+
"This function returns the contents of the (i,j)-th bin of the\n" +
|
441
|
+
"histogram h. If (i,j) lies outside the valid range of\n" +
|
442
|
+
"indices for the histogram then the error handler is called with an error\n" +
|
443
|
+
"code of GSL_EDOM and the function returns 0."},
|
444
|
+
{:func_name=>"gsl_histogram2d_get_xrange",
|
445
|
+
:func_type=>"int",
|
446
|
+
:args=>
|
447
|
+
[["const gsl_histogram2d *", "h"],
|
448
|
+
["size_t", "i"],
|
449
|
+
["double *", "xlower"],
|
450
|
+
["double *", "xupper"]],
|
451
|
+
:desc=>
|
452
|
+
"These functions find the upper and lower range limits of the i-th\n" +
|
453
|
+
"and j-th bins in the x and y directions of the histogram h.\n" +
|
454
|
+
"The range limits are stored in xlower and xupper or\n" +
|
455
|
+
"ylower and yupper. The lower limits are inclusive\n" +
|
456
|
+
"(i.e. events with these coordinates are included in the bin) and the\n" +
|
457
|
+
"upper limits are exclusive (i.e. events with the value of the upper\n" +
|
458
|
+
"limit are not included and fall in the neighboring higher bin, if it\n" +
|
459
|
+
"exists). The functions return 0 to indicate success. If i or\n" +
|
460
|
+
"j lies outside the valid range of indices for the histogram then\n" +
|
461
|
+
"the error handler is called with an error code of GSL_EDOM."},
|
462
|
+
{:func_name=>"gsl_histogram2d_get_yrange",
|
463
|
+
:func_type=>"int",
|
464
|
+
:args=>
|
465
|
+
[["const gsl_histogram2d *", "h"],
|
466
|
+
["size_t", "j"],
|
467
|
+
["double *", "ylower"],
|
468
|
+
["double *", "yupper"]],
|
469
|
+
:desc=>
|
470
|
+
"These functions find the upper and lower range limits of the i-th\n" +
|
471
|
+
"and j-th bins in the x and y directions of the histogram h.\n" +
|
472
|
+
"The range limits are stored in xlower and xupper or\n" +
|
473
|
+
"ylower and yupper. The lower limits are inclusive\n" +
|
474
|
+
"(i.e. events with these coordinates are included in the bin) and the\n" +
|
475
|
+
"upper limits are exclusive (i.e. events with the value of the upper\n" +
|
476
|
+
"limit are not included and fall in the neighboring higher bin, if it\n" +
|
477
|
+
"exists). The functions return 0 to indicate success. If i or\n" +
|
478
|
+
"j lies outside the valid range of indices for the histogram then\n" +
|
479
|
+
"the error handler is called with an error code of GSL_EDOM."},
|
480
|
+
{:func_name=>"gsl_histogram2d_xmax",
|
481
|
+
:func_type=>"double",
|
482
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
483
|
+
:desc=>
|
484
|
+
"These functions return the maximum upper and minimum lower range limits\n" +
|
485
|
+
"and the number of bins for the x and y directions of the histogram\n" +
|
486
|
+
"h. They provide a way of determining these values without\n" +
|
487
|
+
"accessing the gsl_histogram2d struct directly."},
|
488
|
+
{:func_name=>"gsl_histogram2d_xmin",
|
489
|
+
:func_type=>"double",
|
490
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
491
|
+
:desc=>
|
492
|
+
"These functions return the maximum upper and minimum lower range limits\n" +
|
493
|
+
"and the number of bins for the x and y directions of the histogram\n" +
|
494
|
+
"h. They provide a way of determining these values without\n" +
|
495
|
+
"accessing the gsl_histogram2d struct directly."},
|
496
|
+
{:func_name=>"gsl_histogram2d_nx",
|
497
|
+
:func_type=>"size_t",
|
498
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
499
|
+
:desc=>
|
500
|
+
"These functions return the maximum upper and minimum lower range limits\n" +
|
501
|
+
"and the number of bins for the x and y directions of the histogram\n" +
|
502
|
+
"h. They provide a way of determining these values without\n" +
|
503
|
+
"accessing the gsl_histogram2d struct directly."},
|
504
|
+
{:func_name=>"gsl_histogram2d_ymax",
|
505
|
+
:func_type=>"double",
|
506
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
507
|
+
:desc=>
|
508
|
+
"These functions return the maximum upper and minimum lower range limits\n" +
|
509
|
+
"and the number of bins for the x and y directions of the histogram\n" +
|
510
|
+
"h. They provide a way of determining these values without\n" +
|
511
|
+
"accessing the gsl_histogram2d struct directly."},
|
512
|
+
{:func_name=>"gsl_histogram2d_ymin",
|
513
|
+
:func_type=>"double",
|
514
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
515
|
+
:desc=>
|
516
|
+
"These functions return the maximum upper and minimum lower range limits\n" +
|
517
|
+
"and the number of bins for the x and y directions of the histogram\n" +
|
518
|
+
"h. They provide a way of determining these values without\n" +
|
519
|
+
"accessing the gsl_histogram2d struct directly."},
|
520
|
+
{:func_name=>"gsl_histogram2d_ny",
|
521
|
+
:func_type=>"size_t",
|
522
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
523
|
+
:desc=>
|
524
|
+
"These functions return the maximum upper and minimum lower range limits\n" +
|
525
|
+
"and the number of bins for the x and y directions of the histogram\n" +
|
526
|
+
"h. They provide a way of determining these values without\n" +
|
527
|
+
"accessing the gsl_histogram2d struct directly."},
|
528
|
+
{:func_name=>"gsl_histogram2d_reset",
|
529
|
+
:func_type=>"void",
|
530
|
+
:args=>[["gsl_histogram2d *", "h"]],
|
531
|
+
:desc=>"This function resets all the bins of the histogram h to zero."},
|
532
|
+
{:func_name=>"gsl_histogram2d_find",
|
533
|
+
:func_type=>"int",
|
534
|
+
:args=>
|
535
|
+
[["const gsl_histogram2d *", "h"],
|
536
|
+
["double", "x"],
|
537
|
+
["double", "y"],
|
538
|
+
["size_t *", "i"],
|
539
|
+
["size_t *", "j"]],
|
540
|
+
:desc=>
|
541
|
+
"This function finds and sets the indices i and j to\n" +
|
542
|
+
"the bin which covers the coordinates (x,y). The bin is\n" +
|
543
|
+
"located using a binary search. The search includes an optimization for\n" +
|
544
|
+
"histograms with uniform ranges, and will return the correct bin immediately\n" +
|
545
|
+
"in this case. If (x,y) is found then the function sets the\n" +
|
546
|
+
"indices (i,j) and returns GSL_SUCCESS. If\n" +
|
547
|
+
"(x,y) lies outside the valid range of the histogram then the\n" +
|
548
|
+
"function returns GSL_EDOM and the error handler is invoked."},
|
549
|
+
{:func_name=>"gsl_histogram2d_max_val",
|
550
|
+
:func_type=>"double",
|
551
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
552
|
+
:desc=>
|
553
|
+
"This function returns the maximum value contained in the histogram bins."},
|
554
|
+
{:func_name=>"gsl_histogram2d_max_bin",
|
555
|
+
:func_type=>"void",
|
556
|
+
:args=>
|
557
|
+
[["const gsl_histogram2d *", "h"], ["size_t *", "i"], ["size_t *", "j"]],
|
558
|
+
:desc=>
|
559
|
+
"This function finds the indices of the bin containing the maximum value\n" +
|
560
|
+
"in the histogram h and stores the result in (i,j). In\n" +
|
561
|
+
"the case where several bins contain the same maximum value the first bin\n" +
|
562
|
+
"found is returned."},
|
563
|
+
{:func_name=>"gsl_histogram2d_min_val",
|
564
|
+
:func_type=>"double",
|
565
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
566
|
+
:desc=>
|
567
|
+
"This function returns the minimum value contained in the histogram bins."},
|
568
|
+
{:func_name=>"gsl_histogram2d_min_bin",
|
569
|
+
:func_type=>"void",
|
570
|
+
:args=>
|
571
|
+
[["const gsl_histogram2d *", "h"], ["size_t *", "i"], ["size_t *", "j"]],
|
572
|
+
:desc=>
|
573
|
+
"This function finds the indices of the bin containing the minimum value\n" +
|
574
|
+
"in the histogram h and stores the result in (i,j). In\n" +
|
575
|
+
"the case where several bins contain the same maximum value the first bin\n" +
|
576
|
+
"found is returned."},
|
577
|
+
{:func_name=>"gsl_histogram2d_xmean",
|
578
|
+
:func_type=>"double",
|
579
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
580
|
+
:desc=>
|
581
|
+
"This function returns the mean of the histogrammed x variable, where the\n" +
|
582
|
+
"histogram is regarded as a probability distribution. Negative bin values\n" +
|
583
|
+
"are ignored for the purposes of this calculation."},
|
584
|
+
{:func_name=>"gsl_histogram2d_ymean",
|
585
|
+
:func_type=>"double",
|
586
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
587
|
+
:desc=>
|
588
|
+
"This function returns the mean of the histogrammed y variable, where the\n" +
|
589
|
+
"histogram is regarded as a probability distribution. Negative bin values\n" +
|
590
|
+
"are ignored for the purposes of this calculation."},
|
591
|
+
{:func_name=>"gsl_histogram2d_xsigma",
|
592
|
+
:func_type=>"double",
|
593
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
594
|
+
:desc=>
|
595
|
+
"This function returns the standard deviation of the histogrammed\n" +
|
596
|
+
"x variable, where the histogram is regarded as a probability\n" +
|
597
|
+
"distribution. Negative bin values are ignored for the purposes of this\n" +
|
598
|
+
"calculation."},
|
599
|
+
{:func_name=>"gsl_histogram2d_ysigma",
|
600
|
+
:func_type=>"double",
|
601
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
602
|
+
:desc=>
|
603
|
+
"This function returns the standard deviation of the histogrammed\n" +
|
604
|
+
"y variable, where the histogram is regarded as a probability\n" +
|
605
|
+
"distribution. Negative bin values are ignored for the purposes of this\n" +
|
606
|
+
"calculation."},
|
607
|
+
{:func_name=>"gsl_histogram2d_cov",
|
608
|
+
:func_type=>"double",
|
609
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
610
|
+
:desc=>
|
611
|
+
"This function returns the covariance of the histogrammed x and y\n" +
|
612
|
+
"variables, where the histogram is regarded as a probability\n" +
|
613
|
+
"distribution. Negative bin values are ignored for the purposes of this\n" +
|
614
|
+
"calculation."},
|
615
|
+
{:func_name=>"gsl_histogram2d_sum",
|
616
|
+
:func_type=>"double",
|
617
|
+
:args=>[["const gsl_histogram2d *", "h"]],
|
618
|
+
:desc=>
|
619
|
+
"This function returns the sum of all bin values. Negative bin values\n" +
|
620
|
+
"are included in the sum."},
|
621
|
+
{:func_name=>"gsl_histogram2d_equal_bins_p",
|
622
|
+
:func_type=>"int",
|
623
|
+
:args=>
|
624
|
+
[["const gsl_histogram2d *", "h1"], ["const gsl_histogram2d *", "h2"]],
|
625
|
+
:desc=>
|
626
|
+
"This function returns 1 if all the individual bin ranges of the two\n" +
|
627
|
+
"histograms are identical, and 0 otherwise."},
|
628
|
+
{:func_name=>"gsl_histogram2d_add",
|
629
|
+
:func_type=>"int",
|
630
|
+
:args=>[["gsl_histogram2d *", "h1"], ["const gsl_histogram2d *", "h2"]],
|
631
|
+
:desc=>
|
632
|
+
"This function adds the contents of the bins in histogram h2 to the\n" +
|
633
|
+
"corresponding bins of histogram h1,\n" +
|
634
|
+
"i.e. h'_1(i,j) = h_1(i,j) + h_2(i,j).\n" +
|
635
|
+
"The two histograms must have identical bin ranges."},
|
636
|
+
{:func_name=>"gsl_histogram2d_sub",
|
637
|
+
:func_type=>"int",
|
638
|
+
:args=>[["gsl_histogram2d *", "h1"], ["const gsl_histogram2d *", "h2"]],
|
639
|
+
:desc=>
|
640
|
+
"This function subtracts the contents of the bins in histogram h2 from the\n" +
|
641
|
+
"corresponding bins of histogram h1,\n" +
|
642
|
+
"i.e. h'_1(i,j) = h_1(i,j) - h_2(i,j).\n" +
|
643
|
+
"The two histograms must have identical bin ranges."},
|
644
|
+
{:func_name=>"gsl_histogram2d_mul",
|
645
|
+
:func_type=>"int",
|
646
|
+
:args=>[["gsl_histogram2d *", "h1"], ["const gsl_histogram2d *", "h2"]],
|
647
|
+
:desc=>
|
648
|
+
"This function multiplies the contents of the bins of histogram h1\n" +
|
649
|
+
"by the contents of the corresponding bins in histogram h2,\n" +
|
650
|
+
"i.e. h'_1(i,j) = h_1(i,j) * h_2(i,j).\n" +
|
651
|
+
"The two histograms must have identical bin ranges."},
|
652
|
+
{:func_name=>"gsl_histogram2d_div",
|
653
|
+
:func_type=>"int",
|
654
|
+
:args=>[["gsl_histogram2d *", "h1"], ["const gsl_histogram2d *", "h2"]],
|
655
|
+
:desc=>
|
656
|
+
"This function divides the contents of the bins of histogram h1\n" +
|
657
|
+
"by the contents of the corresponding bins in histogram h2,\n" +
|
658
|
+
"i.e. h'_1(i,j) = h_1(i,j) / h_2(i,j).\n" +
|
659
|
+
"The two histograms must have identical bin ranges."},
|
660
|
+
{:func_name=>"gsl_histogram2d_scale",
|
661
|
+
:func_type=>"int",
|
662
|
+
:args=>[["gsl_histogram2d *", "h"], ["double", "scale"]],
|
663
|
+
:desc=>
|
664
|
+
"This function multiplies the contents of the bins of histogram h\n" +
|
665
|
+
"by the constant scale, i.e. $h'_1(i,j) = h_1(i,j) * \\hbox{\\it scale}$\n" +
|
666
|
+
"h'_1(i,j) = h_1(i,j) scale."},
|
667
|
+
{:func_name=>"gsl_histogram2d_shift",
|
668
|
+
:func_type=>"int",
|
669
|
+
:args=>[["gsl_histogram2d *", "h"], ["double", "offset"]],
|
670
|
+
:desc=>
|
671
|
+
"This function shifts the contents of the bins of histogram h\n" +
|
672
|
+
"by the constant offset, i.e. $h'_1(i,j) = h_1(i,j) + \\hbox{\\it offset}$\n" +
|
673
|
+
"h'_1(i,j) = h_1(i,j) + offset."},
|
674
|
+
{:func_name=>"gsl_histogram2d_fwrite",
|
675
|
+
:func_type=>"int",
|
676
|
+
:args=>[["FILE *", "stream"], ["const gsl_histogram2d *", "h"]],
|
677
|
+
:desc=>
|
678
|
+
"This function writes the ranges and bins of the histogram h to the\n" +
|
679
|
+
"stream stream in binary format. The return value is 0 for success\n" +
|
680
|
+
"and GSL_EFAILED if there was a problem writing to the file. Since\n" +
|
681
|
+
"the data is written in the native binary format it may not be portable\n" +
|
682
|
+
"between different architectures."},
|
683
|
+
{:func_name=>"gsl_histogram2d_fread",
|
684
|
+
:func_type=>"int",
|
685
|
+
:args=>[["FILE *", "stream"], ["gsl_histogram2d *", "h"]],
|
686
|
+
:desc=>
|
687
|
+
"This function reads into the histogram h from the stream\n" +
|
688
|
+
"stream in binary format. The histogram h must be\n" +
|
689
|
+
"preallocated with the correct size since the function uses the number of\n" +
|
690
|
+
"x and y bins in h to determine how many bytes to read. The return\n" +
|
691
|
+
"value is 0 for success and GSL_EFAILED if there was a problem\n" +
|
692
|
+
"reading from the file. The data is assumed to have been written in the\n" +
|
693
|
+
"native binary format on the same architecture."},
|
694
|
+
{:func_name=>"gsl_histogram2d_fprintf",
|
695
|
+
:func_type=>"int",
|
696
|
+
:args=>
|
697
|
+
[["FILE *", "stream"],
|
698
|
+
["const gsl_histogram2d *", "h"],
|
699
|
+
["const char *", "range_format"],
|
700
|
+
["const char *", "bin_format"]],
|
701
|
+
:desc=>
|
702
|
+
"This function writes the ranges and bins of the histogram h\n" +
|
703
|
+
"line-by-line to the stream stream using the format specifiers\n" +
|
704
|
+
"range_format and bin_format. These should be one of the\n" +
|
705
|
+
"%g, %e or %f formats for floating point\n" +
|
706
|
+
"numbers. The function returns 0 for success and GSL_EFAILED if\n" +
|
707
|
+
"there was a problem writing to the file. The histogram output is\n" +
|
708
|
+
"formatted in five columns, and the columns are separated by spaces,\n" +
|
709
|
+
"like this,\n" +
|
710
|
+
"\n" +
|
711
|
+
"\n" +
|
712
|
+
"Each line contains the lower and upper limits of the bin and the\n" +
|
713
|
+
"contents of the bin. Since the upper limits of the each bin are the\n" +
|
714
|
+
"lower limits of the neighboring bins there is duplication of these\n" +
|
715
|
+
"values but this allows the histogram to be manipulated with\n" +
|
716
|
+
"line-oriented tools."},
|
717
|
+
{:func_name=>"gsl_histogram2d_fscanf",
|
718
|
+
:func_type=>"int",
|
719
|
+
:args=>[["FILE *", "stream"], ["gsl_histogram2d *", "h"]],
|
720
|
+
:desc=>
|
721
|
+
"This function reads formatted data from the stream stream into the\n" +
|
722
|
+
"histogram h. The data is assumed to be in the five-column format\n" +
|
723
|
+
"used by gsl_histogram2d_fprintf. The histogram h must be\n" +
|
724
|
+
"preallocated with the correct lengths since the function uses the sizes\n" +
|
725
|
+
"of h to determine how many numbers to read. The function returns 0\n" +
|
726
|
+
"for success and GSL_EFAILED if there was a problem reading from\n" +
|
727
|
+
"the file."},
|
728
|
+
{:func_name=>"gsl_histogram2d_pdf_alloc",
|
729
|
+
:func_type=>"gsl_histogram2d_pdf *",
|
730
|
+
:args=>[["size_t", "nx"], ["size_t", "ny"]],
|
731
|
+
:desc=>
|
732
|
+
"This function allocates memory for a two-dimensional probability\n" +
|
733
|
+
"distribution of size nx-by-ny and returns a pointer to a\n" +
|
734
|
+
"newly initialized gsl_histogram2d_pdf struct. If insufficient\n" +
|
735
|
+
"memory is available a null pointer is returned and the error handler is\n" +
|
736
|
+
"invoked with an error code of GSL_ENOMEM."},
|
737
|
+
{:func_name=>"gsl_histogram2d_pdf_init",
|
738
|
+
:func_type=>"int",
|
739
|
+
:args=>[["gsl_histogram2d_pdf *", "p"], ["const gsl_histogram2d *", "h"]],
|
740
|
+
:desc=>
|
741
|
+
"This function initializes the two-dimensional probability distribution\n" +
|
742
|
+
"calculated p from the histogram h. If any of the bins of\n" +
|
743
|
+
"h are negative then the error handler is invoked with an error\n" +
|
744
|
+
"code of GSL_EDOM because a probability distribution cannot\n" +
|
745
|
+
"contain negative values."},
|
746
|
+
{:func_name=>"gsl_histogram2d_pdf_free",
|
747
|
+
:func_type=>"void",
|
748
|
+
:args=>[["gsl_histogram2d_pdf *", "p"]],
|
749
|
+
:desc=>
|
750
|
+
"This function frees the two-dimensional probability distribution\n" +
|
751
|
+
"function p and all of the memory associated with it."},
|
752
|
+
{:func_name=>"gsl_histogram2d_pdf_sample",
|
753
|
+
:func_type=>"int",
|
754
|
+
:args=>
|
755
|
+
[["const gsl_histogram2d_pdf *", "p"],
|
756
|
+
["double", "r1"],
|
757
|
+
["double", "r2"],
|
758
|
+
["double *", "x"],
|
759
|
+
["double *", "y"]],
|
760
|
+
:desc=>
|
761
|
+
"This function uses two uniform random numbers between zero and one,\n" +
|
762
|
+
"r1 and r2, to compute a single random sample from the\n" +
|
763
|
+
"two-dimensional probability distribution p."}]
|