-
Notifications
You must be signed in to change notification settings - Fork 126
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
Adds free resolutions over quotient rings by using Singular.sres
#4134
Changes from 7 commits
6b9dcc6
f8a555b
3d35d0a
6925b56
f47f456
14c7ab3
452dd02
8588359
71cbe8c
5c2a895
bb81af4
16985d5
846a464
11bf9f4
de3ec65
3db4e44
64f6b44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -263,19 +263,19 @@ Convert a Singular vector to a free module element. | |
""" | ||
function (F::FreeMod)(s::Singular.svector) | ||
pos = Int[] | ||
values = [] | ||
Rx = base_ring(F) | ||
R = base_ring(Rx) | ||
for (i, e, c) = s | ||
f = Base.findfirst(==(i), pos) | ||
R = coefficient_ring(Rx) | ||
values = elem_type(Rx)[] | ||
for (i, e, c) in s | ||
f = Base.findfirst(x->x==i, pos) | ||
if f === nothing | ||
push!(values, MPolyBuildCtx(base_ring(F))) | ||
push!(values, zero(Rx)) | ||
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. Were these deliberately reverted because we do not have an Edit: This does not need to hold this PR back for now. But before anyone merges, we should open an issue to remind us to clean this bit up. 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. Follow up: I tried do speed up some of our computations yesterday and made a patch for this part here in #4147 . Would it be desirable to push it directly to this PR? If so, please let me know. 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. Thanks for taking a look and fixing this! Merging this in unison would be good for me. |
||
f = length(values) | ||
push!(pos, i) | ||
end | ||
push_term!(values[f], R(c), e) | ||
values[f] += R(c)*prod(gens(Rx) .^ e) | ||
end | ||
pv = Tuple{Int, elem_type(Rx)}[(pos[i], base_ring(F)(finish(values[i]))) for i=1:length(pos)] | ||
pv = [(pos[i], values[i]) for i=1:length(pos)] | ||
return FreeModElem(sparse_row(base_ring(F), pv), F) | ||
end | ||
|
||
|
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.
Singular's sres sets a default of nvars(basering) modules to be computed, if no length is specified. It might be better for compatibility to document this fallback instead of throwing an error.
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.
Thank you for taking a look. Having this default nvars(basering) length is the same they had in Macaulay2, they told me that they removed this at some point for clarity for the users.
But if you prefer to have this default, I will of course make the appropriate changes.