In 0.7, it seems that the transpose of a sparse matrix has not only been made lazy, but it is providing a view of a matrix rather than a new matrix. This is going to cause a lot of confusion, and I think the measures needed to correct it will make code much uglier.
In 0.7, if we create a sparse matrix A and then type
At = A', we no longer get a new matrix.
In fact, if we later change entries of
A, this results in changes in the entries of
At. This is rather counter-intuitive. Those of us who are used to working with sparse matrices often construct the transpose so that we can have quick access to the rows of the matrix (whereas the original provided quick access to the columns). We have lost that, too.
While there are situations in which this lazy behavior is useful, I strongly feel that it should not be the default. Those who want this should be able to type
At = lazy_transpose(A).
This lazy behavior also feels inconsistent with the rest of Julia’s behavior. When I type
A + I, Julia adds one to the diagonals of A. That is useful, and it makes it much easier to write fast code. Lazy evaluation makes it difficult for programmers to optimize code, because they can’t predict where the work is going to be done.
Steve Vavasis https://github.com/JuliaLang/julia/issues/28432 has pointed out other problems that this is causing.