Skip to content

deprecate eye(::Type{Diagonal{T}}, n), introduce Diagonal[{T}](s::UniformScaling, n)#24415

Merged
Sacha0 merged 2 commits intoJuliaLang:masterfrom
Sacha0:eyediagonal
Nov 1, 2017
Merged

deprecate eye(::Type{Diagonal{T}}, n), introduce Diagonal[{T}](s::UniformScaling, n)#24415
Sacha0 merged 2 commits intoJuliaLang:masterfrom
Sacha0:eyediagonal

Conversation

@Sacha0
Copy link
Copy Markdown
Member

@Sacha0 Sacha0 commented Oct 30, 2017

This pull request first provides Diagonal[{T}](s::UniformScaling, n) constructors as in #24372, and then deprecates eye(::Type{Diagonal{T}}, n) in favor of those constructors. (That eye method is the sole eye method in base that accepts a container type as argument.) Ref. #11557 (comment) and JuliaLang/LinearAlgebra.jl#454. Best!

@Sacha0 Sacha0 added deprecation This change introduces or involves a deprecation linear algebra Linear algebra needs news A NEWS entry is required for this change labels Oct 30, 2017
@Sacha0 Sacha0 removed the needs news A NEWS entry is required for this change label Oct 30, 2017
@Sacha0 Sacha0 force-pushed the eyediagonal branch 2 times, most recently from 0f04644 to 58e8ddc Compare October 31, 2017 04:51

## Diagonal construction from UniformScaling
Diagonal{T}(s::UniformScaling, m::Integer) where {T} = Diagonal{T}(fill(T(s.λ), m))
Diagonal(s::UniformScaling, m::Integer) where {T} = Diagonal{eltype(s)}(s, m)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing {T} on UniformScaling, so either add that and change eltype(s) to T or simply remove where {T}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A beautiful example of why one shouldn't make "trivial changes" without retesting 😄. Thanks @fredrikekre!

@Sacha0
Copy link
Copy Markdown
Member Author

Sacha0 commented Nov 1, 2017

Absent objections or requests for time, I plan to merge these changes tomorrow afternoon. Best!

@Sacha0 Sacha0 merged commit adc97b7 into JuliaLang:master Nov 1, 2017
@Sacha0 Sacha0 deleted the eyediagonal branch November 1, 2017 23:54
@Sacha0
Copy link
Copy Markdown
Member Author

Sacha0 commented Nov 1, 2017

Thanks all!

NHDaly added a commit to NHDaly/julia that referenced this pull request Aug 30, 2018
The History.md file linked to JuliaLang#24413 for `eye` deprecation in 0.7. This commit changes it to link to JuliaLang#24415.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecation This change introduces or involves a deprecation linear algebra Linear algebra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants