NUMPY_API * Conjugate */
| 1164 | * Conjugate |
| 1165 | */ |
| 1166 | NPY_NO_EXPORT PyObject * |
| 1167 | PyArray_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 |
no test coverage detected