Sha256: 52807d92839a49d0625547e9397713d9629cb4daf43bad2f8bacf8874544b983

Contents?: true

Size: 556 Bytes

Versions: 3

Compression:

Stored size: 556 Bytes

Contents

<%
set name: "new"
set singleton: true
%>
/*
  :nodoc:
 */
static VALUE
<%=c_func(:nodef)%>(int argc, VALUE *argv, VALUE self, const <%=type_struct%> *t)
{
    <%=struct%> *w;

    if (argc > 1) {
        rb_raise(rb_eArgError,"wrong number of arguments (given %d, expected 0..1)", argc);
    }
    w = <%=func_name%>(t);
    if (!w) {
        rb_raise(rb_eNoMemError,"fail to allocate struct");
    }
    if (argc == 1) {
        gsl_rng_set(w, NUM2ULONG(argv[0]));
    }
    return TypedData_Wrap_Struct(<%=class_var%>, &<%=data_type_var%>, (void*)w);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
numo-gsl-0.1.2 ext/numo/gsl/rng/tmpl/rng_alloc.c
numo-gsl-0.1.1 ext/numo/gsl/rng/tmpl/rng_alloc.c
numo-gsl-0.1.0 ext/numo/gsl/rng/tmpl/rng_alloc.c