def ndarray_sum(size, v): a = Array(size, 'double') a.fill(v) return a.sum()
def ndarray_sum_initial(size, v, initial): a = Array(size, 'double') a.fill(v) return a.sum(initial=initial)