@@ -1239,13 +1239,16 @@ function vcat(X1::_SparseConcatGroup, X::_SparseConcatGroup...)
1239
1239
end
1240
1240
return Base. typed_vcat (Base. promote_eltype (X1, X... ), X1, X... )
1241
1241
end
1242
- function hvcat (rows:: Tuple{Vararg{Int}} , X1:: _SparseConcatGroup , X:: _SparseConcatGroup... )
1242
+ function hvcat_internal (rows:: Tuple{Vararg{Int}} , X1:: _SparseConcatGroup , X:: _SparseConcatGroup... )
1243
1243
if anysparse (X1) || anysparse (X... )
1244
1244
vcat (_hvcat_rows (rows, X1, X... )... )
1245
1245
else
1246
1246
Base. typed_hvcat (Base. promote_eltypeof (X1, X... ), rows, X1, X... )
1247
1247
end
1248
1248
end
1249
+ function hvcat (rows:: Tuple{Vararg{Int}} , X1:: _SparseConcatGroup , X:: _SparseConcatGroup... )
1250
+ return hvcat_internal (rows, X1, X... )
1251
+ end
1249
1252
function _hvcat_rows ((row1, rows... ):: Tuple{Vararg{Int}} , X:: _SparseConcatGroup... )
1250
1253
if row1 ≤ 0
1251
1254
throw (ArgumentError (" length of block row must be positive, got $row1 " ))
@@ -1266,9 +1269,8 @@ hcat(n1::Number, ns::Vararg{Number}) = invoke(hcat, Tuple{Vararg{Number}}, n1, n
1266
1269
vcat (n1:: Number , ns:: Vararg{Number} ) = invoke (vcat, Tuple{Vararg{Number}}, n1, ns... )
1267
1270
hcat (n1:: N , ns:: Vararg{N} ) where {N<: Number } = invoke (hcat, Tuple{Vararg{N}}, n1, ns... )
1268
1271
vcat (n1:: N , ns:: Vararg{N} ) where {N<: Number } = invoke (vcat, Tuple{Vararg{N}}, n1, ns... )
1269
- hvcat (rows:: Tuple{Vararg{Int}} , n1:: Number , ns:: Vararg{Number} ) = invoke (hvcat, Tuple{typeof (rows), Vararg{Number}}, rows, n1, ns... )
1270
- hvcat (rows:: Tuple{Vararg{Int}} , n1:: N , ns:: Vararg{N} ) where {N<: Number } = invoke (hvcat, Tuple{typeof (rows), Vararg{N}}, rows, n1, ns... )
1271
-
1272
+ hvcat (rows:: Tuple{Vararg{Int}} , n1:: Number , ns:: Vararg{Number} ) = hvcat_internal (rows, n1, ns... )
1273
+ hvcat (rows:: Tuple{Vararg{Int}} , n1:: N , ns:: Vararg{N} ) where {N<: Number } = hvcat_internal (rows, n1, ns... )
1272
1274
1273
1275
# make sure UniformScaling objects are converted to sparse matrices for concatenation
1274
1276
promote_to_array_type (A:: Tuple{Vararg{Union{_SparseConcatGroup,UniformScaling}}} ) = anysparse (A... ) ? SparseMatrixCSC : Matrix
0 commit comments