Sha256: dd6d84ac5117bc9ca51136c7f63605321da4e7626bbc6cebe9404a06701b2703

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

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

    INIT_COUNTER(lp, i);
    INIT_PTR(lp, 0, p1, s1);
    INIT_PTR(lp, 1, p2, s2);
    INIT_PTR(lp, 2, p3, s3);
    opts = (int*)(lp->opt_ptr);

    for (; i--; ) {
        GET_DATA_STRIDE(p1,s1,double,x);
        GET_DATA_STRIDE(p2,s2,double,y);
        z = <%=func_name%>(opts[0],opts[1],x,y);
        SET_DATA_STRIDE(p3,s3,double,z);
    }
}

/*
  @overload <%=name%>(<%=args.map{|a| a[1]}.join(",")%>)
  @param  [Integer]  <%=args[0][1]%> parameter
  @param  [Integer]  <%=args[1][1]%> parameter
  @param  [DFloat]   <%=args[2][1]%>
  @param  [DFloat]   <%=args[3][1]%>
  @return [DFloat]   result

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

    opts[0] = NUM2INT(v0);
    opts[1] = NUM2INT(v1);

    return na_ndloop3(&ndf, opts, 2, v2, v3);
}

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_x2_DFloat_x2.c
numo-gsl-0.1.1 ext/numo/gsl/gen/tmpl/m_DFloat_f_int_x2_DFloat_x2.c
numo-gsl-0.1.0 ext/numo/gsl/gen/tmpl/m_DFloat_f_int_x2_DFloat_x2.c