Hello. I have a script that contains the following line:
A[k+1:n,k+1:n] -= A[k+1:n,k] * A[k,k+1:n]
where k and n are integers and the values in the two-dimensional array are floats. Previously, in Julia 0.4.6, this was no problem and I achieved the results I desired with no errors. However, in 0.5.0, I get an error
ERROR: MethodError: no method matching *(::Array{Float64,1}, ::Array{Float64,1})
along with a lot of text referencing closest candidates. Has something fundamentally changed in Julia 0.5.0 that no longer allows this? How may this be rectified?
Please let me know if my entire script is needed to understand the issue more fully.
Yes, because it is the left-hand side of .-=. If you do A[...] .-= X, this is equivalent to A[...] .= A[...] .- X, in which case the slice A[...] on the right-hand side makes a copy.
Yes, because it is the left-hand side of .-=. If you do A[…] .-= X, this is equivalent to A[…] .= A[…] .- X, in which case the slice A[…] on the right-hand side makes a copy.
Isn’t this kind of unfortunate? It seems unnatural to have to add view here.
Yeah, I understand it after it’s explained, but it feels like a violation of the rule “indexing on the left is a view” which I thought was always true. I think this is a good reason to start pushing for “always a view again”, especially after views keep getting cheaper and cheaper.