Sha256: 2ba1617183b95420fc2956cc2ba3b707a453556d0985bfc87241858f5e6428e9

Contents?: true

Size: 746 Bytes

Versions: 3

Compression:

Stored size: 746 Bytes

Contents

static void
iter_<%=c_func%>(na_loop_t *const lp)
{
    size_t   i;
    char    *p1, *p2;
    ssize_t  s1, s2;
    int      x;
    double   y;

    INIT_COUNTER(lp, i);
    INIT_PTR(lp, 0, p1, s1);
    INIT_PTR(lp, 1, p2, s2);

    for (; i--; ) {
        GET_DATA_STRIDE(p1,s1,int,x);
        y = <%=func_name%>(x);
        SET_DATA_STRIDE(p2,s2,double,y);
    }
}

/*
  @overload <%=name%>(<%=args[0][1]%>)
  @param  [Int]  <%=args[0][1]%>
  @return [DFloat]   result

  <%= description %>
*/
static VALUE
<%=c_func(1)%>(VALUE mod, VALUE v0)
{
    ndfunc_arg_in_t ain[1] = {{cInt,0}};
    ndfunc_arg_out_t aout[1] = {{cDF,0}};
    ndfunc_t ndf = {iter_<%=c_func%>, STRIDE_LOOP|NDF_EXTRACT, 1,1, ain,aout};

    return na_ndloop(&ndf, 1, v0);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
numo-gsl-0.1.2 ext/numo/gsl/gen/tmpl/m_DFloat_f_Int.c
numo-gsl-0.1.1 ext/numo/gsl/gen/tmpl/m_DFloat_f_Int.c
numo-gsl-0.1.0 ext/numo/gsl/gen/tmpl/m_DFloat_f_Int.c