function module.Accumulate(z)local j=0 for I,Z in pairs(z)do j=j+z[I]z[I]=j end return z end
--[[ @brief Produces a cumulative sum along a table.
     @details The passed-in table will be mutated.
     @example Accumulate({1, 2, 3}) = {1, 3, 6}.
     @param t The table to accumulate.
--]]
function module.Accumulate(t)
	local s = 0
	for i, v in pairs(t) do
		s = s + t[i]
		t[i] = s
	end
	return t
end
