Difference between copy() and .= for two vectors

Are you sure this is what you really meant? a .= b writes data into a pre-existing array, while copy must allocate a new one.

The more meaningful comparison would be a .= b and copyto!(a, b)

3 Likes