Changeset 0366c4 in git
- Timestamp:
- Feb 11, 2013, 4:55:42 PM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- 066b2f73d6d0f598eb063fc56982fb77c0db67b2
- Parents:
- c462b60ab56fe1781c7f591d40ccd2799acd6c92
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/monomials/p_polys.cc
rc462b60 r0366c4 136 136 else 137 137 { 138 //Print("new mon:");pWrite(h); 138 139 p_SetCoeff(h,n,R); 139 //Print("new mon:");pWrite(h); 140 res_p=p_Add_q(res_p,h,R); 141 } 142 } 140 pNext(h)=res_p; 141 res_p=h; // building res_p in reverse order! 142 } 143 } 144 res_p=pReverse(res_p); 145 pTest(res_p); 143 146 return res_p; 144 147 } … … 234 237 235 238 const short len_gen= o->data.am.len_gen; 236 239 237 240 if ((c > 0) && (c <= len_gen)) 238 241 { … … 241 244 ord += w[c]; 242 245 } 243 246 244 247 p->exp[o->data.am.place] = ord; 245 248 break; … … 436 439 437 440 assume( c < IDELEMS(F) ); // What about others??? 438 441 439 442 const poly pp = F->m[c]; // get reference monomial!!! 440 443 441 444 if(pp == NULL) 442 445 break; 443 446 444 447 assume(pp != NULL); 445 448 … … 1571 1574 for (int i=rVar(r); i; --i) 1572 1575 p_SetExp(m,i, si_max( p_GetExp(a,i,r), p_GetExp(b,i,r)),r); 1573 1576 1574 1577 p_SetComp(m, si_max(p_GetComp(a,r), p_GetComp(b,r)),r); 1575 1578 /* Don't do a pSetm here, otherwise hres/lres chockes */ … … 1998 2001 assume( ph != NULL ); 1999 2002 2000 assume( r != NULL ); assume( r->cf != NULL ); 2003 assume( r != NULL ); assume( r->cf != NULL ); 2001 2004 2002 2005 … … 2016 2019 } 2017 2020 #endif 2018 2019 2021 2022 2020 2023 #ifdef HAVE_RINGS 2021 2024 if (rField_is_Ring(r)) … … 2064 2067 p_Test(ph, r); n_Test(pGetCoeff(ph), r->cf); 2065 2068 assume(n_GreaterZero(pGetCoeff(ph), r->cf)); // ?? 2066 2069 2067 2070 // if(!n_GreaterZero(pGetCoeff(ph),r->cf)) ph = p_Neg(ph,r); 2068 2071 return; 2069 2072 } 2070 2073 #endif 2071 2074 2072 2075 n_Normalize(pGetCoeff(ph),r->cf); 2073 2076 if(!n_GreaterZero(pGetCoeff(ph),r->cf)) ph = p_Neg(ph,r); … … 2122 2125 // } 2123 2126 #endif 2124 if (rField_is_Q_a(r)) 2127 if (rField_is_Q_a(r)) 2125 2128 { 2126 2129 // we only need special handling for alg. ext. … … 2446 2449 2447 2450 assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf; 2448 2451 2449 2452 #if CLEARENUMERATORS 2450 2453 if( 0 ) … … 2488 2491 2489 2492 assume(p != NULL); 2490 2493 2491 2494 if(pNext(p)==NULL) 2492 2495 { … … 2507 2510 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2508 2511 if(!n_GreaterZero(pGetCoeff(ph),C)) ph = p_Neg(ph,r); 2509 2512 2510 2513 return start; 2511 2514 } … … 2525 2528 assume(n_GreaterZero(pGetCoeff(ph), C)); // ?? 2526 2529 // if(!n_GreaterZero(pGetCoeff(ph),C)) ph = p_Neg(ph,r); 2527 2530 2528 2531 return start; 2529 2532 } … … 2624 2627 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2625 2628 if(!n_GreaterZero(pGetCoeff(ph),C)) ph = p_Neg(ph,r); 2626 2629 2627 2630 return start; 2628 2631 } … … 2643 2646 2644 2647 n_ClearDenominators(itr, d, C); // multiply with common denom. d 2645 n_ClearContent(itr, h, C); // divide by the content h 2646 2647 c = n_Div(d, h, C); // d/h 2648 n_ClearContent(itr, h, C); // divide by the content h 2649 2650 c = n_Div(d, h, C); // d/h 2648 2651 2649 2652 n_Delete(&d, C); … … 2664 2667 } 2665 2668 #endif 2666 2667 2669 2670 2668 2671 if( pNext(p) == NULL ) 2669 2672 { … … 2677 2680 c = n_Neg(c, C); 2678 2681 } 2679 2682 2680 2683 return; 2681 2684 } 2682 2685 2683 2686 assume( pNext(p) != NULL ); 2684 2687 2685 2688 #if CLEARENUMERATORS 2686 2689 if( nCoeff_is_Q(C) || nCoeff_is_Q_a(C) ) 2687 2690 { 2688 2691 CPolyCoeffsEnumerator itr(ph); 2689 2692 2690 2693 n_ClearDenominators(itr, d, C); // multiply with common denom. d 2691 n_ClearContent(itr, h, C); // divide by the content h 2692 2693 c = n_Div(d, h, C); // d/h 2694 n_ClearContent(itr, h, C); // divide by the content h 2695 2696 c = n_Div(d, h, C); // d/h 2694 2697 2695 2698 n_Delete(&d, C); … … 2711 2714 #endif 2712 2715 2713 2714 2716 2717 2715 2718 2716 2719 if(1) … … 2802 2805 c = n_Neg(c, C); 2803 2806 } 2804 2807 2805 2808 } 2806 2809 … … 3619 3622 assume(dst != NULL); 3620 3623 assume(dst->cf != NULL); 3621 3624 3622 3625 while (p != NULL) 3623 3626 { … … 3633 3636 3634 3637 p_GetCoeff(qq, dst) = n;// Note: n can be a ZERO!!! 3635 // coef may be zero: 3638 // coef may be zero: 3636 3639 // p_Test(qq, dst); 3637 3640 } … … 3648 3651 if ( nCoeff_is_algExt(dst->cf) ) 3649 3652 p_Normalize(aq,dst); 3650 3653 3651 3654 if (aq == NULL) 3652 3655 p_SetCoeff(qq, n_Init(0, dst->cf),dst); // Very dirty trick!!! … … 4038 4041 assume( r1 == r2 || rSamePolyRep(r1, r2) ); // will be used in rEqual! 4039 4042 assume( r1->cf == r2->cf ); 4040 4043 4041 4044 while ((p1 != NULL) && (p2 != NULL)) 4042 4045 { … … 4046 4049 if (! p_ExpVectorEqual(p1, p2, r1, r2)) 4047 4050 return FALSE; 4048 4051 4049 4052 if (! n_Equal(p_GetCoeff(p1,r1), p_GetCoeff(p2,r2), r1->cf )) 4050 4053 return FALSE; 4051 4054 4052 4055 pIter(p1); 4053 4056 pIter(p2); … … 4120 4123 { 4121 4124 a = next; 4122 next = pNext(a); 4125 next = pNext(a); 4123 4126 l++; 4124 4127 }
Note: See TracChangeset
for help on using the changeset viewer.