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 @@
|
|
1
|
+
#define NUMO_GSL_VERSION "0.1.0"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
COGEN=ruby erbpp_wavelet.rb
|
2
|
+
GENSRC=gsl_wavelet.c
|
3
|
+
GENDEPS=erbpp_wavelet.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,48 @@
|
|
1
|
+
require_relative "parse_wavelet"
|
2
|
+
require_relative "../gen/erbpp_gsl"
|
3
|
+
require "erbpp/line_number"
|
4
|
+
|
5
|
+
|
6
|
+
gsl_list = ErbppGsl.read_func
|
7
|
+
|
8
|
+
class_list = [
|
9
|
+
["WaveletWorkspace","wavelet_workspace",[]],
|
10
|
+
["Wavelet","wavelet",list_1d=[]],
|
11
|
+
["Wavelet2D","wavelet2d",list_2d=[]],
|
12
|
+
]
|
13
|
+
ErbppGsl.read_func_pattern(
|
14
|
+
*class_list.map{|name,base,list| [/gsl_#{base}_/, list]}
|
15
|
+
)
|
16
|
+
list_2d << list_1d.find{|h| h[:func_name]=="gsl_wavelet_alloc"}
|
17
|
+
|
18
|
+
DefLib.new do
|
19
|
+
set erb_dir: %w[tmpl ../gen/tmpl]
|
20
|
+
set erb_suffix: ".c"
|
21
|
+
set ns_var: "mG"
|
22
|
+
|
23
|
+
#ErbPP.new(self,"cast_1d_contiguous")
|
24
|
+
#ErbPP.new(self,"cast_2d_contiguous")
|
25
|
+
ErbPP.new(self,"wavelet_macro")
|
26
|
+
ErbPP.new(self,"wavelet_array_check")
|
27
|
+
|
28
|
+
name = "Wavelet"
|
29
|
+
set file_name: "gsl_#{name}.c"
|
30
|
+
set include_files: %w[gsl/gsl_wavelet.h gsl/gsl_wavelet2d.h]
|
31
|
+
set lib_name: name.downcase
|
32
|
+
|
33
|
+
class_list.each do |name,base,list|
|
34
|
+
DefWavelet.new(self) do
|
35
|
+
set name: base
|
36
|
+
set class_name: name
|
37
|
+
set class_var: "c"+name
|
38
|
+
set full_class_name: "Numo::GSL::"+name
|
39
|
+
set struct: "gsl_"+base.sub(/2d/,"")
|
40
|
+
|
41
|
+
undef_alloc_func
|
42
|
+
list.each do |h|
|
43
|
+
check_func(h)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end.run
|
@@ -0,0 +1,337 @@
|
|
1
|
+
[{:func_name=>"gsl_wavelet_alloc",
|
2
|
+
:func_type=>"gsl_wavelet *",
|
3
|
+
:args=>[["const gsl_wavelet_type *", "T"], ["size_t", "k"]],
|
4
|
+
:desc=>
|
5
|
+
"This function allocates and initializes a wavelet object of type\n" +
|
6
|
+
"T. The parameter k selects the specific member of the\n" +
|
7
|
+
"wavelet family. A null pointer is returned if insufficient memory is\n" +
|
8
|
+
"available or if a unsupported member is selected."},
|
9
|
+
{:func_name=>"gsl_wavelet_name",
|
10
|
+
:func_type=>"const char *",
|
11
|
+
:args=>[["const gsl_wavelet *", "w"]],
|
12
|
+
:desc=>
|
13
|
+
"This function returns a pointer to the name of the wavelet family for\n" +
|
14
|
+
"w."},
|
15
|
+
{:func_name=>"gsl_wavelet_free",
|
16
|
+
:func_type=>"void",
|
17
|
+
:args=>[["gsl_wavelet *", "w"]],
|
18
|
+
:desc=>"This function frees the wavelet object w."},
|
19
|
+
{:func_name=>"gsl_wavelet_workspace_alloc",
|
20
|
+
:func_type=>"gsl_wavelet_workspace *",
|
21
|
+
:args=>[["size_t", "n"]],
|
22
|
+
:desc=>
|
23
|
+
"This function allocates a workspace for the discrete wavelet transform.\n" +
|
24
|
+
"To perform a one-dimensional transform on n elements, a workspace\n" +
|
25
|
+
"of size n must be provided. For two-dimensional transforms of\n" +
|
26
|
+
"n-by-n matrices it is sufficient to allocate a workspace of\n" +
|
27
|
+
"size n, since the transform operates on individual rows and\n" +
|
28
|
+
"columns. A null pointer is returned if insufficient memory is available."},
|
29
|
+
{:func_name=>"gsl_wavelet_workspace_free",
|
30
|
+
:func_type=>"void",
|
31
|
+
:args=>[["gsl_wavelet_workspace *", "work"]],
|
32
|
+
:desc=>"This function frees the allocated workspace work."},
|
33
|
+
{:func_name=>"gsl_wavelet_transform",
|
34
|
+
:func_type=>"int",
|
35
|
+
:args=>
|
36
|
+
[["const gsl_wavelet *", "w"],
|
37
|
+
["double *", "data"],
|
38
|
+
["size_t", "stride"],
|
39
|
+
["size_t", "n"],
|
40
|
+
["gsl_wavelet_direction", "dir"],
|
41
|
+
["gsl_wavelet_workspace *", "work"]],
|
42
|
+
:desc=>
|
43
|
+
"\n" +
|
44
|
+
"These functions compute in-place forward and inverse discrete wavelet\n" +
|
45
|
+
"transforms of length n with stride stride on the array\n" +
|
46
|
+
"data. The length of the transform n is restricted to powers\n" +
|
47
|
+
"of two. For the transform version of the function the argument\n" +
|
48
|
+
"dir can be either forward (+1) or backward\n" +
|
49
|
+
"(-1). A workspace work of length n must be provided.\n" +
|
50
|
+
"\n" +
|
51
|
+
"For the forward transform, the elements of the original array are \n" +
|
52
|
+
"replaced by the discrete wavelet\n" +
|
53
|
+
"transform $f_i \\rightarrow w_{j,k}$\n" +
|
54
|
+
"f_i -> w_@{j,k@} \n" +
|
55
|
+
"in a packed triangular storage layout, \n" +
|
56
|
+
"where j is the index of the level \n" +
|
57
|
+
"$j = 0 \\dots J-1$\n" +
|
58
|
+
"j = 0 ... J-1\n" +
|
59
|
+
"and\n" +
|
60
|
+
"k is the index of the coefficient within each level,\n" +
|
61
|
+
"$k = 0 \\dots 2^j - 1$\n" +
|
62
|
+
"k = 0 ... (2^j)-1. \n" +
|
63
|
+
"The total number of levels is J = \\log_2(n). The output data\n" +
|
64
|
+
"has the following form,\n" +
|
65
|
+
"\n" +
|
66
|
+
"(s_@{-1,0@}, d_@{0,0@}, d_@{1,0@}, d_@{1,1@}, d_@{2,0@}, ..., \n" +
|
67
|
+
" d_@{j,k@}, ..., d_@{J-1,2^@{J-1@}-1@}) \n" +
|
68
|
+
"\n" +
|
69
|
+
"where the first element is the smoothing coefficient $s_{-1,0}$\n" +
|
70
|
+
"s_@{-1,0@}, followed by the detail coefficients $d_{j,k}$\n" +
|
71
|
+
"d_@{j,k@} for each level\n" +
|
72
|
+
"j. The backward transform inverts these coefficients to obtain \n" +
|
73
|
+
"the original data.\n" +
|
74
|
+
"\n" +
|
75
|
+
"These functions return a status of GSL_SUCCESS upon successful\n" +
|
76
|
+
"completion. GSL_EINVAL is returned if n is not an integer\n" +
|
77
|
+
"power of 2 or if insufficient workspace is provided."},
|
78
|
+
{:func_name=>"gsl_wavelet_transform_forward",
|
79
|
+
:func_type=>"int",
|
80
|
+
:args=>
|
81
|
+
[["const gsl_wavelet *", "w"],
|
82
|
+
["double *", "data"],
|
83
|
+
["size_t", "stride"],
|
84
|
+
["size_t", "n"],
|
85
|
+
["gsl_wavelet_workspace *", "work"]],
|
86
|
+
:desc=>
|
87
|
+
"\n" +
|
88
|
+
"These functions compute in-place forward and inverse discrete wavelet\n" +
|
89
|
+
"transforms of length n with stride stride on the array\n" +
|
90
|
+
"data. The length of the transform n is restricted to powers\n" +
|
91
|
+
"of two. For the transform version of the function the argument\n" +
|
92
|
+
"dir can be either forward (+1) or backward\n" +
|
93
|
+
"(-1). A workspace work of length n must be provided.\n" +
|
94
|
+
"\n" +
|
95
|
+
"For the forward transform, the elements of the original array are \n" +
|
96
|
+
"replaced by the discrete wavelet\n" +
|
97
|
+
"transform $f_i \\rightarrow w_{j,k}$\n" +
|
98
|
+
"f_i -> w_@{j,k@} \n" +
|
99
|
+
"in a packed triangular storage layout, \n" +
|
100
|
+
"where j is the index of the level \n" +
|
101
|
+
"$j = 0 \\dots J-1$\n" +
|
102
|
+
"j = 0 ... J-1\n" +
|
103
|
+
"and\n" +
|
104
|
+
"k is the index of the coefficient within each level,\n" +
|
105
|
+
"$k = 0 \\dots 2^j - 1$\n" +
|
106
|
+
"k = 0 ... (2^j)-1. \n" +
|
107
|
+
"The total number of levels is J = \\log_2(n). The output data\n" +
|
108
|
+
"has the following form,\n" +
|
109
|
+
"\n" +
|
110
|
+
"(s_@{-1,0@}, d_@{0,0@}, d_@{1,0@}, d_@{1,1@}, d_@{2,0@}, ..., \n" +
|
111
|
+
" d_@{j,k@}, ..., d_@{J-1,2^@{J-1@}-1@}) \n" +
|
112
|
+
"\n" +
|
113
|
+
"where the first element is the smoothing coefficient $s_{-1,0}$\n" +
|
114
|
+
"s_@{-1,0@}, followed by the detail coefficients $d_{j,k}$\n" +
|
115
|
+
"d_@{j,k@} for each level\n" +
|
116
|
+
"j. The backward transform inverts these coefficients to obtain \n" +
|
117
|
+
"the original data.\n" +
|
118
|
+
"\n" +
|
119
|
+
"These functions return a status of GSL_SUCCESS upon successful\n" +
|
120
|
+
"completion. GSL_EINVAL is returned if n is not an integer\n" +
|
121
|
+
"power of 2 or if insufficient workspace is provided."},
|
122
|
+
{:func_name=>"gsl_wavelet_transform_inverse",
|
123
|
+
:func_type=>"int",
|
124
|
+
:args=>
|
125
|
+
[["const gsl_wavelet *", "w"],
|
126
|
+
["double *", "data"],
|
127
|
+
["size_t", "stride"],
|
128
|
+
["size_t", "n"],
|
129
|
+
["gsl_wavelet_workspace *", "work"]],
|
130
|
+
:desc=>
|
131
|
+
"\n" +
|
132
|
+
"These functions compute in-place forward and inverse discrete wavelet\n" +
|
133
|
+
"transforms of length n with stride stride on the array\n" +
|
134
|
+
"data. The length of the transform n is restricted to powers\n" +
|
135
|
+
"of two. For the transform version of the function the argument\n" +
|
136
|
+
"dir can be either forward (+1) or backward\n" +
|
137
|
+
"(-1). A workspace work of length n must be provided.\n" +
|
138
|
+
"\n" +
|
139
|
+
"For the forward transform, the elements of the original array are \n" +
|
140
|
+
"replaced by the discrete wavelet\n" +
|
141
|
+
"transform $f_i \\rightarrow w_{j,k}$\n" +
|
142
|
+
"f_i -> w_@{j,k@} \n" +
|
143
|
+
"in a packed triangular storage layout, \n" +
|
144
|
+
"where j is the index of the level \n" +
|
145
|
+
"$j = 0 \\dots J-1$\n" +
|
146
|
+
"j = 0 ... J-1\n" +
|
147
|
+
"and\n" +
|
148
|
+
"k is the index of the coefficient within each level,\n" +
|
149
|
+
"$k = 0 \\dots 2^j - 1$\n" +
|
150
|
+
"k = 0 ... (2^j)-1. \n" +
|
151
|
+
"The total number of levels is J = \\log_2(n). The output data\n" +
|
152
|
+
"has the following form,\n" +
|
153
|
+
"\n" +
|
154
|
+
"(s_@{-1,0@}, d_@{0,0@}, d_@{1,0@}, d_@{1,1@}, d_@{2,0@}, ..., \n" +
|
155
|
+
" d_@{j,k@}, ..., d_@{J-1,2^@{J-1@}-1@}) \n" +
|
156
|
+
"\n" +
|
157
|
+
"where the first element is the smoothing coefficient $s_{-1,0}$\n" +
|
158
|
+
"s_@{-1,0@}, followed by the detail coefficients $d_{j,k}$\n" +
|
159
|
+
"d_@{j,k@} for each level\n" +
|
160
|
+
"j. The backward transform inverts these coefficients to obtain \n" +
|
161
|
+
"the original data.\n" +
|
162
|
+
"\n" +
|
163
|
+
"These functions return a status of GSL_SUCCESS upon successful\n" +
|
164
|
+
"completion. GSL_EINVAL is returned if n is not an integer\n" +
|
165
|
+
"power of 2 or if insufficient workspace is provided."},
|
166
|
+
{:func_name=>"gsl_wavelet2d_transform",
|
167
|
+
:func_type=>"int",
|
168
|
+
:args=>
|
169
|
+
[["const gsl_wavelet *", "w"],
|
170
|
+
["double *", "data"],
|
171
|
+
["size_t", "tda"],
|
172
|
+
["size_t", "size1"],
|
173
|
+
["size_t", "size2"],
|
174
|
+
["gsl_wavelet_direction", "dir"],
|
175
|
+
["gsl_wavelet_workspace *", "work"]],
|
176
|
+
:desc=>
|
177
|
+
"\n" +
|
178
|
+
"These functions compute two-dimensional in-place forward and inverse\n" +
|
179
|
+
"discrete wavelet transforms in standard form on the\n" +
|
180
|
+
"array data stored in row-major form with dimensions size1\n" +
|
181
|
+
"and size2 and physical row length tda. The dimensions must\n" +
|
182
|
+
"be equal (square matrix) and are restricted to powers of two. For the\n" +
|
183
|
+
"transform version of the function the argument dir can be\n" +
|
184
|
+
"either forward (+1) or backward (-1). A\n" +
|
185
|
+
"workspace work of the appropriate size must be provided. On exit,\n" +
|
186
|
+
"the appropriate elements of the array data are replaced by their\n" +
|
187
|
+
"two-dimensional wavelet transform.\n" +
|
188
|
+
"\n" +
|
189
|
+
"The functions return a status of GSL_SUCCESS upon successful\n" +
|
190
|
+
"completion. GSL_EINVAL is returned if size1 and\n" +
|
191
|
+
"size2 are not equal and integer powers of 2, or if insufficient\n" +
|
192
|
+
"workspace is provided."},
|
193
|
+
{:func_name=>"gsl_wavelet2d_transform_forward",
|
194
|
+
:func_type=>"int",
|
195
|
+
:args=>
|
196
|
+
[["const gsl_wavelet *", "w"],
|
197
|
+
["double *", "data"],
|
198
|
+
["size_t", "tda"],
|
199
|
+
["size_t", "size1"],
|
200
|
+
["size_t", "size2"],
|
201
|
+
["gsl_wavelet_workspace *", "work"]],
|
202
|
+
:desc=>
|
203
|
+
"\n" +
|
204
|
+
"These functions compute two-dimensional in-place forward and inverse\n" +
|
205
|
+
"discrete wavelet transforms in standard form on the\n" +
|
206
|
+
"array data stored in row-major form with dimensions size1\n" +
|
207
|
+
"and size2 and physical row length tda. The dimensions must\n" +
|
208
|
+
"be equal (square matrix) and are restricted to powers of two. For the\n" +
|
209
|
+
"transform version of the function the argument dir can be\n" +
|
210
|
+
"either forward (+1) or backward (-1). A\n" +
|
211
|
+
"workspace work of the appropriate size must be provided. On exit,\n" +
|
212
|
+
"the appropriate elements of the array data are replaced by their\n" +
|
213
|
+
"two-dimensional wavelet transform.\n" +
|
214
|
+
"\n" +
|
215
|
+
"The functions return a status of GSL_SUCCESS upon successful\n" +
|
216
|
+
"completion. GSL_EINVAL is returned if size1 and\n" +
|
217
|
+
"size2 are not equal and integer powers of 2, or if insufficient\n" +
|
218
|
+
"workspace is provided."},
|
219
|
+
{:func_name=>"gsl_wavelet2d_transform_inverse",
|
220
|
+
:func_type=>"int",
|
221
|
+
:args=>
|
222
|
+
[["const gsl_wavelet *", "w"],
|
223
|
+
["double *", "data"],
|
224
|
+
["size_t", "tda"],
|
225
|
+
["size_t", "size1"],
|
226
|
+
["size_t", "size2"],
|
227
|
+
["gsl_wavelet_workspace *", "work"]],
|
228
|
+
:desc=>
|
229
|
+
"\n" +
|
230
|
+
"These functions compute two-dimensional in-place forward and inverse\n" +
|
231
|
+
"discrete wavelet transforms in standard form on the\n" +
|
232
|
+
"array data stored in row-major form with dimensions size1\n" +
|
233
|
+
"and size2 and physical row length tda. The dimensions must\n" +
|
234
|
+
"be equal (square matrix) and are restricted to powers of two. For the\n" +
|
235
|
+
"transform version of the function the argument dir can be\n" +
|
236
|
+
"either forward (+1) or backward (-1). A\n" +
|
237
|
+
"workspace work of the appropriate size must be provided. On exit,\n" +
|
238
|
+
"the appropriate elements of the array data are replaced by their\n" +
|
239
|
+
"two-dimensional wavelet transform.\n" +
|
240
|
+
"\n" +
|
241
|
+
"The functions return a status of GSL_SUCCESS upon successful\n" +
|
242
|
+
"completion. GSL_EINVAL is returned if size1 and\n" +
|
243
|
+
"size2 are not equal and integer powers of 2, or if insufficient\n" +
|
244
|
+
"workspace is provided."},
|
245
|
+
{:func_name=>"gsl_wavelet2d_transform_matrix",
|
246
|
+
:func_type=>"int",
|
247
|
+
:args=>
|
248
|
+
[["const gsl_wavelet *", "w"],
|
249
|
+
["gsl_matrix *", "m"],
|
250
|
+
["gsl_wavelet_direction", "dir"],
|
251
|
+
["gsl_wavelet_workspace *", "work"]],
|
252
|
+
:desc=>
|
253
|
+
"These functions compute the two-dimensional in-place wavelet transform\n" +
|
254
|
+
"on a matrix a."},
|
255
|
+
{:func_name=>"gsl_wavelet2d_transform_matrix_forward",
|
256
|
+
:func_type=>"int",
|
257
|
+
:args=>
|
258
|
+
[["const gsl_wavelet *", "w"],
|
259
|
+
["gsl_matrix *", "m"],
|
260
|
+
["gsl_wavelet_workspace *", "work"]],
|
261
|
+
:desc=>
|
262
|
+
"These functions compute the two-dimensional in-place wavelet transform\n" +
|
263
|
+
"on a matrix a."},
|
264
|
+
{:func_name=>"gsl_wavelet2d_transform_matrix_inverse",
|
265
|
+
:func_type=>"int",
|
266
|
+
:args=>
|
267
|
+
[["const gsl_wavelet *", "w"],
|
268
|
+
["gsl_matrix *", "m"],
|
269
|
+
["gsl_wavelet_workspace *", "work"]],
|
270
|
+
:desc=>
|
271
|
+
"These functions compute the two-dimensional in-place wavelet transform\n" +
|
272
|
+
"on a matrix a."},
|
273
|
+
{:func_name=>"gsl_wavelet2d_nstransform",
|
274
|
+
:func_type=>"int",
|
275
|
+
:args=>
|
276
|
+
[["const gsl_wavelet *", "w"],
|
277
|
+
["double *", "data"],
|
278
|
+
["size_t", "tda"],
|
279
|
+
["size_t", "size1"],
|
280
|
+
["size_t", "size2"],
|
281
|
+
["gsl_wavelet_direction", "dir"],
|
282
|
+
["gsl_wavelet_workspace *", "work"]],
|
283
|
+
:desc=>
|
284
|
+
"These functions compute the two-dimensional wavelet transform in\n" +
|
285
|
+
"non-standard form."},
|
286
|
+
{:func_name=>"gsl_wavelet2d_nstransform_forward",
|
287
|
+
:func_type=>"int",
|
288
|
+
:args=>
|
289
|
+
[["const gsl_wavelet *", "w"],
|
290
|
+
["double *", "data"],
|
291
|
+
["size_t", "tda"],
|
292
|
+
["size_t", "size1"],
|
293
|
+
["size_t", "size2"],
|
294
|
+
["gsl_wavelet_workspace *", "work"]],
|
295
|
+
:desc=>
|
296
|
+
"These functions compute the two-dimensional wavelet transform in\n" +
|
297
|
+
"non-standard form."},
|
298
|
+
{:func_name=>"gsl_wavelet2d_nstransform_inverse",
|
299
|
+
:func_type=>"int",
|
300
|
+
:args=>
|
301
|
+
[["const gsl_wavelet *", "w"],
|
302
|
+
["double *", "data"],
|
303
|
+
["size_t", "tda"],
|
304
|
+
["size_t", "size1"],
|
305
|
+
["size_t", "size2"],
|
306
|
+
["gsl_wavelet_workspace *", "work"]],
|
307
|
+
:desc=>
|
308
|
+
"These functions compute the two-dimensional wavelet transform in\n" +
|
309
|
+
"non-standard form."},
|
310
|
+
{:func_name=>"gsl_wavelet2d_nstransform_matrix",
|
311
|
+
:func_type=>"int",
|
312
|
+
:args=>
|
313
|
+
[["const gsl_wavelet *", "w"],
|
314
|
+
["gsl_matrix *", "m"],
|
315
|
+
["gsl_wavelet_direction", "dir"],
|
316
|
+
["gsl_wavelet_workspace *", "work"]],
|
317
|
+
:desc=>
|
318
|
+
"These functions compute the non-standard form of the two-dimensional\n" +
|
319
|
+
"in-place wavelet transform on a matrix a."},
|
320
|
+
{:func_name=>"gsl_wavelet2d_nstransform_matrix_forward",
|
321
|
+
:func_type=>"int",
|
322
|
+
:args=>
|
323
|
+
[["const gsl_wavelet *", "w"],
|
324
|
+
["gsl_matrix *", "m"],
|
325
|
+
["gsl_wavelet_workspace *", "work"]],
|
326
|
+
:desc=>
|
327
|
+
"These functions compute the non-standard form of the two-dimensional\n" +
|
328
|
+
"in-place wavelet transform on a matrix a."},
|
329
|
+
{:func_name=>"gsl_wavelet2d_nstransform_matrix_inverse",
|
330
|
+
:func_type=>"int",
|
331
|
+
:args=>
|
332
|
+
[["const gsl_wavelet *", "w"],
|
333
|
+
["gsl_matrix *", "m"],
|
334
|
+
["gsl_wavelet_workspace *", "work"]],
|
335
|
+
:desc=>
|
336
|
+
"These functions compute the non-standard form of the two-dimensional\n" +
|
337
|
+
"in-place wavelet transform on a matrix a."}]
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require_relative "../gen/erbpp_gsl"
|
2
|
+
|
3
|
+
class DefWavelet < DefGslClass
|
4
|
+
|
5
|
+
WAVELET_TYPES = ErbppGsl.read_type.select{|s| /gsl_wavelet_/ =~ s}
|
6
|
+
|
7
|
+
def lookup(h)
|
8
|
+
t = get(:struct)
|
9
|
+
ws = t + "_workspace *"
|
10
|
+
dr = t + "_direction"
|
11
|
+
case h
|
12
|
+
when FM(name:/_free$/); false
|
13
|
+
when FM(name:"gsl_wavelet_workspace_alloc"); "c_new_sizet"
|
14
|
+
when FM(/_type /, szt, name:/_alloc$/); "wavelet_new"
|
15
|
+
when FM(tp, type:str); "c_str_f_void"
|
16
|
+
when FM(tp, type:uint); "c_uint_f_void"
|
17
|
+
|
18
|
+
when FM(tp,dblp,szt,szt,dr,ws); "wavelet_transform"
|
19
|
+
when FM(tp,dblp,szt,szt,ws); "wavelet_transform2"
|
20
|
+
when FM(tp,dblp,*[szt]*3,dr,ws); "wavelet2d_transform"
|
21
|
+
when FM(tp,dblp,*[szt]*3,ws); "wavelet_transform2"
|
22
|
+
|
23
|
+
when FM(tp); "c_self_f_void"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def check_func(h)
|
28
|
+
if t = lookup(h)
|
29
|
+
m = h[:func_name].sub(/^gsl_[^_]+_/,"")
|
30
|
+
DefMethod.new(self, t, name:m, **h)
|
31
|
+
def_type_new(h)
|
32
|
+
return true
|
33
|
+
end
|
34
|
+
$stderr.puts "skip #{h[:func_name]}"
|
35
|
+
false
|
36
|
+
end
|
37
|
+
|
38
|
+
def def_type_new(h)
|
39
|
+
case h[:func_name]
|
40
|
+
when "gsl_wavelet_alloc"
|
41
|
+
t = "wavelet_type_new"
|
42
|
+
WAVELET_TYPES.each do |st|
|
43
|
+
DefSubclassNew.new(self, t, st, **h)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|