Compute the prefix scan (e.g., cumsum) on the first block Parameters ---------- func : callable Cumulative function (e.g. ``np.cumsum``) x : np.array Current block axis : int dtype : dtype Returns ------- np.array
(func, x, axis, dtype)
| 1016 | |
| 1017 | |
| 1018 | def _prefixscan_first(func, x, axis, dtype): |
| 1019 | """Compute the prefix scan (e.g., cumsum) on the first block |
| 1020 | |
| 1021 | Parameters |
| 1022 | ---------- |
| 1023 | func : callable |
| 1024 | Cumulative function (e.g. ``np.cumsum``) |
| 1025 | x : np.array |
| 1026 | Current block |
| 1027 | axis : int |
| 1028 | dtype : dtype |
| 1029 | |
| 1030 | Returns |
| 1031 | ------- |
| 1032 | np.array |
| 1033 | """ |
| 1034 | return func(x, axis=axis, dtype=dtype) |
| 1035 | |
| 1036 | |
| 1037 | def prefixscan_blelloch(func, preop, binop, x, axis=None, dtype=None, out=None): |