Prefix sum/summed area table computations for ndarrays