| 815 | } |
| 816 | |
| 817 | static PyObject * |
| 818 | _slow_array_clip(PyArrayObject *self, PyObject *min, PyObject *max, PyArrayObject *out) |
| 819 | { |
| 820 | PyObject *res1=NULL, *res2=NULL; |
| 821 | |
| 822 | if (max != NULL) { |
| 823 | res1 = _GenericBinaryOutFunction(self, max, out, n_ops.minimum); |
| 824 | if (res1 == NULL) { |
| 825 | return NULL; |
| 826 | } |
| 827 | } |
| 828 | else { |
| 829 | res1 = (PyObject *)self; |
| 830 | Py_INCREF(res1); |
| 831 | } |
| 832 | |
| 833 | if (min != NULL) { |
| 834 | res2 = _GenericBinaryOutFunction((PyArrayObject *)res1, |
| 835 | min, out, n_ops.maximum); |
| 836 | if (res2 == NULL) { |
| 837 | Py_XDECREF(res1); |
| 838 | return NULL; |
| 839 | } |
| 840 | } |
| 841 | else { |
| 842 | res2 = res1; |
| 843 | Py_INCREF(res2); |
| 844 | } |
| 845 | Py_DECREF(res1); |
| 846 | return res2; |
| 847 | } |
| 848 | |
| 849 | /*NUMPY_API |
| 850 | * Clip |
no test coverage detected