• Home
  • Raw
  • Download

Lines Matching refs:ndim

154     base->ndim = 1;  in ndbuf_new()
267 if (ndbuf->base.ndim == 0) in init_flags()
473 copy_rec(const Py_ssize_t *shape, Py_ssize_t ndim, Py_ssize_t itemsize, in copy_rec() argument
480 assert(ndim >= 1); in copy_rec()
482 if (ndim == 1) { in copy_rec()
506 copy_rec(shape+1, ndim-1, itemsize, in copy_rec()
520 dest->ndim != src->ndim) in cmp_structure()
523 for (i = 0; i < dest->ndim; i++) { in cmp_structure()
541 assert(dest->ndim > 0); in copy_buffer()
549 if ((dest->suboffsets && dest->suboffsets[dest->ndim-1] >= 0) || in copy_buffer()
550 (src->suboffsets && src->suboffsets[src->ndim-1] >= 0) || in copy_buffer()
551 dest->strides[dest->ndim-1] != dest->itemsize || in copy_buffer()
552 src->strides[src->ndim-1] != src->itemsize) { in copy_buffer()
553 mem = PyMem_Malloc(dest->shape[dest->ndim-1] * dest->itemsize); in copy_buffer()
560 copy_rec(dest->shape, dest->ndim, dest->itemsize, in copy_buffer()
612 const Py_ssize_t *suboffsets, Py_ssize_t ndim, Py_ssize_t itemsize) in unpack_rec() argument
617 assert(ndim >= 0); in unpack_rec()
621 if (ndim == 0) { in unpack_rec()
644 ndim-1, itemsize); in unpack_rec()
682 assert(base->ndim <= 1); in ndarray_as_list()
720 base->ndim, base->itemsize); in ndarray_as_list()
892 s = PyMem_Malloc(base->ndim * (sizeof *s)); in strides_from_shape()
900 for (i = 1; i < base->ndim; i++) in strides_from_shape()
904 s[base->ndim-1] = base->itemsize; in strides_from_shape()
905 for (i = base->ndim-2; i >= 0; i--) in strides_from_shape()
931 Py_ssize_t ndim) in verify_structure() argument
936 assert(ndim >= 0); in verify_structure()
938 if (ndim == 0 && (offset < 0 || offset+itemsize > len)) in verify_structure()
941 for (n = 0; n < ndim; n++) in verify_structure()
948 for (n = 0; n < ndim; n++) in verify_structure()
953 for (n = 0; n < ndim; n++) in verify_structure()
1039 assert(base->ndim > 0); in init_suboffsets()
1065 for (n = 0; n < base->ndim; n++) { in init_suboffsets()
1083 base->suboffsets = PyMem_Malloc(base->ndim * (sizeof *base->suboffsets)); in init_suboffsets()
1089 for (n = 1; n < base->ndim; n++) in init_suboffsets()
1114 for (i = 0; i < base->ndim; i++) in init_len()
1121 Py_ssize_t ndim) in init_structure() argument
1125 base->ndim = (int)ndim; in init_structure()
1126 if (ndim == 0) { in init_structure()
1137 base->shape = seq_as_ssize_array(shape, ndim, 1); in init_structure()
1143 base->strides = seq_as_ssize_array(strides, ndim, 0); in init_structure()
1151 base->shape, base->strides, ndim) < 0) in init_structure()
1181 Py_ssize_t ndim; in init_ndbuf() local
1187 ndim = PySequence_Fast_GET_SIZE(shape); in init_ndbuf()
1188 if (ndim > ND_MAX_NDIM) { in init_ndbuf()
1204 else if (PySequence_Fast_GET_SIZE(strides) != ndim) { in init_ndbuf()
1222 if (ndim == 0) { in init_ndbuf()
1250 if (init_structure(ndbuf, shape, strides, ndim) < 0) in init_ndbuf()
1436 if (base->ndim != 0 && in ndarray_getbuf()
1510 view->ndim = 1; in ndarray_getbuf()
1563 assert(base->ndim == 1 && SIMPLE_FORMAT(base->format)); in ptr_from_index()
1594 if (base->ndim == 0) { in ndarray_item()
1603 if (base->ndim == 1) { in ndarray_item()
1624 subview->ndim--; in ndarray_item()
1746 shape = PyMem_Malloc(base->ndim * (sizeof *shape)); in copy_structure()
1747 strides = PyMem_Malloc(base->ndim * (sizeof *strides)); in copy_structure()
1753 suboffsets = PyMem_Malloc(base->ndim * (sizeof *suboffsets)); in copy_structure()
1758 for (i = 0; i < base->ndim; i++) { in copy_structure()
1786 if (base->ndim == 0) { in ndarray_subscript()
1882 if (dest->ndim == 0) { in ndarray_ass_subscript()
1893 if (dest->ndim == 1 && PyIndex_Check(key)) { in ndarray_ass_subscript()
2061 return PyLong_FromSsize_t(base->ndim); in ndarray_get_ndim()
2068 return ssize_array_as_tuple(base->shape, base->ndim); in ndarray_get_shape()
2075 return ssize_array_as_tuple(base->strides, base->ndim); in ndarray_get_strides()
2082 return ssize_array_as_tuple(base->suboffsets, base->ndim); in ndarray_get_suboffsets()
2169 assert(src->ndim > 0); in ndarray_tobytes()
2213 base->suboffsets = PyMem_Malloc(base->ndim * (sizeof *base->suboffsets)); in ndarray_add_suboffsets()
2219 for (i = 0; i < base->ndim; i++) in ndarray_add_suboffsets()
2281 if (view->ndim > ND_MAX_NDIM) { in ndarray_memoryview_from_buffer()
2287 memcpy(shape, view->shape, view->ndim * sizeof(Py_ssize_t)); in ndarray_memoryview_from_buffer()
2291 memcpy(strides, view->strides, view->ndim * sizeof(Py_ssize_t)); in ndarray_memoryview_from_buffer()
2295 memcpy(suboffsets, view->suboffsets, view->ndim * sizeof(Py_ssize_t)); in ndarray_memoryview_from_buffer()
2322 if (view.ndim > ND_MAX_NDIM) { in get_pointer()
2327 if (PySequence_Fast_GET_SIZE(seq) != view.ndim) { in get_pointer()
2333 for (i = 0; i < view.ndim; i++) { in get_pointer()
2483 Py_ssize_t ndim) in arraycmp() argument
2488 for (i = 0; i < ndim; i++) { in arraycmp()
2536 v1.ndim != v2.ndim || in cmp_contig()
2544 if ((v1.shape && !arraycmp(v1.shape, v2.shape, NULL, v1.ndim)) || in cmp_contig()
2545 (v1.strides && !arraycmp(v1.strides, v2.strides, v1.shape, v1.ndim)) || in cmp_contig()
2547 v1.ndim))) { in cmp_contig()