Lines Matching defs:dim
211 #define HAVE_PTR(suboffsets, dim) (suboffsets && suboffsets[dim] >= 0)
213 #define ADJUST_PTR(ptr, suboffsets, dim) \
214 (HAVE_PTR(suboffsets, dim) ? *((char**)ptr) + suboffsets[dim] : ptr)
2283 lookup_dimension(const Py_buffer *view, char *ptr, int dim, Py_ssize_t index)
2290 nitems = view->shape[dim];
2296 "index out of bounds on dimension %d", dim + 1);
2300 ptr += view->strides[dim] * index;
2302 ptr = ADJUST_PTR(ptr, view->suboffsets, dim);
2320 Py_ssize_t dim, nindices = PyTuple_GET_SIZE(tup);
2329 for (dim = 0; dim < nindices; dim++) {
2331 index = PyNumber_AsSsize_t(PyTuple_GET_ITEM(tup, dim),
2335 ptr = lookup_dimension(view, ptr, (int)dim, index);
2358 PyErr_SetString(PyExc_TypeError, "invalid indexing of 0-dim memory");
2400 init_slice(Py_buffer *base, PyObject *key, int dim)
2407 slicelength = PySlice_AdjustIndices(base->shape[dim], &start, &stop, step);
2410 if (base->suboffsets == NULL || dim == 0) {
2412 base->buf = (char *)base->buf + base->strides[dim] * start;
2415 Py_ssize_t n = dim-1;
2420 base->suboffsets[n] = base->suboffsets[n] + base->strides[dim] * start;
2422 base->shape[dim] = slicelength;
2423 base->strides[dim] = base->strides[dim] * step;
2491 "invalid indexing of 0-dim memory");
2562 "invalid indexing of 0-dim memory");
3238 PyErr_SetString(PyExc_TypeError, "invalid indexing of 0-dim memory");