Slug #1739
IsHomog for ideals
Description
the function IsHomog for ideals might take a long time computing a GBasis, but if
the check IsHomog(gens(I))
gives true, it should immediately return true without further computations.
Related issues
History
#1 Updated by John Abbott 3 months ago
- Target version changed from CoCoALib-0.99800 to CoCoALib-0.99850
This should be easy to implement, right?
I was wondering how often one would want to know whether an ideal is homog without shortly afterwards wanting a GBasis?
I presume that if the ideal is not homog then one must compute the GBasis, right?
#2 Updated by John Abbott 3 months ago
- Status changed from New to In Progress
I say impl the suggestion in the main description: it should be very little code, and may make some computations faster.
Are there any other short-cuts?
If IsZeroDim(I)
then it is not homog. I can think of other possible short-cuts, but would they ever be applicable? For instance, if there is a non-homog generator using indets x[1],...,x[n]
and all other gens use only other indets... How often does this happen?
reply IsZeroDim(I)
requires a GBasis, so it's not a real shortcut.
#3 Updated by John Abbott 3 months ago
Source is in SparsePolyOps-ideal.C:908
more or less
#4 Updated by John Abbott 3 months ago
Could it be useful to have also IsHomog3
which returns a bool3
?
#5 Updated by Anna Maria Bigatti 3 months ago
Fixed. Now checking if gens are monomial, then if gens are homogeneous.
/**/ use R ::= QQ[a,b,c,d,e,f]; /**/ L := monomials(sum(indets(R))^25); len(L); 142506 /**/ IL := ideal(L); t0 := CpuTime(); IsHomog(IL); TimeFrom(t0); -- monomial gens true 0.003 /**/ L[len(L)] := a+b; /**/ IL := ideal(L); t0 := CpuTime(); IsHomog(IL); TimeFrom(t0); -- last gen non monomial true 0.028 /**/ IL := ideal(L); t0 := CpuTime(); GB := GBasis(IL); TimeFrom(t0); --> very long time
#6 Updated by Anna Maria Bigatti 2 months ago
- Status changed from In Progress to Resolved
- % Done changed from 10 to 80
check if there is a "homog" flag to be set
#7 Updated by Anna Maria Bigatti about 2 months ago
- Related to Feature #1784: Add flag IhaveHomogGensValue for ideals in SparsePolyRing? added
#8 Updated by Anna Maria Bigatti about 2 months ago
#9 Updated by Anna Maria Bigatti about 2 months ago
John Abbott wrote:
Could it be useful to have also
IsHomog3(I)
which returns abool3
?
it could be handy to have a function: it is not entirely trivial to write a quick check on the generators, if one needs it.
On the other hand, it is useful anywhere?
Usual philosophical question: it is good to add functions whose utility is uncertain?
I'm inclined to postpone this into a new issue.
#10 Updated by Anna Maria Bigatti about 2 months ago
- Related to Feature #1785: Add function IsHomog3(I)? added
#11 Updated by Anna Maria Bigatti about 2 months ago
- Status changed from Resolved to Closed
- % Done changed from 80 to 100
- Estimated time changed from 1.00 h to 2.01 h