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,19 @@
|
|
1
|
+
/*
|
2
|
+
@overload <%=name%>()
|
3
|
+
@return [<%=full_class_name%>]
|
4
|
+
|
5
|
+
<%= desc %>
|
6
|
+
*/
|
7
|
+
static VALUE
|
8
|
+
<%=c_func(0)%>(VALUE self)
|
9
|
+
{
|
10
|
+
<%=struct%> *x, *w;
|
11
|
+
|
12
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, x);
|
13
|
+
|
14
|
+
w = <%=func_name%>(x);
|
15
|
+
if (!w) {
|
16
|
+
rb_raise(rb_eNoMemError,"fail to allocate struct");
|
17
|
+
}
|
18
|
+
return TypedData_Wrap_Struct(<%=class_var%>, &<%=data_type_var%>, (void*)w);
|
19
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
static void
|
2
|
+
iter_<%=c_func%>(na_loop_t *const lp)
|
3
|
+
{
|
4
|
+
size_t i;
|
5
|
+
char *p1;
|
6
|
+
ssize_t s1;
|
7
|
+
size_t *idx1;
|
8
|
+
double x;
|
9
|
+
<%=struct%> *w = (<%=struct%>*)(lp->opt_ptr);
|
10
|
+
<% c_args = get(:postpose) ? "x,w" : "w,x" %>
|
11
|
+
|
12
|
+
INIT_COUNTER(lp, i);
|
13
|
+
INIT_PTR_IDX(lp, 0, p1, s1, idx1);
|
14
|
+
|
15
|
+
if (idx1) {
|
16
|
+
for (; i--;) {
|
17
|
+
GET_DATA_INDEX(p1,idx1,double,x);
|
18
|
+
<%=func_name%>(<%=c_args%>);
|
19
|
+
}
|
20
|
+
} else {
|
21
|
+
for (; i--;) {
|
22
|
+
GET_DATA_STRIDE(p1,s1,double,x);
|
23
|
+
<%=func_name%>(<%=c_args%>);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
/*
|
29
|
+
@overload <%=name%>(<%=args[1][1]%>)
|
30
|
+
@param [DFloat] <%=args[1][1]%>
|
31
|
+
@return [<%=class_name%>] self
|
32
|
+
|
33
|
+
<%= description %>
|
34
|
+
*/
|
35
|
+
static VALUE
|
36
|
+
<%=c_func(1)%>(VALUE self, VALUE v1)
|
37
|
+
{
|
38
|
+
<%=struct%> *w;
|
39
|
+
ndfunc_arg_in_t ain[1] = {{cDF,0}};
|
40
|
+
ndfunc_t ndf = {iter_<%=c_func%>, FULL_LOOP, 1,0, ain,0};
|
41
|
+
|
42
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
43
|
+
|
44
|
+
na_ndloop3(&ndf, w, 1, v1);
|
45
|
+
return self;
|
46
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
static void
|
2
|
+
iter_<%=c_func%>(na_loop_t *const lp)
|
3
|
+
{
|
4
|
+
size_t i;
|
5
|
+
char *p1, *p2;
|
6
|
+
ssize_t s1, s2;
|
7
|
+
double x, y;
|
8
|
+
<%=struct%> *w = (<%=struct%>*)(lp->opt_ptr);
|
9
|
+
<% c_args = get(:postpose) ? "x,y,w" : "w,x,y" %>
|
10
|
+
|
11
|
+
INIT_COUNTER(lp, i);
|
12
|
+
INIT_PTR(lp, 0, p1, s1);
|
13
|
+
INIT_PTR(lp, 1, p2, s2);
|
14
|
+
|
15
|
+
for (; i--;) {
|
16
|
+
GET_DATA_STRIDE(p1,s1,double,x);
|
17
|
+
GET_DATA_STRIDE(p2,s2,double,y);
|
18
|
+
<%=func_name%>(<%=c_args%>);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
/*
|
23
|
+
@overload <%=name%>(<%=args[1..2].map{|a| a[1]}.join(",")%>)
|
24
|
+
@param [DFloat] <%=args[1][1]%>
|
25
|
+
@param [DFloat] <%=args[2][1]%>
|
26
|
+
@return [<%=class_name%>] self
|
27
|
+
|
28
|
+
<%= description %>
|
29
|
+
*/
|
30
|
+
static VALUE
|
31
|
+
<%=c_func(2)%>(VALUE self, VALUE v1, VALUE v2)
|
32
|
+
{
|
33
|
+
<%=struct%> *w;
|
34
|
+
ndfunc_arg_in_t ain[2] = {{cDF,0},{cDF,0}};
|
35
|
+
ndfunc_t ndf = {iter_<%=c_func%>, STRIDE_LOOP, 2,0, ain,0};
|
36
|
+
|
37
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
38
|
+
|
39
|
+
na_ndloop3(&ndf, w, 2, v1, v2);
|
40
|
+
return self;
|
41
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
static void
|
2
|
+
iter_<%=c_func%>(na_loop_t *const lp)
|
3
|
+
{
|
4
|
+
size_t i;
|
5
|
+
char *p1, *p2, *p3;
|
6
|
+
ssize_t s1, s2, s3;
|
7
|
+
double x1, x2, x3;
|
8
|
+
<%=struct%> *w = (<%=struct%>*)(lp->opt_ptr);
|
9
|
+
<% c_args = get(:postpose) ? "x1,x2,x3,w" : "w,x1,x2,x3" %>
|
10
|
+
|
11
|
+
INIT_COUNTER(lp, i);
|
12
|
+
INIT_PTR(lp, 0, p1, s1);
|
13
|
+
INIT_PTR(lp, 1, p2, s2);
|
14
|
+
INIT_PTR(lp, 2, p3, s3);
|
15
|
+
|
16
|
+
for (; i--;) {
|
17
|
+
GET_DATA_STRIDE(p1,s1,double,x1);
|
18
|
+
GET_DATA_STRIDE(p2,s2,double,x2);
|
19
|
+
GET_DATA_STRIDE(p3,s3,double,x3);
|
20
|
+
<%=func_name%>(<%=c_args%>);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
/*
|
25
|
+
@overload <%=name%>(<%=args[1..3].map{|a| a[1]}.join(",")%>)
|
26
|
+
@param [DFloat] <%=args[1][1]%>
|
27
|
+
@param [DFloat] <%=args[2][1]%>
|
28
|
+
@param [DFloat] <%=args[3][1]%>
|
29
|
+
@return [<%=class_name%>] self
|
30
|
+
|
31
|
+
<%= description %>
|
32
|
+
*/
|
33
|
+
static VALUE
|
34
|
+
<%=c_func(3)%>(VALUE self, VALUE v1, VALUE v2, VALUE v3)
|
35
|
+
{
|
36
|
+
<%=struct%> *w;
|
37
|
+
ndfunc_arg_in_t ain[3] = {{cDF,0},{cDF,0},{cDF,0}};
|
38
|
+
ndfunc_t ndf = {iter_<%=c_func%>, STRIDE_LOOP, 3,0, ain,0};
|
39
|
+
|
40
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
41
|
+
|
42
|
+
na_ndloop3(&ndf, w, 3, v1, v2, v3);
|
43
|
+
return self;
|
44
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
static void
|
2
|
+
iter_<%=c_func%>(na_loop_t *const lp)
|
3
|
+
{
|
4
|
+
size_t i;
|
5
|
+
char *p1, *p2, *p3, *p4;
|
6
|
+
ssize_t s1, s2, s3, s4;
|
7
|
+
double x1, x2, x3, x4;
|
8
|
+
<%=struct%> *w = (<%=struct%>*)(lp->opt_ptr);
|
9
|
+
<% c_args = get(:postpose) ? "x1,x2,x3,x4,w" : "w,x1,x2,x3,x4" %>
|
10
|
+
|
11
|
+
INIT_COUNTER(lp, i);
|
12
|
+
INIT_PTR(lp, 0, p1, s1);
|
13
|
+
INIT_PTR(lp, 1, p2, s2);
|
14
|
+
INIT_PTR(lp, 2, p3, s3);
|
15
|
+
INIT_PTR(lp, 3, p4, s4);
|
16
|
+
|
17
|
+
for (; i--;) {
|
18
|
+
GET_DATA_STRIDE(p1,s1,double,x1);
|
19
|
+
GET_DATA_STRIDE(p2,s2,double,x2);
|
20
|
+
GET_DATA_STRIDE(p3,s3,double,x3);
|
21
|
+
GET_DATA_STRIDE(p4,s4,double,x4);
|
22
|
+
<%=func_name%>(<%=c_args%>);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
/*
|
27
|
+
@overload <%=name%>(<%=args[1..4].map{|a| a[1]}.join(",")%>)
|
28
|
+
@param [DFloat] <%=args[1][1]%>
|
29
|
+
@param [DFloat] <%=args[2][1]%>
|
30
|
+
@param [DFloat] <%=args[3][1]%>
|
31
|
+
@param [DFloat] <%=args[4][1]%>
|
32
|
+
@return [<%=class_name%>] self
|
33
|
+
|
34
|
+
<%= description %>
|
35
|
+
*/
|
36
|
+
static VALUE
|
37
|
+
<%=c_func(4)%>(VALUE self, VALUE v1, VALUE v2, VALUE v3, VALUE v4)
|
38
|
+
{
|
39
|
+
<%=struct%> *w;
|
40
|
+
ndfunc_arg_in_t ain[4] = {{cDF,0},{cDF,0},{cDF,0},{cDF,0}};
|
41
|
+
ndfunc_t ndf = {iter_<%=c_func%>, STRIDE_LOOP, 4,0, ain,0};
|
42
|
+
|
43
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
44
|
+
|
45
|
+
na_ndloop3(&ndf, w, 4, v1, v2, v3, v4);
|
46
|
+
return self;
|
47
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
static void
|
2
|
+
iter_<%=c_func%>(na_loop_t *const lp)
|
3
|
+
{
|
4
|
+
size_t i;
|
5
|
+
char *p1, *p2, *p3;
|
6
|
+
ssize_t s1, s2, s3;
|
7
|
+
size_t x, y;
|
8
|
+
double z;
|
9
|
+
<%=struct%> *w = (<%=struct%>*)(lp->opt_ptr);
|
10
|
+
<% c_args = get(:postpose) ? "x,y,z,w" : "w,x,y,z" %>
|
11
|
+
|
12
|
+
INIT_COUNTER(lp, i);
|
13
|
+
INIT_PTR(lp, 0, p1, s1);
|
14
|
+
INIT_PTR(lp, 1, p2, s2);
|
15
|
+
INIT_PTR(lp, 2, p3, s3);
|
16
|
+
|
17
|
+
for (; i--; ) {
|
18
|
+
GET_DATA_STRIDE(p1,s1,size_t,x);
|
19
|
+
GET_DATA_STRIDE(p2,s2,size_t,y);
|
20
|
+
GET_DATA_STRIDE(p3,s3,double,z);
|
21
|
+
<%=func_name%>(<%=c_args%>);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
/*
|
26
|
+
@overload <%=name%>(<%=args[1][1]%>,<%=args[2][1]%>,<%=args[2][1]%>)
|
27
|
+
@param [UInt] <%=args[1][1]%>
|
28
|
+
@param [UInt] <%=args[2][1]%>
|
29
|
+
@param [DFloat] <%=args[3][1]%>
|
30
|
+
@return [DFloat] self
|
31
|
+
|
32
|
+
<%= description %>
|
33
|
+
*/
|
34
|
+
static VALUE
|
35
|
+
<%=c_func(3)%>(VALUE self, VALUE v1, VALUE v2, VALUE v3)
|
36
|
+
{
|
37
|
+
<%=struct%> *w;
|
38
|
+
ndfunc_arg_in_t ain[3] = {{cSZ,0},{cSZ,0},{cDF,0}};
|
39
|
+
ndfunc_t ndf = {iter_<%=c_func%>, STRIDE_LOOP|NDF_EXTRACT, 3,0, ain,0};
|
40
|
+
|
41
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
42
|
+
|
43
|
+
na_ndloop3(&ndf, w, 3, v1, v2, v3);
|
44
|
+
return self;
|
45
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/*
|
2
|
+
@overload <%=name%>(<%=args[1][1]%>)
|
3
|
+
@param [Float] <%=args[1][1]%>
|
4
|
+
@return [<%=full_class_name%>] self
|
5
|
+
|
6
|
+
<%= description %>
|
7
|
+
*/
|
8
|
+
static VALUE
|
9
|
+
<%=c_func(1)%>(VALUE self, VALUE v1)
|
10
|
+
{
|
11
|
+
<%=struct%> *w;
|
12
|
+
|
13
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
14
|
+
|
15
|
+
<%=func_name%>(w, NUM2DBL(v1));
|
16
|
+
return self;
|
17
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/*
|
2
|
+
@overload <%=name%>(<%=args[1][1]%>)
|
3
|
+
@param [<%=full_class_name%>] <%=args[1][1]%> other
|
4
|
+
@return [<%=full_class_name%>] self
|
5
|
+
|
6
|
+
<%= description %>
|
7
|
+
*/
|
8
|
+
static VALUE
|
9
|
+
<%=c_func(1)%>(VALUE self, VALUE other)
|
10
|
+
{
|
11
|
+
<%=struct%> *w, *x;
|
12
|
+
|
13
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
14
|
+
TypedData_Get_Struct(other, <%=struct%>, &<%=data_type_var%>, x);
|
15
|
+
<%=func_name%>(w,x);
|
16
|
+
return self;
|
17
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/*
|
2
|
+
@overload <%=name%>(<%=args[1][1]%>)
|
3
|
+
@param [Integer] <%=args[1][1]%>
|
4
|
+
@return [<%=full_class_name%>] self
|
5
|
+
|
6
|
+
<%= description %>
|
7
|
+
*/
|
8
|
+
static VALUE
|
9
|
+
<%=c_func(1)%>(VALUE self, VALUE v1)
|
10
|
+
{
|
11
|
+
<%=struct%> *w;
|
12
|
+
|
13
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
14
|
+
|
15
|
+
<% if get(:postpose) %>
|
16
|
+
<%=func_name%>(NUM2SIZET(v1),w);
|
17
|
+
<% else %>
|
18
|
+
<%=func_name%>(w, NUM2SIZET(v1));
|
19
|
+
<% end %>
|
20
|
+
return self;
|
21
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
@overload <%=name%>()
|
3
|
+
@return [Integer]
|
4
|
+
|
5
|
+
<%= description %>
|
6
|
+
*/
|
7
|
+
static VALUE
|
8
|
+
<%=c_func(0)%>(VALUE self)
|
9
|
+
{
|
10
|
+
<%=struct%> *w;
|
11
|
+
|
12
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
13
|
+
|
14
|
+
return SIZET2NUM(<%=func_name%>(w));
|
15
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/*
|
2
|
+
@overload <%=name%>()
|
3
|
+
@return [Array] array of [<%=args[0][1]%>,<%=args[1][1]%>]
|
4
|
+
|
5
|
+
<%= description %>
|
6
|
+
*/
|
7
|
+
static VALUE
|
8
|
+
<%=c_func(0)%>(VALUE self)
|
9
|
+
{
|
10
|
+
size_t i, j;
|
11
|
+
<%=struct%> *w;
|
12
|
+
|
13
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
14
|
+
|
15
|
+
<%=func_name%>(w, &i, &j);
|
16
|
+
return rb_assoc_new(SIZET2NUM(i), SIZET2NUM(j));
|
17
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
@overload <%=name%>
|
3
|
+
@return [String]
|
4
|
+
|
5
|
+
<%= description %>
|
6
|
+
*/
|
7
|
+
static VALUE
|
8
|
+
<%=c_func(0)%>(VALUE self)
|
9
|
+
{
|
10
|
+
<%=struct%> *w;
|
11
|
+
|
12
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
13
|
+
|
14
|
+
return rb_str_new_cstr(<%=func_name%>(w));
|
15
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%
|
2
|
+
set name: "new"
|
3
|
+
set singleton: true
|
4
|
+
%>
|
5
|
+
/*
|
6
|
+
:nodoc:
|
7
|
+
*/
|
8
|
+
static VALUE
|
9
|
+
<%=c_func(1)%>(VALUE self, const <%=type_struct%> *t)
|
10
|
+
{
|
11
|
+
<%=struct%> *w;
|
12
|
+
|
13
|
+
w = <%=func_name%>(t);
|
14
|
+
if (!w) {
|
15
|
+
rb_raise(rb_eNoMemError,"fail to allocate struct");
|
16
|
+
}
|
17
|
+
return TypedData_Wrap_Struct(<%=class_var%>, &<%=data_type_var%>, (void*)w);
|
18
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
@overload <%=name%>()
|
3
|
+
@return [Integer]
|
4
|
+
|
5
|
+
<%= description %>
|
6
|
+
*/
|
7
|
+
static VALUE
|
8
|
+
<%=c_func(0)%>(VALUE self)
|
9
|
+
{
|
10
|
+
<%=struct%> *w;
|
11
|
+
|
12
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
13
|
+
|
14
|
+
return UINT2NUM(<%=func_name%>(w));
|
15
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
@overload <%=name%>()
|
3
|
+
@return [Integer]
|
4
|
+
|
5
|
+
<%= description %>
|
6
|
+
*/
|
7
|
+
static VALUE
|
8
|
+
<%=c_func(0)%>(VALUE self)
|
9
|
+
{
|
10
|
+
<%=struct%> *w;
|
11
|
+
|
12
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
13
|
+
|
14
|
+
return ULONG2NUM(<%=func_name%>(w));
|
15
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/*
|
2
|
+
@overload <%=name%>(<%=args[1][1]%>)
|
3
|
+
@param [Float] <%=args[1][1]%>
|
4
|
+
@return [Qnil]
|
5
|
+
|
6
|
+
<%= description %>
|
7
|
+
*/
|
8
|
+
static VALUE
|
9
|
+
<%=c_func(1)%>(VALUE self, VALUE v1)
|
10
|
+
{
|
11
|
+
<%=struct%> *w;
|
12
|
+
|
13
|
+
TypedData_Get_Struct(self, <%=struct%>, &<%=data_type_var%>, w);
|
14
|
+
|
15
|
+
<%=func_name%>(w, NUM2DBL(v1));
|
16
|
+
return Qnil;
|
17
|
+
}
|