Project

General

Profile

Feature #658

Indets actually in a poly (or vector or matrix)

Added by John Abbott over 9 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
New Function
Target version:
Start date:
22 Jan 2015
Due date:
% Done:

100%

Estimated time:
4.66 h
Spent time:

Description

Should we have a function which says which indets actually appear in a polynomial?


Related issues

Related to CoCoALib - Feature #562: SubringsNew2014-05-20

Related to CoCoA-5 - Bug #100: BringIn should map only the indets in its argNew2012-03-07

Related to CoCoA-5 - Slug #687: Builtin fn makes unnecessary copy of argClosed2015-04-19

Related to CoCoALib - Feature #91: Return type & name for "indets" of a PPClosed2012-02-11

Related to CoCoALib - Feature #1103: Pseudo-zero-dim idealsIn Progress2017-09-19

Related to CoCoALib - Feature #1349: ideal ctor where given gens are a gbasisIn Progress2019-10-24

History

#1 Updated by John Abbott over 9 years ago

If the answer is yes then we must decide some things:
  • what is the answer? List of polys which are actually indets? List of indices?
  • should "indets" in the coeff ring be considered?
  • to what types can it be applied? RINGELEM, LIST, IDEAL??, MATRIX

What should it be called? indets is already defined for rings; we could extend that, or else use a new name.

#2 Updated by Anna Maria Bigatti over 9 years ago

John Abbott wrote:

If the answer is yes then we must decide some things:
  • what is the answer? List of polys which are actually indets? List of indices?

in CoCoALib it should be the list of indices, in CoCoA-5 I'm not sure...

  • should "indets" in the coeff ring be considered?

no

  • to what types can it be applied? RINGELEM, LIST, IDEAL??, MATRIX

RINGELEM yes
IDEAL no (generator dependant)
LIST inclined for no (elements might be in different rings!)
MATRIX maybe

What should it be called? indets is already defined for rings; we could extend that, or else use a new name.

indets would be ambiguous, I believe. Said that, I cannot think of another good name ;-)

#3 Updated by John Abbott about 9 years ago

A possible name: IndetsIn

I would like to have IndetsIn also for a list (which is assumed to be "homogeneous", i.e. all elements in the same poly ring o/w error). I used it in some CoCoA-5 code for checking whether a set of conditions defines an arithmetic group (these conditions would then become generators of an ideal).

#4 Updated by John Abbott about 9 years ago

Here are two potentially related fns:
  • InvolvesOnlyTheseIndets which returns a bool -- could be much faster than checking IndetsIn for being a subset
  • PolyInIndetPower which returns a list of PPs such that the arg is a polynomial in these PPs (e.g. given x^10+x^5+2 the result would be x^5)

The second fn is potentially quite complicated, but could be useful for mapping some multivariate polynomials down to simpler ones. Hmmm, technically a homogeneous bivariate polynomial is "equivalent" to a univariate polynomial, but it would not fit this scheme... :-/

NOTE we can consider InvolvesOnlyTheseIndets if some genuine applications for it arise.

NOTE2 I am not sure what semantics the fn PolyInIndetPower should have; it could certainly be useful in GCD and factorization...

#5 Updated by John Abbott about 9 years ago

I have impl'ed a first version (simple rather than efficient).
Not yet checked in; I want to do some testing first.

#6 Updated by John Abbott about 9 years ago

I am still undecided about the "return" value (and its type):
  • A a list of integer indices (presumably of type vector<long>)
  • B a vector "bools" with k-th posn being set to "true" if k-th indet is present

A possible advantage of B is that it would allow checking to finish early if all entries are "true" (e.g. when checking a list of polynomials, checking could end part way through a poly even if that poly does not contain all indets). Not sure how genuinely useful this could be.

We could even offer both interfaces (but that seems excessive for a seemingly unimportant function).

In B the return type vector<bool> is probably a poor choice because I suspect that setting individual bits is likely to be costly; vector<int> should be faster -- I'll check! ANSWER [in IndetsIn in SparsePolyRing.C:965] there's very little difference (hardly measurable), so vector<bool> is a better choice because it more clearly expresses the purpose.

#7 Updated by Anna Maria Bigatti about 9 years ago

also related to #91

#8 Updated by John Abbott almost 9 years ago

An advantage of vector<bool> is that it avoids the problem/incompatibility of indices in C++ starting from 0 (both for vectors and indets) whereas in CoCoA-5 they start from 1.

#9 Updated by John Abbott almost 9 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

Anna suggests the result could be a DynamicBitset; these appear to be like vector<bool> but also support bitwise logic operations.

#10 Updated by John Abbott over 7 years ago

  • Project changed from CoCoA-5 to CoCoALib
  • Subject changed from Indets actually in a poly to Indets actually in a poly (or vector or matrix)
  • Category changed from CoCoA-5 function: new to New Function
  • Target version changed from CoCoA-5.?.? to CoCoALib-1.0

I have moved this issue to CoCoALib, which is where I had expected to find it.

On several occasions I would have liked to have a function which tells me "which subring" the computation is in (e.g. maybe I simply needed to pick an indet from those actually appearing in the polynomial).

#11 Updated by John Abbott over 6 years ago

This is definitely needed: There are awkward work-arounds in radical.cpkg5 and in BringIn.cpkg5.

#12 Updated by John Abbott over 6 years ago

#13 Updated by Anna Maria Bigatti over 6 years ago

  • Target version changed from CoCoALib-1.0 to CoCoALib-0.99600

#14 Updated by John Abbott almost 6 years ago

  • Target version changed from CoCoALib-0.99600 to CoCoALib-0.99650 November 2019

#15 Updated by John Abbott about 5 years ago

  • Priority changed from Normal to High
  • Target version changed from CoCoALib-0.99650 November 2019 to CoCoALib-0.99700
  • % Done changed from 10 to 20

It seems that there is already an impl in SparsePolyOps-RingElem.

There is no doc, no test. Also not exported to CoCoA-5.

It would be nice to finish this soon (but there are still some questions to answer, see above).

Another possible return value is a product of the indets actually appearing. This has the feature that it retains the identity of the poly ring even if there are no indets (since the result is then one(P)).

#16 Updated by John Abbott over 4 years ago

  • % Done changed from 20 to 30

I have just added (in SparsePolyOps-RingElem.C) an impl for IndetsIn(const std::vector<RingElem>&).
The result is vector<long> the same as what the existing impl of IndetsIn(ConstRefRingElem) produces.

I'm now trying to use it to modify MinPolyXYZ so that it works with "relatively zero-dim ideals". Not entirely trivial :-/

PS the new impl uses the "new" C++11 for loop syntax (and a goto statement)

#17 Updated by John Abbott over 4 years ago

  • Related to Feature #1349: ideal ctor where given gens are a gbasis added

#18 Updated by John Abbott over 4 years ago

Checked in IndetsIn(vector<RingElem>)

#19 Updated by John Abbott about 4 years ago

  • Status changed from In Progress to Resolved
  • Assignee set to John Abbott
  • % Done changed from 30 to 70
  • Estimated time set to 3.99 h

Comment 18 about says that I have checked the code in (seems to be true!)

Still no doc; and probably no examples.

#20 Updated by John Abbott about 4 years ago

  • Priority changed from High to Urgent

After discussing with Anna, she wants the result to be a polynomial (which is a 1-monomial) whose value is the product of the indets appearing in the polynomial(s).

What should the name of this version be?
JAA thinks something of the form IndetsXYZ; but should XYZ be? A possibility is IndetSupport; in that "support" of any sparse structure is the "list" of the parts actually appearing. Anna thinks IndetsIn might still be OK. Anna also suggested IndetsProd; this is accurate, but it is hard to guess what the fn does just from its name.

The version proposed by Anna produces a value which is the radical of the product of the supports, or the radical of the "top" (lcm) of the supports. But it seems hard to produce a reasonably short name which is comprehensible (and captures this fact).

#21 Updated by John Abbott about 4 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 70 to 100
  • Estimated time changed from 3.99 h to 4.66 h

Implemented IndetsProd -- advantage is that it gives same interface in CoCoALib as in CoCoA-5. IndetsIn is also available in CoCoALib.

Added doc, example, test(?)

Also available in: Atom PDF