* op.outer(a,b) is equivalent to op(a[:,NewAxis,NewAxis,etc.],b) * where a has b.ndim NewAxis terms appended. * * The result has dimensions a.ndim + b.ndim */
| 5763 | * The result has dimensions a.ndim + b.ndim |
| 5764 | */ |
| 5765 | static PyObject * |
| 5766 | ufunc_outer(PyUFuncObject *ufunc, |
| 5767 | PyObject *const *args, Py_ssize_t len_args, PyObject *kwnames) |
| 5768 | { |
| 5769 | if (ufunc->core_enabled) { |
| 5770 | PyErr_Format(PyExc_TypeError, |
| 5771 | "method outer is not allowed in ufunc with non-trivial"\ |
| 5772 | " signature"); |
| 5773 | return NULL; |
| 5774 | } |
| 5775 | |
| 5776 | if (ufunc->nin != 2) { |
| 5777 | PyErr_SetString(PyExc_ValueError, |
| 5778 | "outer product only supported "\ |
| 5779 | "for binary functions"); |
| 5780 | return NULL; |
| 5781 | } |
| 5782 | |
| 5783 | if (len_args != 2) { |
| 5784 | PyErr_SetString(PyExc_TypeError, "exactly two arguments expected"); |
| 5785 | return NULL; |
| 5786 | } |
| 5787 | |
| 5788 | return ufunc_generic_fastcall(ufunc, args, len_args, kwnames, NPY_TRUE); |
| 5789 | } |
| 5790 | |
| 5791 | |
| 5792 | static PyObject * |
nothing calls this directly
no test coverage detected