Julia 1.6 returns Matrix in case of zeros(m,n), ones(m,n)

Before it used to return an Array. I wonder what is the reason for this change ?

Do we have to do something in our existing codes to account for this change ?

The return type hasn’t changed, this was purely a printing change. Matrix{T} is just an alias for Array{T, 2}.

8 Likes

You can see what Simeon says for yourself:

julia> Matrix{Float64} == Array{Float64, 2}
true

the same holds for

julia> Vector{Float64} == Array{Float64, 1}
true
2 Likes

Actually, since version 1.6 Julia explicitly tells you that Matrix is just an alias:

julia> Matrix{Float64}
Matrix{Float64} (alias for Array{Float64, 2})
5 Likes