@@ -1277,13 +1277,16 @@ function vcat(X1::_SparseConcatGroup, X::_SparseConcatGroup...)
12771277 end
12781278 return Base. typed_vcat (Base. promote_eltype (X1, X... ), X1, X... )
12791279end
1280- function hvcat (rows:: Tuple{Vararg{Int}} , X1:: _SparseConcatGroup , X:: _SparseConcatGroup... )
1280+ function hvcat_internal (rows:: Tuple{Vararg{Int}} , X1:: _SparseConcatGroup , X:: _SparseConcatGroup... )
12811281 if anysparse (X1) || anysparse (X... )
12821282 vcat (_hvcat_rows (rows, X1, X... )... )
12831283 else
12841284 Base. typed_hvcat (Base. promote_eltypeof (X1, X... ), rows, X1, X... )
12851285 end
12861286end
1287+ function hvcat (rows:: Tuple{Vararg{Int}} , X1:: _SparseConcatGroup , X:: _SparseConcatGroup... )
1288+ return hvcat_internal (rows, X1, X... )
1289+ end
12871290function _hvcat_rows ((row1, rows... ):: Tuple{Vararg{Int}} , X:: _SparseConcatGroup... )
12881291 if row1 ≤ 0
12891292 throw (ArgumentError (" length of block row must be positive, got $row1 " ))
@@ -1304,9 +1307,8 @@ hcat(n1::Number, ns::Vararg{Number}) = invoke(hcat, Tuple{Vararg{Number}}, n1, n
13041307vcat (n1:: Number , ns:: Vararg{Number} ) = invoke (vcat, Tuple{Vararg{Number}}, n1, ns... )
13051308hcat (n1:: N , ns:: Vararg{N} ) where {N<: Number } = invoke (hcat, Tuple{Vararg{N}}, n1, ns... )
13061309vcat (n1:: N , ns:: Vararg{N} ) where {N<: Number } = invoke (vcat, Tuple{Vararg{N}}, n1, ns... )
1307- hvcat (rows:: Tuple{Vararg{Int}} , n1:: Number , ns:: Vararg{Number} ) = invoke (hvcat, Tuple{typeof (rows), Vararg{Number}}, rows, n1, ns... )
1308- hvcat (rows:: Tuple{Vararg{Int}} , n1:: N , ns:: Vararg{N} ) where {N<: Number } = invoke (hvcat, Tuple{typeof (rows), Vararg{N}}, rows, n1, ns... )
1309-
1310+ hvcat (rows:: Tuple{Vararg{Int}} , n1:: Number , ns:: Vararg{Number} ) = hvcat_internal (rows, n1, ns... )
1311+ hvcat (rows:: Tuple{Vararg{Int}} , n1:: N , ns:: Vararg{N} ) where {N<: Number } = hvcat_internal (rows, n1, ns... )
13101312
13111313# make sure UniformScaling objects are converted to sparse matrices for concatenation
13121314promote_to_array_type (A:: Tuple{Vararg{Union{_SparseConcatGroup,UniformScaling}}} ) = anysparse (A... ) ? SparseMatrixCSC : Matrix
0 commit comments