Project

General

Profile

Feature #1763

implement ideal(R) for zero ideal, with no generators?

Added by Anna Maria Bigatti 8 months ago. Updated 2 months ago.

Status:
Rejected
Priority:
Normal
Category:
New Function
Target version:
Start date:
07 Sep 2023
Due date:
% Done:

100%

Estimated time:
1.01 h
Spent time:

Description

I'm fairly sure we used to have the constructor ideal(R) for an ideal with no generators, but I cannot find any trace of it (and/or why we do not have it).
Of course we can write explicitely ideal(R, v) with an empty vector, but that's ugly.

Should I add the constructor ideal(R)?

2024-02 No longer needed: just call ideal(zero(R))


Related issues

Related to CoCoALib - Design #1647: Suppress zero from ideal generators? Detect 1 and simplify generators?Closed2022-01-20

History

#1 Updated by John Abbott 8 months ago

Mmm, don't remember... I'm still on holiday (sort of).
We can do ideal(zero(P)) and ideal(P,EmptyList).
Maybe the argument was that ideal(P) is less clear to read than either of the alternatives in the line above?

Do we have good "use cases" where someone really want to create a zero ideal with no generators rather than than a zero ideal containing one zero generator?

We could also consider making a new function NonZeroGens; it'd be easy to make, but would it ever really be useful?

#2 Updated by John Abbott 8 months ago

Here is another idea. We could create a constant empty vector of RingElem, and use that.

  const std::vector<RingElem> NoGens;
  ...
  ideal(P, NoGens); // since NoGens is empty it works for all rings P

This is probably good for readability, but it does create a new global object.
It is also similar to what one must do in CoCoA-5: namely ideal(P,[])

#3 Updated by John Abbott 7 months ago

In comment 1 I used EmptyList; in comment 2 I used NoGens
I think I dislike EmptyList because it is rather ambiguous: it should be EmptyListOfRingElem (but who wants to write/read that?)
NoGens is short, but reads well only in a context where "generators" are needed. Might we need an empty list of RingElem in any other context?

#4 Updated by John Abbott 4 months ago

  • Target version changed from CoCoALib-0.99800 to CoCoALib-0.99850

I still think that ideal(P) looks odd, and is less immediate to understand than ideal(P,EmptyListOfRingElem).
Or we could just create a new function ZeroIdeal(P).
What do you think?

#5 Updated by Anna Maria Bigatti 3 months ago

Anna: read it all, decide, implement, close!

#6 Updated by Anna Maria Bigatti 3 months ago

  • Related to Design #1647: Suppress zero from ideal generators? Detect 1 and simplify generators? added

#7 Updated by Anna Maria Bigatti 3 months ago

  • Subject changed from implement ideal(P) for zero ideal, with no generators? to implement ideal(R) for zero ideal, with no generators?

#8 Updated by Anna Maria Bigatti 2 months ago

  • Status changed from In Progress to Rejected
  • % Done changed from 10 to 100

No longer needed because ideal(zero(R)) now gives ideal in R with no generators.

#9 Updated by Anna Maria Bigatti 2 months ago

  • Description updated (diff)

#10 Updated by Anna Maria Bigatti 2 months ago

  • Estimated time set to 1.01 h

Also available in: Atom PDF