-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LinAlg: fzeropreserving unit triangular broadcast preserves structure (…
…#53648) On master ```julia julia> UU = UnitUpperTriangular(reshape([1:9;],3,3)) 3×3 UnitUpperTriangular{Int64, Matrix{Int64}}: 1 4 7 ⋅ 1 8 ⋅ ⋅ 1 julia> UU .* 2 3×3 Matrix{Int64}: 2 8 14 0 2 16 0 0 2 ``` This PR ```julia julia> UU .* 2 3×3 UpperTriangular{Int64, Matrix{Int64}}: 2 8 14 ⋅ 2 16 ⋅ ⋅ 2 ``` This also improves performance, as the `materialize` skips the structured zeros. ```julia julia> UU = UnitUpperTriangular(rand(100, 100)); julia> @Btime $UU .* 2; 12.788 μs (3 allocations: 78.20 KiB) # master 7.821 μs (3 allocations: 78.20 KiB) # PR ```
- Loading branch information
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters