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

Function PyArray_Conjugate

numpy/core/src/multiarray/calculation.c:1166–1204  ·  view source on GitHub ↗

NUMPY_API * Conjugate */

Source from the content-addressed store, hash-verified

1164 * Conjugate
1165 */
1166NPY_NO_EXPORT PyObject *
1167PyArray_Conjugate(PyArrayObject *self, PyArrayObject *out)
1168{
1169 if (PyArray_ISCOMPLEX(self) || PyArray_ISOBJECT(self) ||
1170 PyArray_ISUSERDEF(self)) {
1171 if (out == NULL) {
1172 return PyArray_GenericUnaryFunction(self,
1173 n_ops.conjugate);
1174 }
1175 else {
1176 return PyArray_GenericBinaryFunction((PyObject *)self,
1177 (PyObject *)out,
1178 n_ops.conjugate);
1179 }
1180 }
1181 else {
1182 PyArrayObject *ret;
1183 if (!PyArray_ISNUMBER(self)) {
1184 /* 2017-05-04, 1.13 */
1185 if (DEPRECATE("attempting to conjugate non-numeric dtype; this "
1186 "will error in the future to match the behavior of "
1187 "np.conjugate") < 0) {
1188 return NULL;
1189 }
1190 }
1191 if (out) {
1192 if (PyArray_AssignArray(out, self,
1193 NULL, NPY_DEFAULT_ASSIGN_CASTING) < 0) {
1194 return NULL;
1195 }
1196 ret = out;
1197 }
1198 else {
1199 ret = self;
1200 }
1201 Py_INCREF(ret);
1202 return (PyObject *)ret;
1203 }
1204}
1205
1206/*NUMPY_API
1207 * Trace

Callers 3

array_conjugateFunction · 0.85
PyArray_Correlate2Function · 0.85
__New_PyArray_StdFunction · 0.85

Calls 3

PyArray_AssignArrayFunction · 0.85

Tested by

no test coverage detected