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

Function array_imag_get

numpy/core/src/multiarray/getset.c:790–814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788*/
789
790static PyObject *
791array_imag_get(PyArrayObject *self, void *NPY_UNUSED(ignored))
792{
793 PyArrayObject *ret;
794
795 if (PyArray_ISCOMPLEX(self)) {
796 ret = _get_part(self, 1);
797 }
798 else {
799 Py_INCREF(PyArray_DESCR(self));
800 ret = (PyArrayObject *)PyArray_NewFromDescr_int(
801 Py_TYPE(self),
802 PyArray_DESCR(self),
803 PyArray_NDIM(self),
804 PyArray_DIMS(self),
805 NULL, NULL,
806 PyArray_ISFORTRAN(self),
807 (PyObject *)self, NULL, _NPY_ARRAY_ZEROED);
808 if (ret == NULL) {
809 return NULL;
810 }
811 PyArray_CLEARFLAGS(ret, NPY_ARRAY_WRITEABLE);
812 }
813 return (PyObject *) ret;
814}
815
816static int
817array_imag_set(PyArrayObject *self, PyObject *val, void *NPY_UNUSED(ignored))

Callers

nothing calls this directly

Calls 6

_get_partFunction · 0.85
PyArray_DESCRFunction · 0.85
PyArray_NewFromDescr_intFunction · 0.85
PyArray_NDIMFunction · 0.85
PyArray_DIMSFunction · 0.85
PyArray_CLEARFLAGSFunction · 0.85

Tested by

no test coverage detected