| 248 | |
| 249 | |
| 250 | ideal Approx_Step(ideal L) |
| 251 | { |
| 252 | int N=currRing->N; |
| 253 | int i,j; // k=syzcomp |
| 254 | int flag, flagcnt=0, syzcnt=0; |
| 255 | int syzcomp = 0; |
| 256 | ideal I = kStd(L, currRing->qideal,testHomog,NULL,NULL,0,0,NULL); |
| 257 | idSkipZeroes(I); |
| 258 | ideal s_I; |
| 259 | int idI = idElem(I); |
| 260 | ideal trickyQuotient; |
| 261 | if (currRing->qideal !=NULL) |
| 262 | { |
| 263 | trickyQuotient = idSimpleAdd(currRing->qideal,I); |
| 264 | } |
| 265 | else |
| 266 | trickyQuotient = I; |
| 267 | idSkipZeroes(trickyQuotient); |
| 268 | poly *var = (poly *)omAlloc0((N+1)*sizeof(poly)); |
| 269 | // poly *W = (poly *)omAlloc0((2*N+1)*sizeof(poly)); |
| 270 | resolvente S = (resolvente)omAlloc0((N+1)*sizeof(ideal)); |
| 271 | ideal SI, res; |
| 272 | matrix MI; |
| 273 | poly x=pOne(); |
| 274 | var[0]=x; |
| 275 | ideal h2, s_h2, s_h3; |
| 276 | poly p,q; |
| 277 | // init vars |
| 278 | for (i=1; i<=N; i++ ) |
| 279 | { |
| 280 | x = pOne(); |
| 281 | pSetExp(x,i,1); |
| 282 | pSetm(x); |
| 283 | var[i]=pCopy(x); |
| 284 | } |
| 285 | // init NF's |
| 286 | for (i=1; i<=N; i++ ) |
| 287 | { |
| 288 | h2 = idInit(idI,1); |
| 289 | flag = 0; |
| 290 | for (j=0; j< idI; j++ ) |
| 291 | { |
| 292 | q = pp_Mult_mm(I->m[j],var[i],currRing); |
| 293 | q = kNF(I,currRing->qideal,q,0,0); |
| 294 | if (q!=0) |
| 295 | { |
| 296 | h2->m[j]=pCopy(q); |
| 297 | // p_Shift(&(h2->m[flag]),1, currRing); |
| 298 | flag++; |
| 299 | pDelete(&q); |
| 300 | } |
| 301 | else |
| 302 | h2->m[j]=0; |
| 303 | } |
| 304 | // W[1..IDELEMS(I)] |
| 305 | if (flag >0) |
| 306 | { |
| 307 | // compute syzygies with values in I |
no test coverage detected