| 2165 | } |
| 2166 | |
| 2167 | intvec* hFirstSeries(ideal A,intvec *module_w,ideal Q, intvec *wdegree) |
| 2168 | { |
| 2169 | intvec* res; |
| 2170 | #if 0 |
| 2171 | // find degree bound |
| 2172 | int a,b,prod; |
| 2173 | a=rVar(currRing); |
| 2174 | b=1; |
| 2175 | prod=a; |
| 2176 | while(prod<(1<<15) && (a>1)) |
| 2177 | { |
| 2178 | a--;b++; |
| 2179 | prod*=a; |
| 2180 | prod/=b; |
| 2181 | } |
| 2182 | if (a==1) b=(1<<15); |
| 2183 | // check degree bound |
| 2184 | BOOLEAN large_deg=FALSE; |
| 2185 | int max=0; |
| 2186 | for(int i=IDELEMS(A)-1;i>=0;i--) |
| 2187 | { |
| 2188 | if (A->m[i]!=NULL) |
| 2189 | { |
| 2190 | int mm=p_Totaldegree(A->m[i],currRing); |
| 2191 | if (mm>max) |
| 2192 | { |
| 2193 | max=mm; |
| 2194 | if (max>=b) |
| 2195 | { |
| 2196 | large_deg=TRUE; |
| 2197 | break; |
| 2198 | } |
| 2199 | } |
| 2200 | } |
| 2201 | } |
| 2202 | if (!large_deg) |
| 2203 | { |
| 2204 | void (*WerrorS_save)(const char *s) = WerrorS_callback; |
| 2205 | WerrorS_callback=WerrorS_dummy; |
| 2206 | res=hFirstSeries1(A,module_w,Q,wdegree); |
| 2207 | WerrorS_callback=WerrorS_save; |
| 2208 | if (errorreported==0) |
| 2209 | { |
| 2210 | return res; |
| 2211 | } |
| 2212 | else errorreported=0;// retry with other alg.: |
| 2213 | } |
| 2214 | #endif |
| 2215 | |
| 2216 | if (hilb_Qt==NULL) hilb_Qt=makeQt(); |
| 2217 | if (!isModule(A,currRing)) |
| 2218 | return hFirstSeries0(A,Q,wdegree,currRing,hilb_Qt); |
| 2219 | res=NULL; |
| 2220 | int w_max=0,w_min=0; |
| 2221 | if (module_w!=NULL) |
| 2222 | { |
| 2223 | w_max=module_w->max_in(); |
| 2224 | w_min=module_w->min_in(); |
no test coverage detected