Skip to content

Commit

Permalink
Strip defs involving RowVector from base/sparse/higherorderfns.jl, gi…
Browse files Browse the repository at this point in the history
…ve behaviors to Adjoint/Transpose.
  • Loading branch information
Sacha0 committed Dec 16, 2017
1 parent dc79192 commit 6131f25
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3074,6 +3074,12 @@ end
\(A::Transpose{<:Any,<:Factorization{<:Real}}, B::RowVector) = transpose(A.parent) \ B
end

# methods involving RowVector from base/sparse/higherorderfns.jl, to deprecate
@eval Base.SparseArrays.HigherOrderFns begin
BroadcastStyle(::Type{<:Base.RowVector{T,<:Vector}}) where T = Broadcast.MatrixStyle()
end


# issue #24822
@deprecate_binding Display AbstractDisplay

Expand Down
3 changes: 2 additions & 1 deletion base/sparse/higherorderfns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,8 @@ Broadcast.BroadcastStyle(::PromoteToSparse, ::Broadcast.Style{Tuple}) = Broadcas
# Broadcast.BroadcastStyle(::SPVM, ::Broadcast.DefaultArrayStyle{0}) = PromoteToSparse()
# Broadcast.BroadcastStyle(::SPVM, ::Broadcast.DefaultArrayStyle{1}) = PromoteToSparse()
# Broadcast.BroadcastStyle(::SPVM, ::Broadcast.DefaultArrayStyle{2}) = PromoteToSparse()
BroadcastStyle(::Type{<:Base.RowVector{T,<:Vector}}) where T = Broadcast.MatrixStyle() # RowVector not yet defined when broadcast.jl loaded
BroadcastStyle(::Type{<:Base.Adjoint{T,<:Vector}}) where T = Broadcast.MatrixStyle() # Adjoint not yet defined when broadcast.jl loaded
BroadcastStyle(::Type{<:Base.Transpose{T,<:Vector}}) where T = Broadcast.MatrixStyle() # Transpose not yet defined when broadcast.jl loaded
Broadcast.BroadcastStyle(::SPVM, ::Broadcast.VectorStyle) = PromoteToSparse()
Broadcast.BroadcastStyle(::SPVM, ::Broadcast.MatrixStyle) = PromoteToSparse()
Broadcast.BroadcastStyle(::SparseVecStyle, ::Broadcast.DefaultArrayStyle{N}) where N =
Expand Down
2 changes: 1 addition & 1 deletion test/sparse/higherorderfns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ end
@test broadcast!(+, Z, V, A, X) == sparse(broadcast(+, fV, fA, X))
@test broadcast(*, s, V, A, X)::SparseMatrixCSC == sparse(broadcast(*, s, fV, fA, X))
@test broadcast!(*, Z, s, V, A, X) == sparse(broadcast(*, s, fV, fA, X))
# Issue #20954 combinations of sparse arrays and RowVectors
# Issue #20954 combinations of sparse arrays and Adjoint/Transpose vectors
@test broadcast(+, A, X')::SparseMatrixCSC == sparse(broadcast(+, fA, X'))
@test broadcast(*, V, X')::SparseMatrixCSC == sparse(broadcast(*, fV, X'))
end
Expand Down

0 comments on commit 6131f25

Please sign in to comment.