| 2470 | |
| 2471 | |
| 2472 | static PyObject * |
| 2473 | array_dot(PyArrayObject *self, |
| 2474 | PyObject *const *args, Py_ssize_t len_args, PyObject *kwnames) |
| 2475 | { |
| 2476 | PyObject *a = (PyObject *)self, *b, *o = NULL; |
| 2477 | PyArrayObject *ret; |
| 2478 | NPY_PREPARE_ARGPARSER; |
| 2479 | |
| 2480 | if (npy_parse_arguments("dot", args, len_args, kwnames, |
| 2481 | "b", NULL, &b, |
| 2482 | "|out", NULL, &o, |
| 2483 | NULL, NULL, NULL) < 0) { |
| 2484 | return NULL; |
| 2485 | } |
| 2486 | |
| 2487 | if (o != NULL) { |
| 2488 | if (o == Py_None) { |
| 2489 | o = NULL; |
| 2490 | } |
| 2491 | else if (!PyArray_Check(o)) { |
| 2492 | PyErr_SetString(PyExc_TypeError, |
| 2493 | "'out' must be an array"); |
| 2494 | return NULL; |
| 2495 | } |
| 2496 | } |
| 2497 | ret = (PyArrayObject *)PyArray_MatrixProduct2(a, b, (PyArrayObject *)o); |
| 2498 | return PyArray_Return(ret); |
| 2499 | } |
| 2500 | |
| 2501 | |
| 2502 | static PyObject * |
nothing calls this directly
no test coverage detected