| 13 | STATIC_INST_VAR ideal zero_ideal; |
| 14 | |
| 15 | void bit_reduce(poly & f,ring r) |
| 16 | { |
| 17 | poly p=f; |
| 18 | kBucket_pt erg_bucket= kBucketCreate(r); |
| 19 | kBucketInit(erg_bucket,NULL,0 /*pLength(P.p)*/); |
| 20 | while(p) |
| 21 | { |
| 22 | poly next=pNext(p); |
| 23 | pNext(p)=NULL; |
| 24 | |
| 25 | int i; |
| 26 | int max=rVar(r); |
| 27 | for(i=1;i<=max;i++) |
| 28 | { |
| 29 | unsigned long exp=p_GetExp(p,i,r); |
| 30 | if(exp!=0) |
| 31 | p_SetExp(p,i,1,r); |
| 32 | |
| 33 | } |
| 34 | p_Setm(p,r); |
| 35 | int pseudo_len=0; |
| 36 | kBucket_Add_q(erg_bucket,p,&pseudo_len); |
| 37 | p=next; |
| 38 | } |
| 39 | |
| 40 | int len=0; |
| 41 | poly erg; |
| 42 | kBucketClear(erg_bucket,&erg, &len); |
| 43 | kBucketDestroy(&erg_bucket); |
| 44 | f=erg; |
| 45 | } |
| 46 | |
| 47 | poly uni_subst_bits(poly outer_uni, poly inner_multi, ring r) |
| 48 | { |
no test coverage detected