-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]broadcastApplying a function over a collectionApplying a function over a collectionbugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavior
Description
Broadcasting addition for UpperTriangular
, LowerTriangular
, and Diagonal
produces a Diagonal
. Note that normal addition is fine, and if either of these matrices are excluded, the result is fine.
julia> using Random, LinearAlgebra
julia> Random.seed!(42);
julia> U = UpperTriangular(randn(3,3));
julia> L = LowerTriangular(randn(3,3));
julia> D = Diagonal(randn(3));
julia> U+L+D
3×3 Array{Float64,2}:
0.857936 -0.299484 -0.468606
1.08238 2.41289 0.156143
0.187028 0.367563 -5.28356
julia> U.+L.+D
3×3 Diagonal{Float64,Array{Float64,1}}:
0.857936 ⋅ ⋅
⋅ 2.41289 ⋅
⋅ ⋅ -5.28356
Version info:
julia> versioninfo()
Julia Version 1.3.0-rc2.0
Commit a04936e3e0 (2019-09-12 19:49 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.6.0)
CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, haswell)
Also confirmed on 1.2.
chriscoey and gogglembauman
Metadata
Metadata
Assignees
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]broadcastApplying a function over a collectionApplying a function over a collectionbugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavior