Changeset f93c5e9 in git
- Timestamp:
- Feb 29, 2012, 7:49:42 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- ece1ce5f2a8a9e000496d4f95d697f07df0551e6
- Parents:
- 8d8cd944663cf80b3fd163a42279526ce163a5fd
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ipshell.cc
r8d8cd94 rf93c5e9 1863 1863 iv=new intvec(1); 1864 1864 (*iv)[0] = s; 1865 } else 1866 if (r->block1[i]-r->block0[i] >=0 ) 1867 { 1868 j=r->block1[i]-r->block0[i]; 1869 if (r->order[i]==ringorder_M) j=(j+1)*(j+1)-1; 1865 } 1866 else if (r->block1[i]-r->block0[i] >=0 ) 1867 { 1868 int bl=j=r->block1[i]-r->block0[i]; 1869 if (r->order[i]==ringorder_M) 1870 { 1871 j=(j+1)*(j+1)-1; 1872 bl=j+1; 1873 } 1874 else if (r->order[i]==ringorder_am) 1875 { 1876 j+=r->wvhdl[i][bl+1]; 1877 } 1870 1878 iv=new intvec(j+1); 1871 1879 if ((r->wvhdl!=NULL) && (r->wvhdl[i]!=NULL)) 1872 1880 { 1873 for(;j>=0; j--) (*iv)[j]=r->wvhdl[i][j ];1881 for(;j>=0; j--) (*iv)[j]=r->wvhdl[i][j+(j>bl)]; 1874 1882 } 1875 1883 else switch (r->order[i]) … … 4460 4468 4461 4469 uResultant::resMatType mtype= determineMType( imtype ); 4462 int i,c ,count;4470 int i,count; 4463 4471 lists listofroots= NULL; 4464 4472 number smv= NULL; … … 4517 4525 4518 4526 #ifdef mprDEBUG_PROT 4519 c= iproots[0]->getAnzElems();4527 int c= iproots[0]->getAnzElems(); 4520 4528 for (i=0; i < c; i++) pWrite(iproots[i]->getPoly()); 4521 4529 c= muiproots[0]->getAnzElems(); … … 4661 4669 } 4662 4670 else if (((*iv)[1]!=ringorder_a) 4663 && ((*iv)[1]!=ringorder_a64)) 4671 && ((*iv)[1]!=ringorder_a64) 4672 && ((*iv)[1]!=ringorder_am)) 4664 4673 o++; 4665 4674 n++; … … 4805 4814 break; 4806 4815 } 4816 case ringorder_am: 4817 { 4818 R->block0[n] = last+1; 4819 R->block1[n] = si_min(last+iv->length()-2 , rVar(R)); 4820 R->wvhdl[n] = (int*)omAlloc(iv->length()*sizeof(int)); 4821 if (R->block1[n]- R->block0[n]+2>=iv->length()) 4822 WarnS("missing module weights"); 4823 for (i=2; i<=(R->block1[n]-R->block0[n]+2); i++) 4824 { 4825 R->wvhdl[n][i-2]=(*iv)[i]; 4826 last++; 4827 if (weights[last]==0) weights[last]=(*iv)[i]*typ; 4828 } 4829 R->wvhdl[n][i-2]=iv->length() -3 -(R->block1[n]- R->block0[n]); 4830 for (; i<iv->length(); i++) 4831 { 4832 R->wvhdl[n][i-1]=(*iv)[i]; 4833 } 4834 last=R->block0[n]-1; 4835 break; 4836 } 4807 4837 case ringorder_a64: 4808 4838 { -
libpolys/polys/monomials/p_polys.cc
r8d8cd94 rf93c5e9 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id$10 9 *******************************************************************/ 11 10 … … 119 118 #endif 120 119 p->exp[o->data.wp.place]=ord; 120 break; 121 } 122 case ro_am: 123 { 124 ord=POLY_NEGWEIGHT_OFFSET; 125 int a,e; 126 a=o->data.am.start; 127 e=o->data.am.end; 128 int *w=o->data.am.weights; 129 #if 1 130 for(int i=a;i<=e;i++) ord+=p_GetExp(p,i,r)*w[i-a]; 131 int c=p_GetComp(p,r); 132 #else 133 long ai; 134 int ei,wi; 135 for(int i=a;i<=e;i++) 136 { 137 ei=p_GetExp(p,i,r); 138 wi=w[i-a]; 139 ai=ei*wi; 140 if (ai/ei!=wi) pSetm_error=TRUE; 141 ord+=ai; 142 if (ord<ai) pSetm_error=TRUE; 143 } 144 #endif 145 if ((c>0)&&(c<=o->data.am.len_gen)) 146 { 147 ord+=w[c-(e-a)+2]; 148 } 149 p->exp[o->data.am.place]=ord; 121 150 break; 122 151 } … … 205 234 const short place = o->data.syz.place; 206 235 const int limit = o->data.syz.limit; 207 236 208 237 if (c > limit) 209 238 p->exp[place] = o->data.syz.curr_index; … … 319 348 #ifndef NDEBUG 320 349 #if MYTEST 321 Print("Respective F[c - %d: %d] pp: ", limit, c); 350 Print("Respective F[c - %d: %d] pp: ", limit, c); 322 351 p_DebugPrint(pp, r, r, 1); 323 352 #endif … … 329 358 330 359 331 // const int st = o->data.isTemp.start;360 // const int st = o->data.isTemp.start; 332 361 333 362 #ifndef NDEBUG … … 372 401 { 373 402 p->exp[start] = 0; //!!!!????? where????? 374 403 375 404 const int* const pVarOffset = o->data.is.pVarOffset; 376 405 … … 488 517 p_LmCheckPolyRing(p, r); 489 518 int i, k; 490 int pIS = 0; 519 int pIS = 0; 491 520 long j =0; 492 521 … … 551 580 break; 552 581 553 // only prefix adds the weight... 582 // only prefix adds the weight... 554 583 555 584 if( (k = p_GetComp(p, r)) == 0 ) … … 557 586 558 587 const int ord_pos = rGetISPos(pIS++, r); 559 588 560 589 const intvec* componentWeights = r->typ[ord_pos].data.is.componentWeights; 561 590 562 591 if( componentWeights == NULL ) 563 592 break; 564 593 565 594 const int limit = r->typ[ord_pos].data.is.limit; 566 595 assume( limit >= 0 ); 567 596 568 597 if( k > limit ) 569 598 { 570 599 k -= (limit + 1); 571 600 assume( k >= 0 ); 572 601 573 602 assume( componentWeights != NULL ); 574 603 575 604 if( k < componentWeights->length() ) 576 605 j += (*componentWeights)[k]; // j += the weight of k^th-component … … 623 652 const int limit = r->typ[pos].data.is.limit; 624 653 assume( limit >= 0 ); 625 654 626 655 627 656 if( k > limit ) … … 1560 1589 assume(divisor != NULL); 1561 1590 if (p == NULL) return NULL; 1562 1591 1563 1592 poly result = NULL; 1564 1593 number divisorLC = p_GetCoeff(divisor, r); … … 1634 1663 { 1635 1664 assume((p != NULL) || (q != NULL)); 1636 1665 1637 1666 poly a = p; poly b = q; 1638 1667 if (p_Deg(a, r) < p_Deg(b, r)) { a = q; b = p; } … … 1678 1707 poly p_ExtGcd(poly p, poly &pFactor, poly q, poly &qFactor, ring r) 1679 1708 { 1680 assume((p != NULL) || (q != NULL)); 1709 assume((p != NULL) || (q != NULL)); 1681 1710 poly a = p; poly b = q; BOOLEAN aCorrespondsToP = TRUE; 1682 1711 if (p_Deg(a, r) < p_Deg(b, r)) … … 2228 2257 } 2229 2258 2230 2259 2231 2260 poly p=ph; 2232 2261 number h=d; … … 3405 3434 3406 3435 /*2 3407 * returns a re-ordered convertion of a number as a polynomial, 3436 * returns a re-ordered convertion of a number as a polynomial, 3408 3437 * with permutation of parameters 3409 3438 * NOTE: this only works for Frank's alg. & trans. fields … … 3421 3450 n_Delete(&zz, src->cf); 3422 3451 } 3423 3452 3424 3453 PrintS("\nDestination Ring: \n"); 3425 3454 rWrite(dst); 3426 3455 3427 3456 Print("\nOldPar: %d\n", OldPar); 3428 3457 for( int i = 1; i <= OldPar; i++ ) … … 3433 3462 if( z == NULL ) 3434 3463 return NULL; 3435 3464 3436 3465 const coeffs srcCf = src->cf; 3437 3466 assume( srcCf != NULL ); … … 3439 3468 assume( !nCoeff_is_GF(srcCf) ); 3440 3469 assume( rField_is_Extension(src) ); 3441 3470 3442 3471 poly zz = NULL; 3443 3472 3444 3473 const ring srcExtRing = srcCf->extRing; 3445 3474 assume( srcExtRing != NULL ); 3446 3475 3447 3476 const coeffs dstCf = dst->cf; 3448 3477 assume( dstCf != NULL ); … … 3454 3483 if( zz == NULL ) 3455 3484 return NULL; 3456 3457 } else if (nCoeff_is_transExt(srcCf)) 3458 { 3485 3486 } else if (nCoeff_is_transExt(srcCf)) 3487 { 3459 3488 assume( !IS0(z) ); 3460 3489 3461 3490 zz = NUM(z); 3462 3491 p_Test (zz, srcExtRing); 3463 3492 3464 3493 if( zz == NULL ) 3465 3494 return NULL; 3466 3495 3467 3496 if( !DENIS1(z) ) 3468 3497 WarnS("Not implemented yet: Cannot permute a rational fraction and make a polynomial out of it! Ignorring the denumerator."); 3469 3498 } else 3470 3499 { 3471 3472 3473 3500 assume (FALSE); 3501 Werror("Number permutation is not implemented for this data yet!"); 3502 return NULL; 3474 3503 } 3475 3504 3476 3505 assume( zz != NULL ); 3477 3506 p_Test (zz, srcExtRing); 3478 3507 3479 3508 3480 3509 nMapFunc nMap = n_SetMap(srcExtRing->cf, dstCf); 3481 3510 3482 3511 assume( nMap != NULL ); 3483 3512 3484 3513 poly qq = p_PermPoly(zz, par_perm - 1, srcExtRing, dst, nMap, NULL, rVar(srcExtRing) ); 3485 3514 // poly p_PermPoly (poly p, int * perm, const ring oldRing, const ring dst, nMapFunc nMap, int *par_perm, int OldPar) 3486 3515 3487 3516 // assume( FALSE ); WarnS("longalg missing 2"); 3488 3517 3489 3518 return qq; 3490 3519 } … … 3501 3530 PrintS("\np_PermPoly::p: "); p_Write(p, oldRing, oldRing); PrintLn(); 3502 3531 #endif 3503 3532 3504 3533 const int OldpVariables = rVar(oldRing); 3505 3534 poly result = NULL; … … 3516 3545 assume( nMap != NULL ); 3517 3546 number n = nMap(p_GetCoeff(p, oldRing), oldRing->cf, dst->cf); 3518 3547 3519 3548 if ( (!rMinpolyIsNULL(dst)) && (rField_is_Zp_a(dst) || rField_is_Q_a(dst)) ) 3520 3549 n_Normalize(n, dst->cf); 3521 3550 3522 3551 p_GetCoeff(qq, dst) = n; 3523 // coef may be zero: 3552 // coef may be zero: 3524 3553 p_Test(qq, dst); 3525 3554 } 3526 3555 else 3527 3556 { 3528 qq = p_One(dst); 3557 qq = p_One(dst); 3529 3558 3530 3559 // aq = naPermNumber(p_GetCoeff(p, oldRing), par_perm, OldPar, oldRing); // no dst??? … … 3533 3562 3534 3563 p_Test(aq, dst); 3535 3564 3536 3565 if ( (!rMinpolyIsNULL(dst)) && (rField_is_Zp_a(dst) || rField_is_Q_a(dst)) ) 3537 3566 { 3538 3567 p_Normalize(aq,dst); 3539 3568 3540 3569 } 3541 3570 if (aq == NULL) 3542 3543 3571 p_SetCoeff(qq, n_Init(0, dst->cf),dst); // Very dirty trick!!! 3572 3544 3573 p_Test(aq, dst); 3545 3574 } 3546 3547 if (rRing_has_Comp(dst)) 3575 3576 if (rRing_has_Comp(dst)) 3548 3577 p_SetComp(qq, p_GetComp(p, oldRing), dst); 3549 3578 … … 3552 3581 p_LmDelete(&qq,dst); 3553 3582 qq = NULL; 3554 } 3583 } 3555 3584 else 3556 3585 { … … 3571 3600 if (rField_is_GF(dst)) 3572 3601 { 3573 3602 assume( dst->cf->extRing == NULL ); 3574 3603 number ee = nfPar(1, dst->cf); // NOTE: using nfPar is a BAD thing to do... 3575 3604 3576 3577 3578 3605 number eee; 3606 n_Power(ee, e, &eee, dst->cf); //nfDelete(ee,dst); 3607 3579 3608 ee = n_Mult(c, eee, dst->cf); 3580 3609 //nfDelete(c,dst);nfDelete(eee,dst); … … 3583 3612 else if (nCoeff_is_Extension(dst->cf)) 3584 3613 { 3585 3586 3614 const int par = -perm[i]; 3615 assume( par > 0 ); 3587 3616 3588 3617 // WarnS("longalg missing 3"); 3589 3618 #if 1 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3619 const coeffs C = dst->cf; 3620 assume( C != NULL ); 3621 3622 const ring R = C->extRing; 3623 assume( R != NULL ); 3624 3625 assume( par <= rVar(R) ); 3626 3627 poly pcn; // = (number)c 3628 3629 assume( !n_IsZero(c, C) ); 3630 3631 if( nCoeff_is_algExt(C) ) 3632 pcn = (poly) c; 3633 else // nCoeff_is_transExt(C) 3634 pcn = NUM(c); 3635 3607 3636 if (pNext(pcn) == NULL) // c->z 3608 3637 p_AddExp(pcn, -perm[i], e, R); … … 3612 3641 p_SetExp(mmc, -perm[i], e, R); 3613 3642 p_Setm(mmc, R); 3614 3615 3616 // convert back to a number: number nnc = mmc; 3617 if( nCoeff_is_algExt(C) ) 3618 3619 3620 3621 3643 3644 number nnc; 3645 // convert back to a number: number nnc = mmc; 3646 if( nCoeff_is_algExt(C) ) 3647 nnc = (number) mmc; 3648 else // nCoeff_is_transExt(C) 3649 nnc = ntInit(mmc, C); 3650 3622 3651 p_GetCoeff(qq, dst) = n_Mult((number)c, nnc, C); 3623 3652 n_Delete((number *)&c, C); 3624 3653 n_Delete((number *)&nnc, C); 3625 3654 } 3626 3655 3627 3656 mapped_to_par=1; 3628 3657 #endif … … 3645 3674 } 3646 3675 pIter(p); 3647 3676 3648 3677 #if 0 3649 3678 p_Test(aq,dst); 3650 3679 PrintS("\naq: "); p_Write(aq, dst, dst); PrintLn(); 3651 3680 #endif 3652 3681 3653 3682 3654 3683 #if 1 … … 3656 3685 { 3657 3686 p_Setm(qq,dst); 3658 3687 3659 3688 p_Test(aq,dst); 3660 3689 p_Test(qq,dst); 3661 3690 3662 3691 #if 0 3663 3692 p_Test(qq,dst); 3664 3693 PrintS("\nqq: "); p_Write(qq, dst, dst); PrintLn(); 3665 3694 #endif 3666 3667 if (aq!=NULL) 3668 3669 3695 3696 if (aq!=NULL) 3697 qq=p_Mult_q(aq,qq,dst); 3698 3670 3699 aq = qq; 3671 3700 3672 3701 while (pNext(aq) != NULL) pIter(aq); 3673 3702 3674 3703 if (result_last==NULL) 3675 3704 { … … 3688 3717 } 3689 3718 } 3690 3719 3691 3720 result=p_SortAdd(result,dst); 3692 3721 #else … … 3719 3748 #endif 3720 3749 p_Test(result,dst); 3721 3750 3722 3751 #if 0 3723 3752 p_Test(result,dst); -
libpolys/polys/monomials/ring.cc
r8d8cd94 rf93c5e9 73 73 "ws", ///< ringorder_ws, 74 74 "Ws", ///< ringorder_Ws, 75 "am", ///< ringorder_am, 75 76 "L", ///< ringorder_L, 76 77 "aa", ///< ringorder_aa … … 321 322 ||(r->order[l] == ringorder_M) 322 323 ||(r->order[l] == ringorder_a) 324 ||(r->order[l] == ringorder_am) 323 325 ||(r->order[l] == ringorder_a64) 324 326 ||(r->order[l] == ringorder_aa) ) && (r->order[l] < ringorder_IS) ) … … 355 357 if (r->order[l]!=ringorder_M) break; 356 358 } 359 if (r->order[l]==ringorder_am) /*j==0*/ 360 { 361 int m=r->wvhdl[l][i]; 362 Print("\n// : %d module weights ",m); 363 m+=i;i++; 364 for(;i<=m;i++) Print(" %*d" ,nlen,r->wvhdl[l][i]); 365 } 357 366 } 358 367 } … … 381 390 } else 382 391 PrintS(" ..."); 383 392 384 393 #if 0 /*Singularg should not differ from Singular except in error case*/ 385 394 Print("\n// noncommutative type:%d", (int)ncRingType(r)); … … 412 421 if( details ) 413 422 { 414 PrintLn(); 423 PrintLn(); 415 424 iiWriteMatrix((matrix)r->qideal,"_",1,r); 416 425 } else PrintS(" ..."); … … 1150 1159 1151 1160 nMapFunc nMap1 = n_SetMap(R1->cf,sum->cf); /* can change something global: not usable 1152 1161 after the next nSetMap call :( */ 1153 1162 // Create blocked C and D matrices: 1154 1163 for (i=1; i<= rVar(R1); i++) … … 1167 1176 1168 1177 nMapFunc nMap2 = n_SetMap(R2->cf,sum->cf); /* can change something global: not usable 1169 1178 after the next nSetMap call :( */ 1170 1179 for (i=1; i<= rVar(R2); i++) 1171 1180 for (j=i+1; j<=rVar(R2); j++) … … 1376 1385 if (r->extRing!=NULL) 1377 1386 r->extRing->ref++; 1378 1379 res->extRing=r->extRing; 1387 1388 res->extRing=r->extRing; 1380 1389 //memset: res->minideal=NULL; 1381 1390 */ 1382 1383 1391 1392 1384 1393 if (copy_ordering == TRUE) 1385 1394 { … … 1520 1529 if (r->extRing!=NULL) 1521 1530 r->extRing->ref++; 1522 1523 res->extRing=r->extRing; 1531 1532 res->extRing=r->extRing; 1524 1533 //memset: res->minideal=NULL; 1525 1534 */ 1526 1527 1535 1536 1528 1537 if (copy_ordering == TRUE) 1529 1538 { … … 1678 1687 if ( rMinpolyIsNULL(r2) ) return FALSE; 1679 1688 if (! p_EqualPolys(r1->cf->extRing->minideal->m[0], 1680 r2->cf->extRing->minideal->m[0], 1681 1689 r2->cf->extRing->minideal->m[0], 1690 r1->cf->extRing)) 1682 1691 return FALSE; 1683 1692 } … … 2193 2202 } 2194 2203 } 2204 } 2205 2206 static void rO_WMDegree(int &place, int &bitplace, int start, int end, 2207 long *o, sro_ord &ord_struct, int *weights) 2208 { 2209 // weighted degree (aligned) of variables v_start..v_end, ordsgn 1 2210 while((start<end) && (weights[0]==0)) { start++; weights++; } 2211 while((start<end) && (weights[end-start]==0)) { end--; } 2212 rO_Align(place,bitplace); 2213 ord_struct.ord_typ=ro_am; 2214 ord_struct.data.am.start=start; 2215 ord_struct.data.am.end=end; 2216 ord_struct.data.am.place=place; 2217 ord_struct.data.am.len_gen=weights[end-start+1]; 2218 ord_struct.data.am.weights=weights; 2219 o[place]=1; 2220 place++; 2221 rO_Align(place,bitplace); 2195 2222 } 2196 2223 … … 3039 3066 case ringorder_a: 3040 3067 case ringorder_aa: 3068 case ringorder_am: 3041 3069 case ringorder_a64: 3042 3070 if (r->OrdSgn==-1) r->MixedOrder=TRUE; … … 3151 3179 int** wvhdl = r->wvhdl; 3152 3180 3153 3154 3155 3181 if (order[0]==ringorder_S ||order[0]==ringorder_s || order[0]==ringorder_IS) 3156 3182 { … … 3166 3192 r->pLDeg = (r->OrdSgn == 1 ? pLDegb : pLDeg0); 3167 3193 3194 /*======== ordering type is (am,_) ==================*/ 3195 if ((order[0]==ringorder_am) 3196 ) 3197 { 3198 r->MixedOrder = FALSE; 3199 for(int ii=block0[0];ii<=block1[0];ii++) 3200 if (wvhdl[0][ii-1]<0) { r->MixedOrder=TRUE;break;} 3201 r->LexOrder=FALSE; 3202 for(int ii=block0[0];ii<=block1[0];ii++) 3203 if (wvhdl[0][ii-1]==0) { r->LexOrder=TRUE;break;} 3204 if ((block0[0]==1)&&(block1[0]==r->N)) 3205 { 3206 r->pFDeg = p_Deg; 3207 r->pLDeg = pLDeg1c_Deg; 3208 } 3209 else 3210 { 3211 r->pFDeg = p_WTotaldegree; 3212 r->LexOrder=TRUE; 3213 r->pLDeg = pLDeg1c_WFirstTotalDegree; 3214 } 3215 r->firstwv = wvhdl[0]; 3216 } 3168 3217 /*======== ordering type is (_,c) =========================*/ 3169 if ((order[0]==ringorder_unspec) || (order[1] == 0)3218 else if ((order[0]==ringorder_unspec) || (order[1] == 0) 3170 3219 ||( 3171 3220 ((order[1]==ringorder_c)||(order[1]==ringorder_C) … … 3272 3321 r->pFDeg = p_TotaldegreeIS; 3273 3322 } 3274 #ifndef NDEBUG 3323 #ifndef NDEBUG 3275 3324 else 3276 3325 assume( r->pFDeg == p_Deg || r->pFDeg == p_WTotaldegree ); 3277 3326 #endif 3278 3327 3279 3328 r->pLDeg = pLDeg1; 3280 3329 } … … 3405 3454 case ringorder_aa: 3406 3455 rO_WDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,tmp_typ[typ_i], 3456 r->wvhdl[i]); 3457 typ_i++; 3458 break; 3459 3460 case ringorder_am: 3461 rO_WMDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn,tmp_typ[typ_i], 3407 3462 r->wvhdl[i]); 3408 3463 typ_i++; … … 3543 3598 tmp_typ[typ_i]); 3544 3599 typ_i++; 3545 3600 rCheckOrdSgn(r,i); 3546 3601 } 3547 3602 } … … 3569 3624 tmp_typ[typ_i]); 3570 3625 typ_i++; 3571 3626 rCheckOrdSgn(r,i); 3572 3627 } 3573 3628 } … … 3588 3643 tmp_ordsgn, v,bits, r->block0[i]); 3589 3644 } 3590 3645 rCheckOrdSgn(r,i); 3591 3646 break; 3592 3647 … … 3600 3655 tmp_ordsgn,v, bits, r->block1[i]); 3601 3656 } 3602 3657 rCheckOrdSgn(r,i); 3603 3658 break; 3604 3659 … … 3956 4011 } 3957 4012 // corresponds to ro_typ from ring.h: 3958 const char *TYP[]={"ro_dp","ro_wp","ro_ wp64","ro_wp_neg","ro_cp",4013 const char *TYP[]={"ro_dp","ro_wp","ro_am","ro_wp64","ro_wp_neg","ro_cp", 3959 4014 "ro_syzcomp", "ro_syz", "ro_isTemp", "ro_is", "ro_none"}; 3960 4015 int i,j; … … 4027 4082 } 4028 4083 } 4084 else if (r->typ[j].ord_typ==ro_am) 4085 { 4086 Print(" place %d",r->typ[j].data.am.place); 4087 Print(" start %d",r->typ[j].data.am.start); 4088 Print(" end %d",r->typ[j].data.am.end); 4089 Print(" len_gen %d",r->typ[j].data.am.len_gen); 4090 PrintS(" w:"); 4091 int l=0; 4092 for(l=r->typ[j].data.am.start;l<=r->typ[j].data.am.end;l++) 4093 Print(" %d",r->typ[j].data.am.weights[l-r->typ[j].data.am.start]); 4094 l=r->typ[j].data.am.end+1; 4095 int ll=r->typ[j].data.am.weights[l-r->typ[j].data.am.start]; 4096 PrintS(" m:"); 4097 for(int lll=l+1;lll<l+ll+1;lll++) 4098 Print(" %d",r->typ[j].data.am.weights[lll-r->typ[j].data.am.start]); 4099 } 4029 4100 else 4030 4101 { … … 4114 4185 pFDeg_CASE(p_TotaldegreeIS); else 4115 4186 #undef pFDeg_CASE 4116 4117 4187 Print("(%p)", (void*)(r->pFDeg)); // default case 4118 4188 4119 4189 PrintLn(); 4120 Print("pLDeg : (%p)", (void*)(r->pLDeg)); 4190 Print("pLDeg : (%p)", (void*)(r->pLDeg)); 4121 4191 PrintLn(); 4122 4192 } 4123 4193 Print("pSetm:"); 4194 void p_Setm_Dummy(poly p, const ring r); 4195 void p_Setm_TotalDegree(poly p, const ring r); 4196 void p_Setm_WFirstTotalDegree(poly p, const ring r); 4197 void p_Setm_General(poly p, const ring r); 4198 if (r->p_Setm==p_Setm_General) PrintS("p_Setm_General\n"); 4199 else if (r->p_Setm==p_Setm_Dummy) PrintS("p_Setm_Dummy\n"); 4200 else if (r->p_Setm==p_Setm_TotalDegree) PrintS("p_Setm_Totaldegree\n"); 4201 else if (r->p_Setm==p_Setm_WFirstTotalDegree) PrintS("p_Setm_WFirstTotalDegree\n"); 4202 else Print("%x\n",r->p_Setm); 4124 4203 } 4125 4204 … … 4593 4672 { 4594 4673 rTest(r); 4595 4674 4596 4675 ring new_r_1 = rAssure_CompLastBlock(r, FALSE); // due to this FALSE - no completion! 4597 4676 ring new_r = rAssure_SyzComp(new_r_1, FALSE); // new_r_1 is used only here!!! … … 4599 4678 if (new_r == r) 4600 4679 return r; 4601 4680 4602 4681 ring old_r = r; 4603 4682 if (new_r_1 != new_r && new_r_1 != old_r) rDelete(new_r_1); 4604 4683 4605 4684 rComplete(new_r, 1); 4606 4685 #ifdef HAVE_PLURAL … … 4610 4689 { 4611 4690 # ifndef NDEBUG 4612 4691 WarnS("error in nc_rComplete"); // cleanup? rDelete(res); return r; // just go on...? 4613 4692 # endif 4614 4693 } 4615 4694 } 4616 4695 #endif 4617 4696 4618 4697 ///? rChangeCurrRing(new_r); 4619 4698 if (old_r->qideal != NULL) … … 4628 4707 { 4629 4708 #ifndef NDEBUG 4630 4709 WarnS("error in nc_SetupQuotient"); // cleanup? rDelete(res); return r; // just go on...? 4631 4710 #endif 4632 4711 } … … 4639 4718 assume(ncRingType(new_r) == ncRingType(old_r)); 4640 4719 #endif 4641 4720 4642 4721 rTest(new_r); 4643 4722 rTest(old_r); … … 5579 5658 5580 5659 const BOOLEAN ret = nCoeff_is_algExt(C); 5581 5660 5582 5661 if( ret ) 5583 5662 { … … 5586 5665 assume( !idIs0(R->minideal) ); 5587 5666 } 5588 5667 5589 5668 return ret; 5590 5669 } … … 5614 5693 if( _filed_type == n_algExt ) 5615 5694 return naParam(iParameter, C); 5616 5695 5617 5696 if( _filed_type == n_transExt ) 5618 5697 return ntParam(iParameter, C); 5619 5698 5620 5699 return NULL; 5621 5700 } -
libpolys/polys/monomials/ring.h
r8d8cd94 rf93c5e9 55 55 ro_dp, // ordering is a degree ordering 56 56 ro_wp, // ordering is a weighted degree ordering 57 ro_am, // ordering is am: weights for vars + weights for gen 57 58 ro_wp64, // ordering is a weighted64 degree ordering 58 59 ro_wp_neg, // ordering is a weighted degree ordering … … 86 87 87 88 // ordering is a weighted degree ordering 89 struct sro_am 90 { 91 short place; // where weighted degree is stored (in L) 92 short start; // bounds of ordering (in E) 93 short end; 94 short len_gen; // i>len_gen: weight(gen(i)):=0 95 int *weights; // pointers into wvhdl field of length (end-start+1) + len_gen 96 // contents w_1,... w_n, len, mod_w_1, .. mod_w_len, 0 97 }; 98 typedef struct sro_am sro_am; 99 100 // ordering is a weighted degree ordering 88 101 struct sro_wp64 89 102 { … … 166 179 sro_dp dp; 167 180 sro_wp wp; 181 sro_am am; 168 182 sro_wp64 wp64; 169 183 sro_cp cp; … … 600 614 ringorder_ws, 601 615 ringorder_Ws, 616 ringorder_am, 602 617 ringorder_L, 603 618 // the following are only used internally
Note: See TracChangeset
for help on using the changeset viewer.