Skip to content

Commit

Permalink
Fix simultaneous merge issue between JuliaLang#19724 and JuliaLang#19922
Browse files Browse the repository at this point in the history
.
  • Loading branch information
Sacha0 committed Jan 9, 2017
1 parent 13da0b9 commit d1a9cb0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions base/sparse/higherorderfns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module HigherOrderFns
# This module provides higher order functions specialized for sparse arrays,
# particularly map[!]/broadcast[!] for SparseVectors and SparseMatrixCSCs at present.
import Base: map, map!, broadcast, broadcast!
import Base.Broadcast: containertype, promote_containertype,
import Base.Broadcast: _containertype, promote_containertype,
broadcast_indices, broadcast_c, broadcast_c!

using Base: front, tail, to_shape
Expand Down Expand Up @@ -83,7 +83,6 @@ function _noshapecheck_map{Tf,N}(f::Tf, A::SparseVecOrMat, Bs::Vararg{SparseVecO
end
# (3) broadcast[!] entry points
broadcast{Tf}(f::Tf, A::SparseVecOrMat) = _noshapecheck_map(f, A)
broadcast!{Tf}(f::Tf, C::SparseVecOrMat, A::SparseVecOrMat) = map!(f, C, A)
function broadcast!{Tf,N}(f::Tf, C::SparseVecOrMat, A::SparseVecOrMat, Bs::Vararg{SparseVecOrMat,N})
_aresameshape(C, A, Bs...) && return _noshapecheck_map!(f, C, A, Bs...)
Base.Broadcast.check_broadcast_indices(indices(C), A, Bs...)
Expand Down Expand Up @@ -843,7 +842,7 @@ end
# broadcast shape promotion for combinations of sparse arrays and other types
broadcast_indices(::Type{AbstractSparseArray}, A) = indices(A)
# broadcast container type promotion for combinations of sparse arrays and other types
containertype{T<:SparseVecOrMat}(::Type{T}) = AbstractSparseArray
_containertype{T<:SparseVecOrMat}(::Type{T}) = AbstractSparseArray
# combinations of sparse arrays with broadcast scalars should yield sparse arrays
promote_containertype(::Type{Any}, ::Type{AbstractSparseArray}) = AbstractSparseArray
promote_containertype(::Type{AbstractSparseArray}, ::Type{Any}) = AbstractSparseArray
Expand Down

0 comments on commit d1a9cb0

Please sign in to comment.