MCPcopy Create free account
hub / github.com/numpy/numpy / index_has_memory_overlap

Function index_has_memory_overlap

numpy/core/src/multiarray/mapping.c:746–771  ·  view source on GitHub ↗

* Check if self has memory overlap with one of the index arrays, or with extra_op. * * @returns 1 if memory overlap found, 0 if not. */

Source from the content-addressed store, hash-verified

744 * @returns 1 if memory overlap found, 0 if not.
745 */
746NPY_NO_EXPORT int
747index_has_memory_overlap(PyArrayObject *self,
748 int index_type, npy_index_info *indices, int num,
749 PyObject *extra_op)
750{
751 int i;
752
753 if (index_type & (HAS_FANCY | HAS_BOOL)) {
754 for (i = 0; i < num; ++i) {
755 if (indices[i].object != NULL &&
756 PyArray_Check(indices[i].object) &&
757 solve_may_share_memory(self,
758 (PyArrayObject *)indices[i].object,
759 1) != 0) {
760 return 1;
761 }
762 }
763 }
764
765 if (extra_op != NULL && PyArray_Check(extra_op) &&
766 solve_may_share_memory(self, (PyArrayObject *)extra_op, 1) != 0) {
767 return 1;
768 }
769
770 return 0;
771}
772
773
774/**

Callers 1

Calls 1

solve_may_share_memoryFunction · 0.85

Tested by

no test coverage detected