-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't access uninitialized indices in
tril!
/triu!
for numeric arr…
…ays (#52528) This specializes the generic `triu!` and `tril!` methods for arrays of numbers, where a zero is known to exist. In such cases, we don't need to read the possibly uninitialized values of the elements at the indices that are to be assigned to. After this, the following would be possible: ```julia julia> M = Matrix{BigFloat}(undef, 3, 3) 3×3 Matrix{BigFloat}: #undef #undef #undef #undef #undef #undef #undef #undef #undef julia> triu!(M) 3×3 Matrix{BigFloat}: #undef #undef #undef 0.0 #undef #undef 0.0 0.0 #undef ```
- Loading branch information
Showing
2 changed files
with
38 additions
and
3 deletions.
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