Sha256: 4f0b4be213be6b43b01a47b6eaafc873d4bdd94b8628f976e225fd61d8119f92

Contents?: true

Size: 1.33 KB

Versions: 9

Compression:

Stored size: 1.33 KB

Contents

static void
<%=c_iter%>(na_loop_t *const lp)
{
    size_t     i;
    char      *p1;
    size_t     p2;
    ssize_t    s1, s2;
    size_t    *idx1, *idx2;
    BIT_DIGIT *a2, x;
    dtype      y;

    INIT_COUNTER(lp, i);
    INIT_PTR_IDX(lp, 0, p1, s1, idx1);
    INIT_PTR_BIT_IDX(lp, 1, a2, p2, s2, idx2);
    if (idx2) {
        if (idx1) {
            for (; i--;) {
                LOAD_BIT(a2, p2+*idx2, x); idx2++;
                y = m_from_sint(x);
                SET_DATA_INDEX(p1,idx1,dtype,y);
            }
        } else {
            for (; i--;) {
                LOAD_BIT(a2, p2+*idx2, x); idx2++;
                y = m_from_sint(x);
                SET_DATA_STRIDE(p1,s1,dtype,y);
            }
        }
    } else {
        if (idx1) {
            for (; i--;) {
                LOAD_BIT(a2, p2, x); p2 += s2;
                y = m_from_sint(x);
                SET_DATA_INDEX(p1,idx1,dtype,y);
            }
        } else {
            for (; i--;) {
                LOAD_BIT(a2, p2, x); p2 += s2;
                y = m_from_sint(x);
                SET_DATA_STRIDE(p1,s1,dtype,y);
            }
        }
    }
}


static VALUE
<%=c_func(:nodef)%>(VALUE self, VALUE obj)
{
    ndfunc_arg_in_t ain[2] = {{OVERWRITE,0},{Qnil,0}};
    ndfunc_t ndf = {<%=c_iter%>, FULL_LOOP, 2,0, ain,0};

    na_ndloop(&ndf, 2, self, obj);
    return self;
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
numo-narray-0.9.2.1 ext/numo/narray/gen/tmpl/store_bit.c
numo-narray-0.9.2.0 ext/numo/narray/gen/tmpl/store_bit.c
numo-narray-0.9.1.9 ext/numo/narray/gen/tmpl/store_bit.c
numo-narray-0.9.1.8 ext/numo/narray/gen/tmpl/store_bit.c
numo-narray-0.9.1.7 ext/numo/narray/gen/tmpl/store_bit.c
numo-narray-0.9.1.6 ext/numo/narray/gen/tmpl/store_bit.c
numo-narray-0.9.1.5 ext/numo/narray/gen/tmpl/store_bit.c
numo-narray-0.9.1.4 ext/numo/narray/gen/tmpl/store_bit.c
numo-narray-0.9.1.3 ext/numo/narray/gen/tmpl/store_bit.c