Project

General

Profile

Design #1326

Modify function myElim so that it returns ideal? (not quite)

Added by Anna Maria Bigatti over 4 years ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Category:
Tidying
Target version:
Start date:
03 Oct 2019
Due date:
% Done:

100%

Estimated time:
Spent time:

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

Related to CoCoALib - Feature #813: Implement "elim" in CoCoALibFeedback2015-11-23

Related to CoCoALib - Slug #777: SLUG: eliminationIn Progress2015-09-15

Related to CoCoALib - Feature #1619: Make saturate available in CoCoALibClosed2021-10-15

Related to CoCoA-5 - Bug #1560: elim for modulesNew2021-01-11

Related to CoCoALib - Design #1767: Finalize design for ideals in CoCoALibIn Progress2023-10-31

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 about 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 about 2 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 about 2 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 about 1 month 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 about 1 month ago

  • Description updated (diff)

#10 Updated by Anna Maria Bigatti about 1 month 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 about 1 month ago

Anna Maria Bigatti wrote:

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.

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 about 1 month ago

elim of (I,X) or (X,I)?

Pro for (I,X)
  1. respects the rule "more structured argument first"
  2. like Singular/Oscar and Magma
Pro for (X,I)
  1. respects the rule "as you would say in words": "eliminate X from I"
  2. respects backward compatibility in CoCoA
  3. 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 about 1 month 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 about 1 month ago

  • Related to Bug #1560: elim for modules added

#15 Updated by Anna Maria Bigatti about 1 month ago

  • Related to Design #1767: Finalize design for ideals in CoCoALib added

#16 Updated by Anna Maria Bigatti about 1 month 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 about 1 month ago

  • Status changed from Resolved to Closed
  • % Done changed from 70 to 100

Also available in: Atom PDF