You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Julia v0.7 you don't need to specify the eltype of the matrix - it is inferred from the UniformScaling{T} input. Compat has only defined the Matrix{T}(::UniformScaling, n, m) method.
# Julia v0.6.2
julia> using Compat
julia> Matrix(I, 4, 4)
ERROR: MethodError: no method matching Array{T,2} where T(::UniformScaling{Int64}, ::Int64, ::Int64)
Closest candidates are:
Array{T,2} where T(::Compat.Uninitialized, ::Any...) at string:5
Array{T,2} where T(::Integer, ::Integer) at sysimg.jl:105
julia> Matrix{Float64}(I, 4, 4)
4×4 Array{Float64,2}:
1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0
The text was updated successfully, but these errors were encountered:
Well we can't do much in Compat about a breaking change to the element type of I (we could define Compat.I I suppose).
The usage I was intending were things like Matrix(4.0*I, 4, 4). I changed these to Matrix{Float64}(4*I, 4, 4) which works on v0.6 (with Compat) and v0.7.
In Julia v0.7 you don't need to specify the eltype of the matrix - it is inferred from the
UniformScaling{T}
input. Compat has only defined theMatrix{T}(::UniformScaling, n, m)
method.The text was updated successfully, but these errors were encountered: