0

At the risk of this question being off topic, does anybody know if there's a technical term for the process of summing adjacent elements of an array (or matrix). Like this:

[1,2,3,4,5,6,7,8]

[3,7,11,15]

[10,26]

[36]

In other words, if was going to make a function that did this, what would it be called?

Here's an example with a matrix:

[[1,2,3,4],
 [5,6,7,8],
 [9,10,11,12],
 [13,14,15,16]]

[[14, 22],
 [46, 54]]

[[136]]

Is there a specific term for each iteration of this process?

juniper-
  • 6,262
  • 10
  • 37
  • 65
  • I couldn't find anything directly related when googling "divide and conquer", "block matrix", "k-d tree". – Eric Duminil Mar 10 '17 at 19:57
  • The best thing which comes to my mind would be something like block-based [reduction/fold](https://en.wikipedia.org/wiki/Fold_(higher-order_function)). – sascha Mar 11 '17 at 00:17

0 Answers0