Changeset 6fe9a5 in git for Singular/LIB/bfun.lib
- Timestamp:
- Mar 18, 2011, 9:12:17 PM (12 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 3542f7c7fb52228c2cae41980c84109e503eaf75
- Parents:
- 19ad27804d6e9c1c16eb3b3f560ad543ea06b922
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/bfun.lib
r19ad278 r6fe9a5 75 75 - fixed printlevel/debug message issue in bfct, bfctAnn 76 76 - fixed small issue for zero ideal input in linReduceIdeal 77 78 16.03.11 79 - fixed bug in linReduceIdeal when ideal contained unlucky constellation 80 of zeros 81 - fixed printlevel/debug message issue in linReduceIdeal 77 82 */ 78 83 … … 253 258 254 259 //-------------- main procedures ------------------------------------------------------- 260 255 261 proc linReduceIdeal(ideal I, list #) 256 262 "USAGE: linReduceIdeal(I [,s,t,u]); I an ideal, s,t,u optional ints … … 301 307 int sI = ncols(I); 302 308 int sZeros = sI - size(I); 303 int i,j ;309 int i,j,k; 304 310 ideal J,lmJ,ordJ; 305 311 list lJ = sort(I); 312 intvec iv,iv2; //todo 306 313 module M; // for the coefficients 307 314 // step 1: prepare, e.g. sort I … … 312 319 if (remembercoeffs <> 0) 313 320 { 314 j = 0; 315 for (i=1; i<=sI; i++) 316 { 317 if (I[i] == 0) 321 j = 0; 322 k = 0; 323 intvec posNonZero; 324 for (i=1; i<=sI; i++) 325 { 326 if (I[i] == 0) 318 327 { 319 328 j++; … … 322 331 M[j] = gen(i); 323 332 } 324 else 325 { 326 M[i+sZeros-j] = gen(lJ[2][i-j]+j); 327 } 328 } 333 else 334 { 335 k++; 336 M[k+sZeros] = gen(lJ[2][k]); 337 posNonZero = posNonZero,i; 338 } 339 } 340 posNonZero = posNonZero[2..nrows(posNonZero)]; 341 posNonZero = posNonZero[lJ[2]]; 342 for (i=1; i<=size(lJ[1]); i++) 343 { 344 M[i+sZeros] = gen(posNonZero[i]); 345 } 346 kill posNonZero; 329 347 } 330 348 else … … 343 361 if (remembercoeffs <> 0) 344 362 { 345 for (i=1; i<=size(lJ[1]); i++) { M[i +sZeros] = gen(lJ[2][i]); }363 for (i=1; i<=size(lJ[1]); i++) { M[i] = gen(lJ[2][i]); } 346 364 } 347 365 } … … 354 372 } 355 373 } 356 dbprint(ppl -1,"// initially sorted ideal:", I);357 if (remembercoeffs <> 0) { dbprint(ppl -1,"// used permutations:", M); }374 dbprint(ppl,"// initially sorted ideal:", I); 375 if (remembercoeffs <> 0) { dbprint(ppl,"// used permutations:", M); } 358 376 // step 2: reduce leading monomials by linear reductions 359 377 poly lm,c,redpoly,maxlmJ; … … 385 403 if (lm == lmJ[j]) 386 404 { 387 405 dbprint(ppl-1,"// reducing " + string(redpoly)); 388 406 dbprint(ppl-1,"// with " + string(J[j])); 389 407 c = leadcoef(redpoly)/leadcoef(J[j]); … … 420 438 dbprint(ppl-1,string(J)); 421 439 if (remembercoeffs <> 0) { dbprint(ppl-1,"// used reductions:" + string(M)); } 422 int k;423 440 for (i=sZeros+1; i<=sI; i++) 424 441 {
Note: See TracChangeset
for help on using the changeset viewer.