@@ -854,7 +854,7 @@ promote_containertype(::Type{Tuple}, ::Type{AbstractSparseArray}) = Array
854
854
promote_containertype (:: Type{AbstractSparseArray} , :: Type{Array} ) = Array
855
855
promote_containertype (:: Type{AbstractSparseArray} , :: Type{Tuple} ) = Array
856
856
857
- # broadcast[!] entry points for combinations of sparse arrays and other types
857
+ # broadcast[!] entry points for combinations of sparse arrays and other (scalar) types
858
858
@inline function broadcast_c {N} (f, :: Type{AbstractSparseArray} , mixedargs:: Vararg{Any,N} )
859
859
parevalf, passedargstup = capturescalars (f, mixedargs)
860
860
return broadcast (parevalf, passedargstup... )
@@ -914,7 +914,12 @@ promote_containertype(::Type{Tuple}, ::Type{StructuredArray}) = Array
914
914
915
915
# for combinations involving sparse/structured arrays and scalars only,
916
916
# promote all structured arguments to sparse and then rebroadcast
917
- broadcast_c {N,Tf} (f:: Tf , :: Type{StructuredArray} , As:: Vararg{Any,N} ) = broadcast (f, map (_sparsifystructured, As)... )
917
+ @inline broadcast_c {N} (f, :: Type{StructuredArray} , As:: Vararg{Any,N} ) =
918
+ broadcast (f, map (_sparsifystructured, As)... )
919
+ @inline broadcast_c! {N} (f, :: Type{AbstractSparseArray} , :: Type{StructuredArray} , C, B, As:: Vararg{Any,N} ) =
920
+ broadcast! (f, C, _sparsifystructured (B), map (_sparsifystructured, As)... )
921
+ @inline broadcast_c! {N} (f, CT:: Type , :: Type{StructuredArray} , C, B, As:: Vararg{Any,N} ) =
922
+ broadcast_c! (f, CT, Array, C, B, As... )
918
923
@inline _sparsifystructured (S:: SymTridiagonal ) = SparseMatrixCSC (S)
919
924
@inline _sparsifystructured (T:: Tridiagonal ) = SparseMatrixCSC (T)
920
925
@inline _sparsifystructured (B:: Bidiagonal ) = SparseMatrixCSC (B)
0 commit comments