madsjulia / Mads.jl

MADS: Model Analysis & Decision Support
http://mads.gitlab.io
GNU General Public License v3.0
101 stars 20 forks source link

Changed meaning of .+= in Julia 0.5 #3

Closed stevengj closed 7 years ago

stevengj commented 8 years ago

Your code uses x .+= y, so you should know that in Julia 0.5 this has changed meaning to be equivalent to broadcast!(identity, x, x .+ y), so that it mutates the x array (see JuliaLang/julia#17510 … in Julia 0.6 the whole operation will occur in-place without temporaries). So .+ should only be used if the left-hand side is a mutable array, and you don't mind mutating it.

At first glance, this looks like it is okay for you, because you use it in residuals .+= (rmax .+ rmin), where residuals seems like an array that you won't mind mutating. But if it were a problem you could always change it to +=.

montyvesselinov commented 7 years ago

Thank you very much! I think we are in a good shape.