Skip to content

Commit 7315691

Browse files
committed
Revert "Use map! in broadcasting if sizes match (#284)"
This reverts commit e9f7266.
1 parent e9f7266 commit 7315691

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/generic/broadcast.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,9 +643,7 @@ function _banded_broadcast!(dest::AbstractMatrix, f, (A,B)::Tuple{AbstractMatrix
643643
data_d,data_A, data_B = bandeddata(dest), bandeddata(A), bandeddata(B)
644644

645645
if (d_l,d_u) == (A_l,A_u) == (B_l,B_u)
646-
# An inplace map is faster than an inplace broadcast
647-
# (checked on Julia v1.8.3 and 1.10 dev)
648-
map!(f, data_d, data_A, data_B)
646+
data_d .= f.(data_A,data_B)
649647
else
650648
max_l,max_u = max(A_l,B_l,d_l),max(A_u,B_u,d_u)
651649
min_l,min_u = min(A_l,B_l,d_l),min(A_u,B_u,d_u)

test/test_broadcasting.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ import BandedMatrices: BandedStyle, BandedRows
3737
@test 1 .+ A isa BandedMatrix
3838
@test (1 .+ A) == 1 .+ Matrix(A)
3939

40-
@test A .+ A == 2A
41-
4240
@test 1 .\ A == 1 .\ Matrix(A)
4341
@test 1 .\ A isa BandedMatrix
4442
@test bandwidths(1 .\ A) == bandwidths(A)

0 commit comments

Comments
 (0)