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 (JuliaLang#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