@@ -5,7 +5,7 @@ module HigherOrderFns
55# This module provides higher order functions specialized for sparse arrays,
66# particularly map[!]/broadcast[!] for SparseVectors and SparseMatrixCSCs at present.
77import Base: map, map!, broadcast, broadcast!
8- import Base. Broadcast: containertype , promote_containertype,
8+ import Base. Broadcast: _containertype , promote_containertype,
99 broadcast_indices, broadcast_c, broadcast_c!
1010
1111using Base: front, tail, to_shape
@@ -83,7 +83,6 @@ function _noshapecheck_map{Tf,N}(f::Tf, A::SparseVecOrMat, Bs::Vararg{SparseVecO
8383end
8484# (3) broadcast[!] entry points
8585broadcast {Tf} (f:: Tf , A:: SparseVecOrMat ) = _noshapecheck_map (f, A)
86- broadcast! {Tf} (f:: Tf , C:: SparseVecOrMat , A:: SparseVecOrMat ) = map! (f, C, A)
8786function broadcast! {Tf,N} (f:: Tf , C:: SparseVecOrMat , A:: SparseVecOrMat , Bs:: Vararg{SparseVecOrMat,N} )
8887 _aresameshape (C, A, Bs... ) && return _noshapecheck_map! (f, C, A, Bs... )
8988 Base. Broadcast. check_broadcast_indices (indices (C), A, Bs... )
843842# broadcast shape promotion for combinations of sparse arrays and other types
844843broadcast_indices (:: Type{AbstractSparseArray} , A) = indices (A)
845844# broadcast container type promotion for combinations of sparse arrays and other types
846- containertype {T<:SparseVecOrMat} (:: Type{T} ) = AbstractSparseArray
845+ _containertype {T<:SparseVecOrMat} (:: Type{T} ) = AbstractSparseArray
847846# combinations of sparse arrays with broadcast scalars should yield sparse arrays
848847promote_containertype (:: Type{Any} , :: Type{AbstractSparseArray} ) = AbstractSparseArray
849848promote_containertype (:: Type{AbstractSparseArray} , :: Type{Any} ) = AbstractSparseArray
0 commit comments