julia
25c8128d - Aggressive constprop in istriu/istril for structured matrices (#54437)

Commit
1 year ago
Aggressive constprop in istriu/istril for structured matrices (#54437) This makes the following evaluate at compile-time: ```julia julia> U = UpperTriangular(rand(2,2)); julia> @code_typed istriu(U) CodeInfo( 1 ─ return true ) => Bool ``` Also, this reduces latency in this operation: ```julia julia> @time (U -> istriu(U))(U) 0.069995 seconds (158.88 k allocations: 8.715 MiB, 83.72% compilation time) # nightly 0.035610 seconds (156.62 k allocations: 8.594 MiB, 68.18% compilation time) # This PR ``` Similar methods are annotated for other structured matrix types, where the results may be trivially obtained from the structure for certain values of the band index `k`.
Author
Parents
Loading