Multiplication broken upon upgrade to Julia 0.5.0

Yes, this is https://github.com/JuliaLang/julia/pull/13612 (which is listed under “breaking changes” in the 0.5 NEWS).

In 0.5, you need to add an explicit transpose to get a row vector for the second term:

A[k+1:n,k+1:n] -= A[k+1:n,k] * A[k,k+1:n].'

In 0.6, you can do:

view(A,k+1:n,k+1:n) .-= view(A,k+1:n,k) .* view(A,k,k+1:n).'

and the whole operation occurs in-place, with a single fused loop, without allocating temporary matrices for the right-hand-side operations.

4 Likes