Efficient way to sum an array of integers in Julia
<p>I have an 2D array which I want to modify so as to sum a given element in a row with all the elements before it, so for example, if I have an array:</p>

<pre><code>[1 2; 3 6; 4 7; 4 8]
</code></pre>

<p>I want to be able to transform it to</p>

<pre><code>[1 2; 4 8; 8 15; 12 23]
</code></pre>

<p>I can do so using the following snippet in julia:</p>

<pre><code>for i in 1:10,
   for k in 2:size(d,1),
          d([k,i] += d[k-1,i)];
   end
end
</code></pre>

<p>But I assume there must be a more efficient way to do this?</p>