在1.0之前的版本,比如0.2-0.6,
data =Array{Float64,2}();
但现在1.0,这个会报错。
这个用法已经有重大的变化!
Array{T}(missing, dims)
Array{T,N}(missing, dims)
julia> a=Array{Float64}(undef, 2,3)
2×3 Array{Float64,2}:
4.3066e-316 4.30661e-316 4.30661e-316
4.3066e-316 4.30661e-316 0.0
julia> b=Array{Float64,2}(undef, 2,3)
2×3 Array{Float64,2}:
1.061e-313 3.60739e-313 4.24399e-314
2.122e-313 3.18299e-313 4.24399e-314
julia> a==b
false
julia> typeof(a)==typeof(b)
true
比如:
data = Array{Float64,2}(undef, 2, 3)
这个也算是重大的变化!
julia> data = Array{Float64,2}(undef, 2, 3)
2×3 Array{Float64,2}:
1.07077e-313 1.07065e-313 6.80287e-316
1.071e-313 6.94986e-316 0.0
julia> data = Array{Float64,2}()
ERROR: MethodError: no method matching Array{Float64,2}()
Closest candidates are:
Array{Float64,2}(::UndefInitializer, ::Int64, ::Int64) where T at boot.jl:404
Array{Float64,2}(::UndefInitializer, ::Int64...) where {T, N} at boot.jl:408
Array{Float64,2}(::UndefInitializer, ::Tuple{Int64,Int64}) where T at boot.jl:412
...
Stacktrace:
[1] top-level scope at none:0