diff --git a/base/abstractarray.jl b/base/abstractarray.jl index cb3956eb7c6d4..6ff1f34a4259e 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -1988,16 +1988,14 @@ julia> cat(1, [2], [3;;]; dims=Val(2)) # The specializations for 1 and 2 inputs are important # especially when running with --inline=no, see #11158 -# The specializations for Union{AbstractVecOrMat,Number} are necessary -# to have more specialized methods here than in LinearAlgebra/uniformscaling.jl vcat(A::AbstractArray) = cat(A; dims=Val(1)) vcat(A::AbstractArray, B::AbstractArray) = cat(A, B; dims=Val(1)) vcat(A::AbstractArray...) = cat(A...; dims=Val(1)) -vcat(A::Union{AbstractVecOrMat,Number}...) = cat(A...; dims=Val(1)) +vcat(A::Union{AbstractArray,Number}...) = cat(A...; dims=Val(1)) hcat(A::AbstractArray) = cat(A; dims=Val(2)) hcat(A::AbstractArray, B::AbstractArray) = cat(A, B; dims=Val(2)) hcat(A::AbstractArray...) = cat(A...; dims=Val(2)) -hcat(A::Union{AbstractVecOrMat,Number}...) = cat(A...; dims=Val(2)) +hcat(A::Union{AbstractArray,Number}...) = cat(A...; dims=Val(2)) typed_vcat(T::Type, A::AbstractArray) = _cat_t(Val(1), T, A) typed_vcat(T::Type, A::AbstractArray, B::AbstractArray) = _cat_t(Val(1), T, A, B) @@ -2147,8 +2145,6 @@ end hvcat(rows::Tuple{Vararg{Int}}, xs::Number...) = typed_hvcat(promote_typeof(xs...), rows, xs...) hvcat(rows::Tuple{Vararg{Int}}, xs...) = typed_hvcat(promote_eltypeof(xs...), rows, xs...) -# the following method is needed to provide a more specific one compared to LinearAlgebra/uniformscaling.jl -hvcat(rows::Tuple{Vararg{Int}}, xs::Union{AbstractVecOrMat,Number}...) = typed_hvcat(promote_eltypeof(xs...), rows, xs...) function typed_hvcat(::Type{T}, rows::Tuple{Vararg{Int}}, xs::Number...) where T nr = length(rows) diff --git a/base/array.jl b/base/array.jl index 0a5451bac5b74..c300fa2d2f322 100644 --- a/base/array.jl +++ b/base/array.jl @@ -2004,18 +2004,6 @@ function vcat(arrays::Vector{T}...) where T end vcat(A::Vector...) = cat(A...; dims=Val(1)) # more special than SparseArrays's vcat -# disambiguation with LinAlg/special.jl -# Union{Number,Vector,Matrix} is for LinearAlgebra._DenseConcatGroup -# VecOrMat{T} is for LinearAlgebra._TypedDenseConcatGroup -hcat(A::Union{Number,Vector,Matrix}...) = cat(A...; dims=Val(2)) -hcat(A::VecOrMat{T}...) where {T} = typed_hcat(T, A...) -vcat(A::Union{Number,Vector,Matrix}...) = cat(A...; dims=Val(1)) -vcat(A::VecOrMat{T}...) where {T} = typed_vcat(T, A...) -hvcat(rows::Tuple{Vararg{Int}}, xs::Union{Number,Vector,Matrix}...) = - typed_hvcat(promote_eltypeof(xs...), rows, xs...) -hvcat(rows::Tuple{Vararg{Int}}, xs::VecOrMat{T}...) where {T} = - typed_hvcat(T, rows, xs...) - _cat(n::Integer, x::Integer...) = reshape([x...], (ntuple(Returns(1), n-1)..., length(x))) ## find ## diff --git a/deps/checksums/SparseArrays-5fc57713156beea140a0ae7d1ceacbc7d3320c07.tar.gz/md5 b/deps/checksums/SparseArrays-5fc57713156beea140a0ae7d1ceacbc7d3320c07.tar.gz/md5 new file mode 100644 index 0000000000000..e4b8dc5b03b39 --- /dev/null +++ b/deps/checksums/SparseArrays-5fc57713156beea140a0ae7d1ceacbc7d3320c07.tar.gz/md5 @@ -0,0 +1 @@ +ca410e793142e58ea63585f9232c0599 diff --git a/deps/checksums/SparseArrays-5fc57713156beea140a0ae7d1ceacbc7d3320c07.tar.gz/sha512 b/deps/checksums/SparseArrays-5fc57713156beea140a0ae7d1ceacbc7d3320c07.tar.gz/sha512 new file mode 100644 index 0000000000000..a8e8cc0dc0c4c --- /dev/null +++ b/deps/checksums/SparseArrays-5fc57713156beea140a0ae7d1ceacbc7d3320c07.tar.gz/sha512 @@ -0,0 +1 @@ +ee31761b3059d3ee9a7e26439dede142a64883cbca50d139c5f69d1a6f6d633b364c8992e865957c91d4f95b96d24894fefb12e89a50f56fb7c7e164292791ea diff --git a/deps/checksums/SparseArrays-8affe9e499379616e33fc60a24bb31500e8423d7.tar.gz/md5 b/deps/checksums/SparseArrays-8affe9e499379616e33fc60a24bb31500e8423d7.tar.gz/md5 deleted file mode 100644 index 96861ba265b5f..0000000000000 --- a/deps/checksums/SparseArrays-8affe9e499379616e33fc60a24bb31500e8423d7.tar.gz/md5 +++ /dev/null @@ -1 +0,0 @@ -e6dc511b49e07a167848adc4e12690d8 diff --git a/deps/checksums/SparseArrays-8affe9e499379616e33fc60a24bb31500e8423d7.tar.gz/sha512 b/deps/checksums/SparseArrays-8affe9e499379616e33fc60a24bb31500e8423d7.tar.gz/sha512 deleted file mode 100644 index f503304f810e4..0000000000000 --- a/deps/checksums/SparseArrays-8affe9e499379616e33fc60a24bb31500e8423d7.tar.gz/sha512 +++ /dev/null @@ -1 +0,0 @@ -f40fd137ccd6651fc8b697f57cfcbd8e3feccb99f6a6b32fbaa69cc0160b78cefc662b914ff8f4e48478ca48f9583318a6030d922d43ed66f8db59fd5985f768 diff --git a/src/staticdata_utils.c b/src/staticdata_utils.c index e01ba40c63aed..dea2af309f7ec 100644 --- a/src/staticdata_utils.c +++ b/src/staticdata_utils.c @@ -847,6 +847,9 @@ static jl_array_t *jl_verify_edges(jl_array_t *targets, size_t minworld) jl_value_t *expected = jl_array_ptr_ref(targets, i * 3 + 2); size_t min_valid = 0; size_t max_valid = ~(size_t)0; + uint64_t t0 = uv_hrtime() - jl_gc_total_hrtime(); + uint64_t b0; jl_gc_get_total_bytes(&b0); + //if(1);else if (invokesig) { assert(callee && "unsupported edge"); jl_methtable_t *mt = jl_method_get_table(((jl_method_instance_t*)callee)->def.method); @@ -917,9 +920,16 @@ static jl_array_t *jl_verify_edges(jl_array_t *targets, size_t minworld) jl_array_ptr_1d_push(_jl_debug_method_invalidation, loctag); jl_array_ptr_1d_push(_jl_debug_method_invalidation, matches); } + //uint64_t t1 = uv_hrtime() - jl_gc_total_hrtime(); + //uint64_t b1; jl_gc_get_total_bytes(&b1); + //ios_printf(ios_stdout, "\n%u\t%u\t%d\t", ((unsigned)(t1 - t0))/1000u, ((unsigned)(b1 - b0))/1024u, max_valid == ~(size_t)0); + //jl_static_show((JL_STREAM*)ios_stdout, (jl_value_t*)invokesig); + //ios_printf(ios_stdout, "\t"); + //jl_static_show((JL_STREAM*)ios_stdout, (jl_value_t*)callee); + //// //jl_static_show((JL_STREAM*)ios_stderr, (jl_value_t*)invokesig); //jl_static_show((JL_STREAM*)ios_stderr, (jl_value_t*)callee); - //ios_puts(valid ? "valid\n" : "INVALID\n", ios_stderr); + //ios_puts(max_valid == ~(size_t)0 ? "valid\n" : "INVALID\n", ios_stderr); } JL_GC_POP(); return maxvalids; @@ -1066,6 +1076,7 @@ static void jl_insert_backedges(jl_array_t *edges, jl_array_t *ext_targets, jl_a // determine which CodeInstance objects are still valid in our image jl_array_t *valids = jl_verify_edges(ext_targets, minworld); JL_GC_PUSH1(&valids); + valids = jl_verify_methods(edges, valids); // consumes edges valids, initializes methods valids jl_verify_graph(edges, valids); // propagates methods valids for each edge size_t i, l; diff --git a/stdlib/LinearAlgebra/src/special.jl b/stdlib/LinearAlgebra/src/special.jl index 06227c782002a..af78315cdcca5 100644 --- a/stdlib/LinearAlgebra/src/special.jl +++ b/stdlib/LinearAlgebra/src/special.jl @@ -323,26 +323,12 @@ end ==(B::SymTridiagonal, A::Bidiagonal) = A == B # concatenation -const _SpecialArrays = Union{Diagonal, Bidiagonal, Tridiagonal, SymTridiagonal} -const _Symmetric_DenseArrays{T,A<:Matrix} = Symmetric{T,A} -const _Hermitian_DenseArrays{T,A<:Matrix} = Hermitian{T,A} -const _Triangular_DenseArrays{T,A<:Matrix} = AbstractTriangular{T,A} -const _Annotated_DenseArrays = Union{_SpecialArrays, _Triangular_DenseArrays, _Symmetric_DenseArrays, _Hermitian_DenseArrays} -const _Annotated_Typed_DenseArrays{T} = Union{_Triangular_DenseArrays{T}, _Symmetric_DenseArrays{T}, _Hermitian_DenseArrays{T}} -const _DenseConcatGroup = Union{Number, Vector, Adjoint{<:Any,<:Vector}, Transpose{<:Any,<:Vector}, Matrix, _Annotated_DenseArrays} -const _TypedDenseConcatGroup{T} = Union{Vector{T}, Adjoint{T,Vector{T}}, Transpose{T,Vector{T}}, Matrix{T}, _Annotated_Typed_DenseArrays{T}} - -promote_to_array_type(::Tuple{Vararg{Union{_DenseConcatGroup,UniformScaling}}}) = Matrix - -Base._cat(dims, xs::_DenseConcatGroup...) = Base._cat_t(dims, promote_eltype(xs...), xs...) -vcat(A::_DenseConcatGroup...) = Base.typed_vcat(promote_eltype(A...), A...) -hcat(A::_DenseConcatGroup...) = Base.typed_hcat(promote_eltype(A...), A...) -hvcat(rows::Tuple{Vararg{Int}}, xs::_DenseConcatGroup...) = Base.typed_hvcat(promote_eltype(xs...), rows, xs...) -# For performance, specially handle the case where the matrices/vectors have homogeneous eltype -Base._cat(dims, xs::_TypedDenseConcatGroup{T}...) where {T} = Base._cat_t(dims, T, xs...) -vcat(A::_TypedDenseConcatGroup{T}...) where {T} = Base.typed_vcat(T, A...) -hcat(A::_TypedDenseConcatGroup{T}...) where {T} = Base.typed_hcat(T, A...) -hvcat(rows::Tuple{Vararg{Int}}, xs::_TypedDenseConcatGroup{T}...) where {T} = Base.typed_hvcat(T, rows, xs...) + +# TODO: remove these deprecations (used by SparseArrays in the past) +const _DenseConcatGroup = Union{} +const _SpecialArrays = Union{} + +promote_to_array_type(::Tuple) = Matrix # factorizations function cholesky(S::RealHermSymComplexHerm{<:Real,<:SymTridiagonal}, ::NoPivot = NoPivot(); check::Bool = true) diff --git a/stdlib/LinearAlgebra/src/uniformscaling.jl b/stdlib/LinearAlgebra/src/uniformscaling.jl index 21ae8a1bb913a..e6167688c686c 100644 --- a/stdlib/LinearAlgebra/src/uniformscaling.jl +++ b/stdlib/LinearAlgebra/src/uniformscaling.jl @@ -417,17 +417,16 @@ promote_to_arrays(n,k, ::Type{T}, A, B, C) where {T} = (promote_to_arrays_(n[k], T, A), promote_to_arrays_(n[k+1], T, B), promote_to_arrays_(n[k+2], T, C)) promote_to_arrays(n,k, ::Type{T}, A, B, Cs...) where {T} = (promote_to_arrays_(n[k], T, A), promote_to_arrays_(n[k+1], T, B), promote_to_arrays(n,k+2, T, Cs...)...) -promote_to_array_type(A::Tuple{Vararg{Union{AbstractVecOrMat,UniformScaling,Number}}}) = Matrix _us2number(A) = A _us2number(J::UniformScaling) = J.λ for (f, _f, dim, name) in ((:hcat, :_hcat, 1, "rows"), (:vcat, :_vcat, 2, "cols")) @eval begin - @inline $f(A::Union{AbstractVecOrMat,UniformScaling}...) = $_f(A...) + @inline $f(A::Union{AbstractArray,UniformScaling}...) = $_f(A...) # if there's a Number present, J::UniformScaling must be 1x1-dimensional - @inline $f(A::Union{AbstractVecOrMat,UniformScaling,Number}...) = $f(map(_us2number, A)...) - function $_f(A::Union{AbstractVecOrMat,UniformScaling,Number}...; array_type = promote_to_array_type(A)) + @inline $f(A::Union{AbstractArray,UniformScaling,Number}...) = $f(map(_us2number, A)...) + function $_f(A::Union{AbstractArray,UniformScaling,Number}...; array_type = promote_to_array_type(A)) n = -1 for a in A if !isa(a, UniformScaling) @@ -445,9 +444,9 @@ for (f, _f, dim, name) in ((:hcat, :_hcat, 1, "rows"), (:vcat, :_vcat, 2, "cols" end end -hvcat(rows::Tuple{Vararg{Int}}, A::Union{AbstractVecOrMat,UniformScaling}...) = _hvcat(rows, A...) -hvcat(rows::Tuple{Vararg{Int}}, A::Union{AbstractVecOrMat,UniformScaling,Number}...) = _hvcat(rows, A...) -function _hvcat(rows::Tuple{Vararg{Int}}, A::Union{AbstractVecOrMat,UniformScaling,Number}...; array_type = promote_to_array_type(A)) +hvcat(rows::Tuple{Vararg{Int}}, A::Union{AbstractArray,UniformScaling}...) = _hvcat(rows, A...) +hvcat(rows::Tuple{Vararg{Int}}, A::Union{AbstractArray,UniformScaling,Number}...) = _hvcat(rows, A...) +function _hvcat(rows::Tuple{Vararg{Int}}, A::Union{AbstractArray,UniformScaling,Number}...; array_type = promote_to_array_type(A)) require_one_based_indexing(A...) nr = length(rows) sum(rows) == length(A) || throw(ArgumentError("mismatch between row sizes and number of arguments")) diff --git a/stdlib/SparseArrays.version b/stdlib/SparseArrays.version index d4a548daef5d7..06640bd0e3171 100644 --- a/stdlib/SparseArrays.version +++ b/stdlib/SparseArrays.version @@ -1,4 +1,4 @@ SPARSEARRAYS_BRANCH = main -SPARSEARRAYS_SHA1 = 8affe9e499379616e33fc60a24bb31500e8423d7 +SPARSEARRAYS_SHA1 = 5fc57713156beea140a0ae7d1ceacbc7d3320c07 SPARSEARRAYS_GIT_URL := https://github.com/JuliaSparse/SparseArrays.jl.git SPARSEARRAYS_TAR_URL = https://api.github.com/repos/JuliaSparse/SparseArrays.jl/tarball/$1