Yes, this is exactly what I was after, thanks! Cheers, Kaj
On Thursday, May 1, 2014 4:03:35 PM UTC+3, Kevin Squire wrote: > > b[:] = b .+ 5 > > has the behavior that you want. However, it creates a copy, does the > addition, then copies the result back into b. > > So, looping (aka devectorizing) would generally be faster. For simple > expressions like these, though, the Devectorize.jl package should allow you > to write > > @devec b[:] = b .+ 5 > > It then rewrites the expression as a loop. It isn't able to recognize some > expressions, though (especially complex ones), so YMMV. > > (Actually, it may not work with ".+", since that is a relatively new > change in the language. If you check and it doesn't, try submitting a > github issue, or just report back here.) > > Cheers! Kevin > >
