Sha256: 796498e4250a8415f3a9f24342674b0dc7bb08a28909e0b221a4c97c48ee5bee

Contents?: true

Size: 537 Bytes

Versions: 7

Compression:

Stored size: 537 Bytes

Contents

/*
  Extract an element only if self is a dimensionless NArray.
  @overload extract
  @return [Numeric,Numo::NArray]
  --- Extract element value as Ruby Object if self is a dimensionless NArray,
  otherwise returns self.
*/
VALUE
numo_<%=tp%>_extract(VALUE self)
{
    volatile VALUE v;
    char *ptr;
    narray_t *na;
    GetNArray(self,na);

    if (na->ndim==0) {
        ptr = na_get_pointer_for_read(self) + na_get_offset(self);
        v = m_extract(ptr);
        na_release_lock(self);
        return v;
    }
    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/extract.c
numo-narray-0.9.0.3-x86-mingw32 ext/numo/narray/gen/tmpl/extract.c
numo-narray-0.9.0.3-x64-mingw32 ext/numo/narray/gen/tmpl/extract.c
numo-narray-0.9.0.3 ext/numo/narray/gen/tmpl/extract.c
numo-narray-0.9.0.1-x64-mingw32 ext/numo/narray/gen/tmpl/extract.c
numo-narray-0.9.0.1 ext/numo/narray/gen/tmpl/extract.c
numo-narray-0.9.0.1-x86-mingw32 ext/numo/narray/gen/tmpl/extract.c