https://github.com/JuliaLang/julia
Revision 163393448c9df1fa0a3a3d051913eadd4f94a3ac authored by Jishnu Bhattacharya on 20 December 2023, 04:06:26 UTC, committed by GitHub on 20 December 2023, 04:06:26 UTC
Only looping over the triangular part provides a performance boost:
```julia
julia> U = UpperTriangular(rand(3000,3000));

julia> @btime zero($U);
  23.575 ms (3 allocations: 68.66 MiB) # master
  15.739 ms (3 allocations: 68.66 MiB) # PR
```
This is only really applicable when filling a triangular matrix with
zeros, but this has several applications (e.g. imaginary part of a real
matrix).

---------

Co-authored-by: Daniel Karrasch <daniel.karrasch@posteo.de>
1 parent 24e43ad
Raw File
Tip revision: 163393448c9df1fa0a3a3d051913eadd4f94a3ac authored by Jishnu Bhattacharya on 20 December 2023, 04:06:26 UTC
Specialize `fill!` for `Lower`/`UpperTriangular` (#52570)
Tip revision: 1633934
VERSION
1.11.0-DEV
back to top