fix equality of eigen factorizations#41132
Merged
simeonschaub merged 7 commits intomasterfrom Jun 14, 2021
Merged
Conversation
At least the newly added field `rcondv` may contain `undef` values, so these can cause the same eigen factorizations not to compare equal. Not 100% sure whether the other fields should be ignored as well, but since we didn't have them before, it seems at least consistent to ignore them here. fixes JuliaDiff/ChainRules.jl#422
c430b0d to
53e8d86
Compare
vtjnash
reviewed
Jun 8, 2021
Member
vtjnash
left a comment
There was a problem hiding this comment.
Does it need to overload hash and isequal too, currently defined here:
julia> methods(hash, (Factorization, UInt))
# 1 method for generic function "hash":
julia/stdlib/LinearAlgebra/src/factorization.jl
Lines 67 to 69 in 1910a76
Member
Author
|
Oh, good point! |
simeonschaub
commented
Jun 8, 2021
| end | ||
|
|
||
| function Base.hash(F::Eigen, h::UInt) | ||
| return hash(F.values, hash(F.vectors, h)) |
Member
Author
There was a problem hiding this comment.
Should this hash the type of the factorization as well? I kept it consistent with the previous behavior, but perhaps that should be changed?
Member
Author
There was a problem hiding this comment.
I have changed this now to include Eigen in the hash.
Member
Author
|
Could I get a review for this? Would be nice to fix this, since it currently causes test failures with ChainRules. |
vtjnash
approved these changes
Jun 14, 2021
KristofferC
pushed a commit
that referenced
this pull request
Jun 17, 2021
At least the newly added field `rcondv` may contain `undef` values, so these can cause the same eigen factorizations not to compare equal. Not 100% sure whether the other fields should be ignored as well, but since we didn't have them before, it seems at least consistent to ignore them here. fixes JuliaDiff/ChainRules.jl#422 (cherry picked from commit bc3ce48)
johanmon
pushed a commit
to johanmon/julia
that referenced
this pull request
Jul 5, 2021
At least the newly added field `rcondv` may contain `undef` values, so these can cause the same eigen factorizations not to compare equal. Not 100% sure whether the other fields should be ignored as well, but since we didn't have them before, it seems at least consistent to ignore them here. fixes JuliaDiff/ChainRules.jl#422
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At least the newly added field
rcondvmay containundefvalues, sothese can cause the same eigen factorizations not to compare equal. Not
100% sure whether the other fields should be ignored as well, but since
we didn't have them before, it seems at least consistent to ignore them
here.
fixes JuliaDiff/ChainRules.jl#422