Sha256: e200522239aa8b6daa0ac042f2d013b56e57fa70708970233950f4ff7cf96dfe

Contents?: true

Size: 576 Bytes

Versions: 3

Compression:

Stored size: 576 Bytes

Contents

<%
set singleton: true
%>
/*
  @overload <%=name%>(nary)
  @param  [Numo::DFloat]          nary
  @return [<%=full_class_name%>]  result

  <%= description %>
*/
static VALUE
<%=c_func(1)%>(VALUE klass, VALUE nary)
{
    <%=struct%> *s;
    gsl_matrix *m;
    narray_t *na;

    nary = cast_2d_contiguous(nary,cDF);
    GetNArray(nary,na);

    ALLOCA_GSL_MATRIX_FROM_NARRAY_R(nary,m);
    s = gsl_spmatrix_alloc(na->shape[0], na->shape[1]);

    <%=func_name%>(s, m);

    RB_GC_GUARD(nary);
    return TypedData_Wrap_Struct(<%=class_var%>, &<%=data_type_var%>, (void*)s);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
numo-gsl-0.1.2 ext/numo/gsl/spmatrix/tmpl/spmatrix_d2sp.c
numo-gsl-0.1.1 ext/numo/gsl/spmatrix/tmpl/spmatrix_d2sp.c
numo-gsl-0.1.0 ext/numo/gsl/spmatrix/tmpl/spmatrix_d2sp.c