| 892 | } |
| 893 | |
| 894 | static int |
| 895 | npyiter_calculate_ndim(int nop, PyArrayObject **op_in, |
| 896 | int oa_ndim) |
| 897 | { |
| 898 | /* If 'op_axes' is being used, force 'ndim' */ |
| 899 | if (oa_ndim >= 0 ) { |
| 900 | return oa_ndim; |
| 901 | } |
| 902 | /* Otherwise it's the maximum 'ndim' from the operands */ |
| 903 | else { |
| 904 | int ndim = 0, iop; |
| 905 | |
| 906 | for (iop = 0; iop < nop; ++iop) { |
| 907 | if (op_in[iop] != NULL) { |
| 908 | int ondim = PyArray_NDIM(op_in[iop]); |
| 909 | if (ondim > ndim) { |
| 910 | ndim = ondim; |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | } |
| 915 | |
| 916 | return ndim; |
| 917 | } |
| 918 | } |
| 919 | |
| 920 | /* |
| 921 | * Checks the per-operand input flags, and fills in op_itflags. |
no test coverage detected