NUMPY_API * Trace */
| 1207 | * Trace |
| 1208 | */ |
| 1209 | NPY_NO_EXPORT PyObject * |
| 1210 | PyArray_Trace(PyArrayObject *self, int offset, int axis1, int axis2, |
| 1211 | int rtype, PyArrayObject *out) |
| 1212 | { |
| 1213 | PyObject *diag = NULL, *ret = NULL; |
| 1214 | |
| 1215 | diag = PyArray_Diagonal(self, offset, axis1, axis2); |
| 1216 | if (diag == NULL) { |
| 1217 | return NULL; |
| 1218 | } |
| 1219 | ret = PyArray_GenericReduceFunction((PyArrayObject *)diag, n_ops.add, -1, rtype, out); |
| 1220 | Py_DECREF(diag); |
| 1221 | return ret; |
| 1222 | } |
no test coverage detected