-
Notifications
You must be signed in to change notification settings - Fork 123
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
Removing groebner_assure() in MPolyQuo #2658
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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.
What is the dimension of the zero ideal?
Singular.dimension return -1 in this case, leading to a recomputaion and gb computation each time.
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.
I guess we could use
-1
to represent the zero ideal and-2
to represent "nothing was computed"?Or add a proper "negative infinity" as already discussed elsewhere... :-)
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.
The Krull dimension of a proper ideal I in a ring R is by definition the Krull dimension of the quotient ring R/I. The Krull dimension of
ideal(1)
is not defined. In the latter case, Singular returns-1
. In OSCAR, the constructor for ideals of both polynomial rings and quotient rings setsI.dim = -1
. These things together cause the repeated GB computations. Therefore I suggest to follow the suggestion by Max to start with settingI.dim = -2
and change theif
condition in the definition of thedim
functions accordingly.@jankoboehm @HechtiDerLachs ???
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 should somehow store a "not comptuted". Using -1 for the zero ring and -2 for not computed sounds ok for the moment. While -1 is also used for the zero ring, the correct value for the supremum is rather -infinity since there are no chains in the zero ring. It is of course quite dangerous if someone does arithmetic with -1 and -2 directly accessing the field... What about using a type union which allows for nothing (for not computed) and eventually also -infinity.
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.
Independent of this discussion: can this PR merged as is?
In any case, I recommend we open an issue for this discussion (so we don't forget about it), and then either merge this PR, or change this PR to draft and add a comment pointing out the PR is blocked by that issue....
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.
There are multiple issues here:
First off, code that directly accesses this field may have a problem: indeed, but such code is bad anyway. (And we still have too much of it). I would suggest to rename the field to say
_dim
and then eliminate all access to it except fordim
/dimension
accessor (which probably would compute a GB if there is no value set yet),has_dim
/has_dimension
which returnstrue
if the dimension is known,false
otherwise_dim
).The advantage of using a name like
_dim
is that one grep for it and easily find bad places using it. (I am tempted to think we should do something similar for all our structs moving forward. We have far too much code directly accessing struct members everywhere).The other issue is how to represent the values: I am happy to use
nothing
to represent that nothing has been computed yet. That requires to change the definition in the type fromdim::Int
todim::Union{Int,Nothing}
. If use right, Julia is also pretty good about still producing type stable code. E.g. this correctly deduced that the return type is alwaysInt
(of course one can also be extra cautious and change the end toreturn d::Int
)In the future we might use
Union{Int,Nothing,NegInf}
(I am preparing a PR right now to addNegInf
to Nemo), and this should still work (Julia splits unions of up to four types by default)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.
@HechtiDerLachs : Does the dimension problem also appear elsewhere (local case, schemes ..)? Where do we also need to adjust the function?