Design #1326
Modify function myElim so that it returns ideal? (not quite)
Description
Currently we have
void SparsePolyRingBase::IdealImpl::myElim(const std::vector<RingElem>& ElimIndets)
should we modify it so that the ideal is not modified and returns the elimination
ideal SparsePolyRingBase::IdealImpl::myElim(const std::vector<RingElem>& ElimIndets) const
?
The current design of several functions on ideals modify this
, but I think it is unnatural for the general cocoalib design.
2024-03 modified like this: J->myAssignElim(I, ElimIndets)
Related issues
History
#1 Updated by Anna Maria Bigatti over 4 years ago
- Related to Feature #813: Implement "elim" in CoCoALib added
#2 Updated by Anna Maria Bigatti over 4 years ago
- Related to Slug #777: SLUG: elimination added
#3 Updated by John Abbott over 4 years ago
- Target version changed from CoCoALib-0.99700 to CoCoALib-0.99800
I prefer to create a new ideal, and not to change the existing one.
Note that an exception-safe impl almost certainly has to create a new ideal for the result anyway...
#4 Updated by John Abbott over 2 years ago
- Target version changed from CoCoALib-0.99800 to CoCoALib-0.99850
#5 Updated by John Abbott over 2 years ago
- Related to Feature #1619: Make saturate available in CoCoALib added
#6 Updated by Anna Maria Bigatti 4 months ago
- % Done changed from 0 to 20
It seems we agree on changing this interface, so I consider this approved.
I'll go on with this, so we can proceed also with the related issues.
#7 Updated by Anna Maria Bigatti 4 months ago
I'm halfway through the process, but this is tricky.
[I think this is interesting, because it's the first try in changing the design for ideals]
myElim
is a member function of the class IdealBase, so returning an ideal (smart pointer) doesn't feel quite right.
I would like to swap the computed generators (vector of RingElem) into the new ideal, but to do that I'd need to call ourGetPtr (dynamic_cast), and also that does not seem right.
#8 Updated by Anna Maria Bigatti 4 months ago
- Status changed from New to Resolved
- % Done changed from 20 to 70
As explained in #note-7, I didn't like the first approach.
So I changed the internal functions as J->myAssignElim(I, ElimIndets)
, and the code came up more nicely.
Not 100% convinced, but surely better than as I->myElim(ElimIndets)
in terms of meaning.
Then I implemented elim
proper, and called it instead of the old myElim
.
Nice.
#9 Updated by Anna Maria Bigatti 4 months ago
- Description updated (diff)
#10 Updated by Anna Maria Bigatti 4 months ago
New question: elim(I, X)
(currently in CoCoALib) or elim(X, I)
(traditionally in CoCoA)?
They have to be same!!
Investigate what other systems do, and decide.
#11 Updated by Anna Maria Bigatti 4 months ago
Anna Maria Bigatti wrote:
New question:
elim(I, X)
(currently in CoCoALib) orelim(X, I)
(traditionally in CoCoA)?They have to be same!!
Investigate what other systems do, and decide.
Singular: elim(i,3..4); Oscar: eliminate(I::PBWAlgIdeal, V::Vector{<:PBWAlgElem}; ordering = nothing) M2: eliminate(x,ideal(f,g)) Magma: EliminationIdeal(I, k: parameters)
#12 Updated by Anna Maria Bigatti 4 months ago
elim of (I,X) or (X,I)?
Pro for (I,X)- respects the rule "more structured argument first"
- like Singular/Oscar and Magma
- respects the rule "as you would say in words": "eliminate X from I"
- respects backward compatibility in CoCoA
- like Macaulay/2
In fact, there would be no ambiguity in providing both ways (a bit tedious, but possible), but I don't think it is a good idea.
#13 Updated by Anna Maria Bigatti 4 months ago
Anna Maria Bigatti wrote:
elim of (I,X) or (X,I)?
comparison with other functions in CoCoA/CoCoALib: (I,X) seems winning (but breaks CoCoA backward compatibility)
deg(x*y^2+y, x) homog(x^3-y, w) CoeffListWRT(F, y)
#14 Updated by Anna Maria Bigatti 4 months ago
- Related to Bug #1560: elim for modules added
#15 Updated by Anna Maria Bigatti 4 months ago
- Related to Design #1767: Finalize design for ideals in CoCoALib added
#16 Updated by Anna Maria Bigatti 4 months ago
- Subject changed from Modify function myElim so that it returns ideal to Modify function myElim so that it returns ideal? (not quite)
- Description updated (diff)
#17 Updated by Anna Maria Bigatti 4 months ago
- Status changed from Resolved to Closed
- % Done changed from 70 to 100