-
-
Couldn't load subscription status.
- Fork 35
Closed
JuliaLang/julia
#30298Labels
speculativeWhether the change will be implemented is speculativeWhether the change will be implemented is speculative
Description
It might be nice if we made I callable so that you can write I(10) and get a 10x10 Diagonal matrix object. Of course it's a bit weird to call one kind of object and get another, but we do that with functions all the time so maybe that's no problem. Possible definition:
(σ::UniformScaling)(n::Integer) = Diagonal(collect(Iterators.repeated(σ.λ, n)))With this definition, we could potentially deprecate eye(n) (which is usually quite inefficient) in favor of I(n) when one doesn't need to mutate any off-diagonals or full(I(n)) in the cases where one does need to mutate an off-diagonal.
JeffBezanson, pkofod, KlausC, HarrisonGrodin, stevengj and 8 morelobingera
Metadata
Metadata
Assignees
Labels
speculativeWhether the change will be implemented is speculativeWhether the change will be implemented is speculative