The following modify method somehow modifies the whole @x array instead of just simply generating another element to be pushed later. How come?
def modify i, s
t = @x[-1]
t[i] = t[i] + s
t
end
@x = [ [10, 12] ]
@x << modify(0, 1)
puts @x
Edited The following code have done the trick. Still I wonder if its possible to get rid of the p-argument
def modify p, i, s
a = p.to_a
a[i] += s*@delta[i]
Vector.elements( a )
end