ext/cumo/narray/gen/tmpl/median.c in cumo-0.1.0 vs ext/cumo/narray/gen/tmpl/median.c in cumo-0.1.1

- old
+ new

@@ -1,19 +1,19 @@ <% (is_float ? ["_ignan","_prnan"] : [""]).each do |j| %> static void -<%=c_iter%><%=j%>(na_loop_t *const lp) +<%=c_iter%><%=j%>(cumo_na_loop_t *const lp) { size_t n; char *p1, *p2; dtype *buf; - INIT_COUNTER(lp, n); + CUMO_INIT_COUNTER(lp, n); p1 = (lp->args[0]).ptr + (lp->args[0].iter[0]).pos; p2 = (lp->args[1]).ptr + (lp->args[1].iter[0]).pos; buf = (dtype*)p1; - SHOW_SYNCHRONIZE_FIXME_WARNING_ONCE("<%=name%><%=j%>", "<%=type_name%>"); + CUMO_SHOW_SYNCHRONIZE_FIXME_WARNING_ONCE("<%=name%><%=j%>", "<%=type_name%>"); <%=type_name%>_qsort<%=j%>(buf, n, sizeof(dtype)); <% if is_float %> for (; n; n--) { if (!isnan(buf[n-1])) break; @@ -47,20 +47,20 @@ static VALUE <%=c_func(-1)%>(int argc, VALUE *argv, VALUE self) { VALUE v, reduce; - ndfunc_arg_in_t ain[2] = {{OVERWRITE,0},{sym_reduce,0}}; - ndfunc_arg_out_t aout[1] = {{INT2FIX(0),0}}; - ndfunc_t ndf = {0, NDF_HAS_LOOP|NDF_FLAT_REDUCE, 2,1, ain,aout}; + cumo_ndfunc_arg_in_t ain[2] = {{CUMO_OVERWRITE,0},{cumo_sym_reduce,0}}; + cumo_ndfunc_arg_out_t aout[1] = {{INT2FIX(0),0}}; + cumo_ndfunc_t ndf = {0, CUMO_NDF_HAS_LOOP|CUMO_NDF_FLAT_REDUCE, 2,1, ain,aout}; - self = na_copy(self); // as temporary buffer + self = cumo_na_copy(self); // as temporary buffer <% if is_float %> ndf.func = <%=c_iter%>_ignan; - reduce = na_reduce_dimension(argc, argv, 1, &self, &ndf, <%=c_iter%>_prnan); + reduce = cumo_na_reduce_dimension(argc, argv, 1, &self, &ndf, <%=c_iter%>_prnan); <% else %> ndf.func = <%=c_iter%>; - reduce = na_reduce_dimension(argc, argv, 1, &self, &ndf, 0); + reduce = cumo_na_reduce_dimension(argc, argv, 1, &self, &ndf, 0); <% end %> - v = na_ndloop(&ndf, 2, self, reduce); + v = cumo_na_ndloop(&ndf, 2, self, reduce); return <%=type_name%>_extract(v); }