@@ -404,9 +404,11 @@ promote_to_arrays(n,k, ::Type{T}, A, B, Cs...) where {T} =
404
404
(promote_to_arrays_ (n[k], T, A), promote_to_arrays_ (n[k+ 1 ], T, B), promote_to_arrays (n,k+ 2 , T, Cs... )... )
405
405
promote_to_array_type (A:: Tuple{Vararg{Union{AbstractVecOrMat,UniformScaling,Number}}} ) = Matrix
406
406
407
- for (f,dim,name) in ((:hcat ,1 , " rows" ), (:vcat ,2 , " cols" ))
407
+ for (f, _f, dim, name) in ((:hcat , :_hcat , 1 , " rows" ), (:vcat , :_vcat , 2 , " cols" ))
408
408
@eval begin
409
- function $f (A:: Union{AbstractVecOrMat,UniformScaling,Number} ...)
409
+ @inline $ f (A:: Union{AbstractVecOrMat,UniformScaling} ...) = $ _f (A... )
410
+ @inline $ f (A:: Union{AbstractVecOrMat,UniformScaling,Number} ...) = $ _f (A... )
411
+ function $_f (A:: Union{AbstractVecOrMat,UniformScaling,Number} ...)
410
412
n = - 1
411
413
for a in A
412
414
if ! isa (a, UniformScaling)
@@ -424,8 +426,9 @@ for (f,dim,name) in ((:hcat,1,"rows"), (:vcat,2,"cols"))
424
426
end
425
427
end
426
428
427
-
428
- function hvcat (rows:: Tuple{Vararg{Int}} , A:: Union{AbstractVecOrMat,UniformScaling,Number} ...)
429
+ hvcat (rows:: Tuple{Vararg{Int}} , A:: Union{AbstractVecOrMat,UniformScaling} ...) = _hvcat (rows, A... )
430
+ hvcat (rows:: Tuple{Vararg{Int}} , A:: Union{AbstractVecOrMat,UniformScaling,Number} ...) = _hvcat (rows, A... )
431
+ function _hvcat (rows:: Tuple{Vararg{Int}} , A:: Union{AbstractVecOrMat,UniformScaling,Number} ...)
429
432
require_one_based_indexing (A... )
430
433
nr = length (rows)
431
434
sum (rows) == length (A) || throw (ArgumentError (" mismatch between row sizes and number of arguments" ))
0 commit comments