Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Nov 1, 2017

Conversation

Sacha0
Copy link
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
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
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
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
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