-
Notifications
You must be signed in to change notification settings - Fork 130
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
Some improvements on the modules #3041
Merged
fingolfin
merged 16 commits into
oscar-system:master
from
HechtiDerLachs:module_map_optimizations
Nov 30, 2023
Merged
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ad8db16
Some improvements on modules and their morphisms.
HechtiDerLachs 12994d5
Some further tweaks on module maps.
HechtiDerLachs f78aeb3
Some fixes.
HechtiDerLachs 51e2a73
Some more improvements.
HechtiDerLachs 065f303
Some more tweaks.
HechtiDerLachs 9a1597f
Reapply switch to getter after rebase [no ci].
HechtiDerLachs 81a4988
Add some type stability to allow for zero morphisms.
HechtiDerLachs 7a81154
Fix tests.
HechtiDerLachs 0df44a6
Fix doctests.
HechtiDerLachs b876d3d
Amend changes from today's discussion.
HechtiDerLachs 2dba828
Set default hash function to error.
HechtiDerLachs 0a11318
More on hashes.
HechtiDerLachs 7496697
Update src/Modules/UngradedModules/FreeModuleHom.jl
fingolfin 65a3fa9
Revert to a dummy hash function.
HechtiDerLachs 9a4046f
Fix some false flags.
HechtiDerLachs db03eea
Attempt to fix doctests.
HechtiDerLachs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -216,14 +216,26 @@ function (==)(a::AbstractFreeModElem, b::AbstractFreeModElem) | |||||
return a.coords == b.coords | ||||||
end | ||||||
|
||||||
function hash(a::AbstractFreeModElem, h::UInt) | ||||||
function hash(a::AbstractFreeModElem{<:MPolyElem}, h::UInt) | ||||||
b = 0xaa2ba4a32dd0b431 % UInt | ||||||
h = hash(typeof(a), h) | ||||||
h = hash(parent(a), h) | ||||||
h = hash(coordinates(a), h) | ||||||
return xor(h, b) | ||||||
end | ||||||
|
||||||
function hash(a::AbstractFreeModElem{<:MPolyQuoRingElem}, h::UInt) | ||||||
simplify!(a) | ||||||
b = 0xaa2ba4a32dd0b431 % UInt | ||||||
h = hash(typeof(a), h) | ||||||
h = hash(parent(a), h) | ||||||
h = hash(coordinates(a), h) | ||||||
return xor(h, b) | ||||||
end | ||||||
|
||||||
simplify(a::AbstractFreeModElem{<:MPolyQuoRingElem}) = return parent(a)(map_entries(simplify, coordinates(a))) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
simplify!(a::AbstractFreeModElem{<:MPolyQuoRingElem}) = simplify(a) | ||||||
|
||||||
function Base.deepcopy_internal(a::AbstractFreeModElem, dict::IdDict) | ||||||
return parent(a)(deepcopy_internal(coordinates(a), dict)) | ||||||
end | ||||||
|
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just discussed how this call resp. this
hash
method is somewhat dangerous:simplify!(a)
modifiesa
in-place and also "remembers" that it is simplified (so it is fast "amortized", i.e. you only compute a GB for it once)simplify!
. We really need one otherwise we are building on quicksanderror("not supported")
here and handle using these in dicts differently??hash(a::AbstractFreeModElem, h::UInt)
method just was wrong...