NUMPY_API * Whether the iteration could be done with no buffering. */
| 830 | * Whether the iteration could be done with no buffering. |
| 831 | */ |
| 832 | NPY_NO_EXPORT npy_bool |
| 833 | NpyIter_RequiresBuffering(NpyIter *iter) |
| 834 | { |
| 835 | npy_uint32 itflags = NIT_ITFLAGS(iter); |
| 836 | /*int ndim = NIT_NDIM(iter);*/ |
| 837 | int iop, nop = NIT_NOP(iter); |
| 838 | |
| 839 | npyiter_opitflags *op_itflags; |
| 840 | |
| 841 | if (!(itflags&NPY_ITFLAG_BUFFER)) { |
| 842 | return 0; |
| 843 | } |
| 844 | |
| 845 | op_itflags = NIT_OPITFLAGS(iter); |
| 846 | |
| 847 | /* If any operand requires a cast, buffering is mandatory */ |
| 848 | for (iop = 0; iop < nop; ++iop) { |
| 849 | if (op_itflags[iop]&NPY_OP_ITFLAG_CAST) { |
| 850 | return 1; |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | return 0; |
| 855 | } |
| 856 | |
| 857 | /*NUMPY_API |
| 858 | * Whether the iteration loop, and in particular the iternext() |
nothing calls this directly
no outgoing calls
no test coverage detected