• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaLang / julia / #37835
77%

Build:
DEFAULT BRANCH: master
Ran 11 Jul 2024 11:28AM UTC
Jobs 1
Files 361
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Jul 2024 06:03AM UTC coverage: 87.516% (+0.006%) from 87.51%
#37835

push

local

web-flow
Fix `(l/r)mul!` with `Diagonal`/`Bidiagonal` (#55052)

Currently, `rmul!(A::AbstractMatirx, D::Diagonal)` calls `mul!(A, A,
D)`, but this isn't a valid call, as `mul!` assumes no aliasing between
the destination and the matrices to be multiplied. As a consequence,
```julia
julia> B = Bidiagonal(rand(4), rand(3), :L)
4×4 Bidiagonal{Float64, Vector{Float64}}:
 0.476892   ⋅         ⋅         ⋅ 
 0.353756  0.139188   ⋅         ⋅ 
  ⋅        0.685839  0.309336   ⋅ 
  ⋅         ⋅        0.369038  0.304273

julia> D = Diagonal(rand(size(B,2)));

julia> rmul!(B, D)
4×4 Bidiagonal{Float64, Vector{Float64}}:
 0.0   ⋅    ⋅    ⋅ 
 0.0  0.0   ⋅    ⋅ 
  ⋅   0.0  0.0   ⋅ 
  ⋅    ⋅   0.0  0.0

julia> B
4×4 Bidiagonal{Float64, Vector{Float64}}:
 0.0   ⋅    ⋅    ⋅ 
 0.0  0.0   ⋅    ⋅ 
  ⋅   0.0  0.0   ⋅ 
  ⋅    ⋅   0.0  0.0
```
This is clearly nonsense, and happens because the internal `_mul!`
function assumes that it can safely overwrite the destination with zeros
before carrying out the multiplication. This is fixed in this PR by
using broadcasting instead. The current implementation is generally
equally performant, albeit occasionally with a minor allocation arising
from `reshape`ing an `Array`.

A similar problem also exists in `l/rmul!` with `Bidiaognal`, but that's
a little harder to fix while remaining equally performant.

92 of 92 new or added lines in 2 files covered. (100.0%)

17 existing lines in 9 files now uncovered.

77496 of 88551 relevant lines covered (87.52%)

15114947.4 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
96.01
-0.14% base/sort.jl
1
79.92
-0.21% stdlib/FileWatching/src/FileWatching.jl
1
96.21
0.19% stdlib/LinearAlgebra/src/diagonal.jl
1
96.54
-0.18% stdlib/LinearAlgebra/src/generic.jl
1
89.64
0.0% base/compiler/tfuncs.jl
1
72.22
-2.78% stdlib/p7zip_jll/src/p7zip_jll.jl
2
87.77
-0.24% stdlib/REPL/src/REPLCompletions.jl
2
90.45
-0.34% stdlib/LinearAlgebra/src/matmul.jl
7
84.42
-0.1% stdlib/LinearAlgebra/src/adjtrans.jl
Jobs
ID Job ID Ran Files Coverage
1 #37835.1 11 Jul 2024 11:28AM UTC 361
87.52
Source Files on build #37835
  • Tree
  • List 361
  • Changed 262
  • Source Changed 0
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 262b40aa on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc