ext/numo/narray/gen/tmpl_bit/bit_count.c in numo-narray-0.9.0.4 vs ext/numo/narray/gen/tmpl_bit/bit_count.c in numo-narray-0.9.0.5
- old
+ new
@@ -20,41 +20,41 @@
GET_DATA(p2, int_t, y);
if (idx1) {
for (; i--;) {
LOAD_BIT(a1, p1+*idx1, x);
idx1++;
- if (m_<%=method%>(x)) {
+ if (m_<%=name%>(x)) {
y++;
}
}
} else {
for (; i--;) {
LOAD_BIT(a1, p1, x);
p1 += s1;
- if (m_<%=method%>(x)) {
+ if (m_<%=name%>(x)) {
y++;
}
}
}
*(int_t*)p2 = y;
} else {
if (idx1) {
for (; i--;) {
LOAD_BIT(a1, p1+*idx1, x);
idx1++;
- if (m_<%=method%>(x)) {
+ if (m_<%=name%>(x)) {
GET_DATA(p2, int_t, y);
y++;
SET_DATA(p2, int_t, y);
}
p2+=s2;
}
} else {
for (; i--;) {
LOAD_BIT(a1, p1, x);
p1+=s1;
- if (m_<%=method%>(x)) {
+ if (m_<%=name%>(x)) {
GET_DATA(p2, int_t, y);
y++;
SET_DATA(p2, int_t, y);
}
p2+=s2;
@@ -64,21 +64,21 @@
}
/*
Returns the number of bits.
If argument is supplied, return Int-array counted along the axes.
- @overload <%=op_map%>([axis,..])
- @param [Integer] axis axes to be counted.
+ @overload <%=op_map%>(axis:nil)
+ @param [Integer,Array,Range] axis axes to be counted.
@return [Numo::Int64]
*/
static VALUE
-<%=c_func%>(int argc, VALUE *argv, VALUE self)
+<%=c_func(-1)%>(int argc, VALUE *argv, VALUE self)
{
VALUE v, reduce;
ndfunc_arg_in_t ain[3] = {{cT,0},{sym_reduce,0},{sym_init,0}};
ndfunc_arg_out_t aout[1] = {{numo_cInt64,0}};
ndfunc_t ndf = { <%=c_iter%>, FULL_LOOP_NIP, 3, 1, ain, aout };
- reduce = na_reduce_dimension(argc, argv, 1, &self);
+ reduce = na_reduce_dimension(argc, argv, 1, &self, 0);
v = na_ndloop(&ndf, 3, self, reduce, INT2FIX(0));
return rb_funcall(v,rb_intern("extract"),0);
}