@@ -46,8 +46,15 @@ function hcat(A::AbstractLinearOperator, B::AbstractLinearOperator)
4646 hcat_ctprod! (res, adjoint (A), adjoint (B), Ancol, Ancol + Bncol, w, α, β)
4747 args5 = (has_args5 (A) && has_args5 (B))
4848 S = promote_type (storage_type (A), storage_type (B))
49- isconcretetype (S) ||
50- throw (LinearOperatorException (" storage types cannot be promoted to a concrete type" ))
49+ if ! isconcretetype (S)
50+ if isconcretetype (storage_type (A))
51+ S = storage_type (A)
52+ elseif isconcretetype (storage_type (B))
53+ S = storage_type (B)
54+ else
55+ S = Vector{T}
56+ end
57+ end
5158 CompositeLinearOperator (T, nrow, ncol, false , false , prod!, tprod!, ctprod!, args5, S = S)
5259end
5360
@@ -105,8 +112,15 @@ function vcat(A::AbstractLinearOperator, B::AbstractLinearOperator)
105112 vcat_ctprod! (res, adjoint (A), adjoint (B), Anrow, Anrow + Bnrow, w, α, β)
106113 args5 = (has_args5 (A) && has_args5 (B))
107114 S = promote_type (storage_type (A), storage_type (B))
108- isconcretetype (S) ||
109- throw (LinearOperatorException (" storage types cannot be promoted to a concrete type" ))
115+ if ! isconcretetype (S)
116+ if isconcretetype (storage_type (A))
117+ S = storage_type (A)
118+ elseif isconcretetype (storage_type (B))
119+ S = storage_type (B)
120+ else
121+ S = Vector{T}
122+ end
123+ end
110124 CompositeLinearOperator (T, nrow, ncol, false , false , prod!, tprod!, ctprod!, args5, S = S)
111125end
112126
0 commit comments