Changeset 4cb74e in git


Ignore:
Timestamp:
May 5, 2023, 1:59:17 PM (12 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
098b1e2c086aa89e01d5f7984f9c67c3708320e4
Parents:
d891c5fb7848eaccdb188900d38e88c00cfaae1a
Message:
2 algorithm for Hilbert series, check degree
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/combinatorics/hilb.cc

    rd891c5 r4cb74e  
    20502050intvec* hFirstSeries(ideal A,intvec *module_w,ideal Q, intvec *wdegree)
    20512051{
    2052   void (*WerrorS_save)(const char *s) = WerrorS_callback;
    2053   WerrorS_callback=WerrorS_dummy;
    2054   intvec* res=hFirstSeries1(A,module_w,Q,wdegree);
    2055   WerrorS_callback=WerrorS_save;
    2056   if (errorreported==0)
    2057   {
    2058     return res;
    2059   }
    2060   else errorreported=0;// retry with other alg.:
     2052  // find degree bound
     2053  int a,b,prod;
     2054  a=rVar(currRing);
     2055  b=1;
     2056  prod=a;
     2057  while(prod<(1<<15) && (a>1))
     2058  {
     2059    a--;b++;
     2060    prod*=a;
     2061    prod/=b;
     2062  }
     2063  if (a==1) b=(1<<15);
     2064  // check degree bound
     2065  BOOLEAN large_deg=FALSE;
     2066  int max=0;
     2067  for(int i=IDELEMS(A)-1;i>=0;i--)
     2068  {
     2069    if (A->m[i]!=NULL)
     2070    {
     2071      int mm=p_Totaldegree(A->m[i],currRing);
     2072      if (mm>max)
     2073      {
     2074        max=mm;
     2075        if (max>=b)
     2076        {
     2077          large_deg=TRUE;
     2078          break;
     2079        }
     2080      }
     2081    }
     2082  }
     2083  intvec* res;
     2084  if (!large_deg)
     2085  {
     2086    void (*WerrorS_save)(const char *s) = WerrorS_callback;
     2087    WerrorS_callback=WerrorS_dummy;
     2088    res=hFirstSeries1(A,module_w,Q,wdegree);
     2089    WerrorS_callback=WerrorS_save;
     2090    if (errorreported==0)
     2091    {
     2092      return res;
     2093    }
     2094    else errorreported=0;// retry with other alg.:
     2095  }
    20612096
    20622097  static ring hilb_Qt=NULL;
Note: See TracChangeset for help on using the changeset viewer.