Sha256: 7f55676d7719a37e3ea072867900167ec7a5af9f910e6fd2a128e40e5440326a

Contents?: true

Size: 948 Bytes

Versions: 7

Compression:

Stored size: 948 Bytes

Contents

void
<%=c_iter%>(na_loop_t *const lp)
{
    size_t i, s1;
    char *p1;
    size_t *idx1;
    dtype x;
    volatile VALUE a, y;

    INIT_COUNTER(lp, i);
    INIT_PTR_IDX(lp, 0, p1, s1, idx1);
    a = rb_ary_new2(i);
    rb_ary_push(lp->args[1].value, a);
    if (idx1) {
        for (; i--;) {
            GET_DATA_INDEX(p1,idx1,dtype,x);
            y = m_data_to_num(x);
            rb_ary_push(a,y);
        }
    } else {
        for (; i--;) {
            GET_DATA_STRIDE(p1,s1,dtype,x);
            y = m_data_to_num(x);
            rb_ary_push(a,y);
        }
    }
}

/*
  Convert self to Array.
  @overload <%=method%>
  @return [Array]
*/
static VALUE
<%=c_func%>(VALUE self)
{
    ndfunc_arg_in_t ain[3] = {{Qnil,0},{sym_loop_opt},{sym_option}};
    ndfunc_arg_out_t aout[1] = {{rb_cArray,0}}; // dummy?
    ndfunc_t ndf = { <%=c_iter%>, FULL_LOOP_NIP, 3, 1, ain, aout };
    return na_ndloop_cast_narray_to_rarray(&ndf, self, Qnil);
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
numo-narray-0.9.0.4 ext/numo/narray/gen/tmpl/to_a.c
numo-narray-0.9.0.3-x86-mingw32 ext/numo/narray/gen/tmpl/to_a.c
numo-narray-0.9.0.3-x64-mingw32 ext/numo/narray/gen/tmpl/to_a.c
numo-narray-0.9.0.3 ext/numo/narray/gen/tmpl/to_a.c
numo-narray-0.9.0.1-x64-mingw32 ext/numo/narray/gen/tmpl/to_a.c
numo-narray-0.9.0.1 ext/numo/narray/gen/tmpl/to_a.c
numo-narray-0.9.0.1-x86-mingw32 ext/numo/narray/gen/tmpl/to_a.c