Lines Matching refs:self
222 ndarray_dealloc(NDArrayObject *self)
224 if (self->head) {
225 if (ND_IS_CONSUMER(self)) {
226 Py_buffer *base = &self->head->base;
227 if (self->head->flags & ND_OWN_ARRAYS) {
235 while (self->head)
236 ndbuf_pop(self);
239 PyObject_Free(self);
1280 ndarray_init(PyObject *self, PyObject *args, PyObject *kwds)
1282 NDArrayObject *nd = (NDArrayObject *)self;
1346 ndarray_push(PyObject *self, PyObject *args, PyObject *kwds)
1348 NDArrayObject *nd = (NDArrayObject *)self;
1388 ndarray_pop(PyObject *self, PyObject *dummy)
1390 NDArrayObject *nd = (NDArrayObject *)self;
1417 ndarray_getbuf(NDArrayObject *self, Py_buffer *view, int flags)
1419 ndbuf_t *ndbuf = self->head;
1527 view->obj = (PyObject *)self;
1529 self->head->exports++;
1535 ndarray_releasebuf(NDArrayObject *self, Py_buffer *view)
1537 if (!ND_IS_CONSUMER(self)) {
1539 if (--ndbuf->exports == 0 && ndbuf != self->head)
1540 ndbuf_delete(self, ndbuf);
1588 ndarray_item(NDArrayObject *self, Py_ssize_t index)
1590 ndbuf_t *ndbuf = self->head;
1614 if (ndarray_init_staticbuf((PyObject *)self, nd, PyBUF_FULL_RO) < 0) {
1780 ndarray_subscript(NDArrayObject *self, PyObject *key)
1784 Py_buffer *base = &self->head->base;
1791 Py_INCREF(self);
1792 return (PyObject *)self;
1803 return ndarray_item(self, index);
1811 if (ndarray_init_staticbuf((PyObject *)self, nd, PyBUF_FULL_RO) < 0) {
1865 ndarray_ass_subscript(NDArrayObject *self, PyObject *key, PyObject *value)
1868 Py_buffer *dest = &self->head->base;
1910 nd = (NDArrayObject *)ndarray_subscript(self, key);
1922 slice_indices(PyObject *self, PyObject *args)
2004 ndarray_get_flags(NDArrayObject *self, void *closure)
2006 return PyLong_FromLong(self->head->flags);
2010 ndarray_get_offset(NDArrayObject *self, void *closure)
2012 ndbuf_t *ndbuf = self->head;
2017 ndarray_get_obj(NDArrayObject *self, void *closure)
2019 Py_buffer *base = &self->head->base;
2029 ndarray_get_nbytes(NDArrayObject *self, void *closure)
2031 Py_buffer *base = &self->head->base;
2036 ndarray_get_readonly(NDArrayObject *self, void *closure)
2038 Py_buffer *base = &self->head->base;
2043 ndarray_get_itemsize(NDArrayObject *self, void *closure)
2045 Py_buffer *base = &self->head->base;
2050 ndarray_get_format(NDArrayObject *self, void *closure)
2052 Py_buffer *base = &self->head->base;
2058 ndarray_get_ndim(NDArrayObject *self, void *closure)
2060 Py_buffer *base = &self->head->base;
2065 ndarray_get_shape(NDArrayObject *self, void *closure)
2067 Py_buffer *base = &self->head->base;
2072 ndarray_get_strides(NDArrayObject *self, void *closure)
2074 Py_buffer *base = &self->head->base;
2079 ndarray_get_suboffsets(NDArrayObject *self, void *closure)
2081 Py_buffer *base = &self->head->base;
2086 ndarray_c_contig(PyObject *self, PyObject *dummy)
2088 NDArrayObject *nd = (NDArrayObject *)self;
2100 ndarray_fortran_contig(PyObject *self, PyObject *dummy)
2102 NDArrayObject *nd = (NDArrayObject *)self;
2114 ndarray_contig(PyObject *self, PyObject *dummy)
2116 NDArrayObject *nd = (NDArrayObject *)self;
2150 ndarray_tolist(PyObject *self, PyObject *dummy)
2152 return ndarray_as_list((NDArrayObject *)self);
2156 ndarray_tobytes(PyObject *self, PyObject *dummy)
2158 ndbuf_t *ndbuf = ((NDArrayObject *)self)->head;
2196 ndarray_add_suboffsets(PyObject *self, PyObject *dummy)
2198 NDArrayObject *nd = (NDArrayObject *)self;
2232 ndarray_memoryview_from_buffer(PyObject *self, PyObject *dummy)
2234 const NDArrayObject *nd = (NDArrayObject *)self;
2245 ndbuf = nd->head; /* self is ndarray/original exporter */
2247 /* self is ndarray and consumer from ndarray/original exporter */
2306 get_pointer(PyObject *self, PyObject *args)
2355 get_sizeof_void_p(PyObject *self, PyObject *Py_UNUSED(ignored))
2391 get_contiguous(PyObject *self, PyObject *args)
2428 py_buffer_to_contiguous(PyObject *self, PyObject *args)
2503 cmp_contig(PyObject *self, PyObject *args)
2567 is_contiguous(PyObject *self, PyObject *args)
2605 ndarray_hash(PyObject *self)
2607 const NDArrayObject *nd = (NDArrayObject *)self;
2621 bytes = ndarray_tobytes(self, NULL);
2719 staticarray_init(PyObject *self, PyObject *args, PyObject *kwds)
2721 StaticArrayObject *a = (StaticArrayObject *)self;
2735 staticarray_dealloc(StaticArrayObject *self)
2737 PyObject_Free(self);
2743 staticarray_getbuf(StaticArrayObject *self, Py_buffer *view, int flags)
2747 if (self->legacy_mode) {
2751 view->obj = (PyObject *)self;