You should copy the vector if you need, well, a copy. There’s no automatic copy on assigment and all assignments has the semantic of binding to the reference of an object instead of copying.
y2 = copy(y), otherwise you set them to reference the same memory.
Thank you guys, that is very helpful
