Sha256: 9d23a275edcbf5ebc1b95a79c8c954f8726598d8fe9cb3a5cd730c2dba97b1d0

Contents?: true

Size: 820 Bytes

Versions: 7

Compression:

Stored size: 820 Bytes

Contents

static void
<%=c_iter%>(na_loop_t *const lp)
{
    size_t n;
    char *ptr;
    ssize_t step;

    INIT_COUNTER(lp, n);
    INIT_PTR(lp, 0, ptr, step);
    <%=tp%>_qsort(ptr, n, step);
}

/*
 *  call-seq:
 *     narray.sort() => narray
 *     narray.sort(dim0,dim1,...) => narray
 *
 *  Return an index array of sort result.
 *
 *     Numo::DFloat[3,4,1,2].sort => Numo::DFloat[1,2,3,4]
 */
static VALUE
<%=c_func%>(int argc, VALUE *argv, VALUE self)
{
    VALUE reduce;
    ndfunc_arg_in_t ain[2] = {{OVERWRITE,0},{sym_reduce,0}};
    ndfunc_t ndf = {<%=c_iter%>, STRIDE_LOOP_NIP|NDF_INPLACE|NDF_FLAT_REDUCE, 2,0, ain,0};

    if (!TEST_INPLACE(self)) {
        self = na_copy(self);
    }
    reduce = na_reduce_dimension(argc, argv, 1, &self); // v[0] = self

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
numo-narray-0.9.0.4 ext/numo/narray/gen/tmpl/sort.c
numo-narray-0.9.0.3-x86-mingw32 ext/numo/narray/gen/tmpl/sort.c
numo-narray-0.9.0.3-x64-mingw32 ext/numo/narray/gen/tmpl/sort.c
numo-narray-0.9.0.3 ext/numo/narray/gen/tmpl/sort.c
numo-narray-0.9.0.1-x64-mingw32 ext/numo/narray/gen/tmpl/sort.c
numo-narray-0.9.0.1 ext/numo/narray/gen/tmpl/sort.c
numo-narray-0.9.0.1-x86-mingw32 ext/numo/narray/gen/tmpl/sort.c