Changeset e5c9e5 in git for libpolys/polys/monomials/p_polys.cc
 Timestamp:
 Mar 5, 2013, 4:43:58 PM (10 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '1d362c315e551a5b527ab0759f8839cf0e94f3a5')
 Children:
 803cb2d20d4037b513adf020767d48f6893fc9a2
 Parents:
 161e20729b9213f0aaa51ebeacdbd63260916ff6
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

libpolys/polys/monomials/p_polys.cc
r161e20 re5c9e5 2061 2061 assume( pNext(ph) != NULL ); 2062 2062 #if CLEARENUMERATORS 2063 if( nCoeff_is_Q(r>cf)  nCoeff_is_Q_a(r>cf))2063 if( nCoeff_is_Q(r>cf) ) 2064 2064 { 2065 2065 // experimentall (recursive enumerator treatment) of alg. Ext! … … 2111 2111 // StringSetS("** div0:");nWrite(pGetCoeff(p));StringAppendS("/"); 2112 2112 // nWrite(h);StringAppendS("=");nWrite(d);StringAppendS(" int:"); 2113 // nWrite(tmp);Print(StringEndS("\n")); // NOTE/TODO: use StringAppendS("\n"); omFree(s); 2113 // nWrite(tmp);Print(StringEndS("\n")); // NOTE/TODO: use StringAppendS("\n"); omFree(s); 2114 2114 //} 2115 2115 //nDelete(&tmp); … … 2424 2424 // StringSetS("** div0:");nWrite(pGetCoeff(p));StringAppendS("/"); 2425 2425 // nWrite(h);StringAppendS("=");nWrite(d);StringAppendS(" int:"); 2426 // nWrite(tmp);Print(StringEndS("\n")); // NOTE/TODO: use StringAppendS("\n"); omFree(s); 2426 // nWrite(tmp);Print(StringEndS("\n")); // NOTE/TODO: use StringAppendS("\n"); omFree(s); 2427 2427 //} 2428 2428 //nDelete(&tmp); … … 2445 2445 /* */ 2446 2446 /* cleardenom suff */ 2447 poly p_Cleardenom(poly p h, const ring r)2448 { 2449 if( p h== NULL )2447 poly p_Cleardenom(poly p, const ring r) 2448 { 2449 if( p == NULL ) 2450 2450 return NULL; 2451 2451 … … 2455 2455 if( 0 ) 2456 2456 { 2457 CPolyCoeffsEnumerator itr(p h);2457 CPolyCoeffsEnumerator itr(p); 2458 2458 2459 2459 n_ClearDenominators(itr, C); … … 2461 2461 n_ClearContent(itr, C); // divide out the content 2462 2462 2463 p_Test(p h, r); n_Test(pGetCoeff(ph), C);2464 assume(n_GreaterZero(pGetCoeff(p h), C)); // ??2465 // if(!n_GreaterZero(pGetCoeff(p h),C)) ph = p_Neg(ph,r);2466 2467 return p h;2468 } 2469 #endif 2470 2471 poly start=p h;2463 p_Test(p, r); n_Test(pGetCoeff(p), C); 2464 assume(n_GreaterZero(pGetCoeff(p), C)); // ?? 2465 // if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r); 2466 2467 return p; 2468 } 2469 #endif 2470 2471 poly start=p; 2472 2472 2473 2473 number d, h; 2474 poly p;2475 2474 2476 2475 #ifdef HAVE_RINGS 2477 2476 if (rField_is_Ring(r)) 2478 2477 { 2479 p_Content(p h,r);2480 assume( n_GreaterZero(pGetCoeff(p h),C) );2481 if(!n_GreaterZero(pGetCoeff(p h),C)) ph = p_Neg(ph,r);2478 p_Content(p,r); 2479 assume( n_GreaterZero(pGetCoeff(p),C) ); 2480 if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r); 2482 2481 return start; 2483 2482 } … … 2486 2485 if (rField_is_Zp(r) && TEST_OPT_INTSTRATEGY) 2487 2486 { 2488 if(!n_GreaterZero(pGetCoeff(p h),C)) ph = p_Neg(ph,r);2487 if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r); 2489 2488 return start; 2490 2489 } 2491 p = ph;2492 2490 2493 2491 assume(p != NULL); … … 2511 2509 p_SetCoeff(p,n_Init(1,r>cf),r); 2512 2510 2513 assume( n_GreaterZero(pGetCoeff(p h),C) );2514 if(!n_GreaterZero(pGetCoeff(p h),C)) ph = p_Neg(ph,r);2511 assume( n_GreaterZero(pGetCoeff(p),C) ); 2512 if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r); 2515 2513 2516 2514 return start; … … 2521 2519 #if 0 && CLEARENUMERATORS 2522 2520 //CF: does not seem to work that well.. 2523 2521 2524 2522 if( nCoeff_is_Q(C)  nCoeff_is_Q_a(C) ) 2525 2523 { 2526 CPolyCoeffsEnumerator itr(p h);2524 CPolyCoeffsEnumerator itr(p); 2527 2525 2528 2526 n_ClearDenominators(itr, C); … … 2530 2528 n_ClearContent(itr, C); // divide out the content 2531 2529 2532 p_Test(p h, r); n_Test(pGetCoeff(ph), C);2533 assume(n_GreaterZero(pGetCoeff(p h), C)); // ??2534 // if(!n_GreaterZero(pGetCoeff(p h),C)) ph = p_Neg(ph,r);2530 p_Test(p, r); n_Test(pGetCoeff(p), C); 2531 assume(n_GreaterZero(pGetCoeff(p), C)); // ?? 2532 // if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r); 2535 2533 2536 2534 return start; … … 2552 2550 if(!n_IsOne(h,r>cf)) 2553 2551 { 2554 p = ph;2552 p = start; 2555 2553 while (p!=NULL) 2556 2554 { … … 2572 2570 } 2573 2571 n_Delete(&h,r>cf); 2574 if (n_GetChar(r>cf)==1)2575 {2576 loop2577 {2578 h = n_Init(1,r>cf);2579 p=ph;2580 while (p!=NULL)2581 {2582 d=n_Lcm(h,pGetCoeff(p),r>cf);2583 n_Delete(&h,r>cf);2584 h=d;2585 pIter(p);2586 }2587 /* contains the 1/lcm of all denominators */2588 if(!n_IsOne(h,r>cf))2589 {2590 p = ph;2591 while (p!=NULL)2592 {2593 /* should be:2594 * number hh;2595 * nGetDenom(p>coef,&hh);2596 * nMult(&h,&hh,&d);2597 * nNormalize(d);2598 * nDelete(&hh);2599 * nMult(d,p>coef,&hh);2600 * nDelete(&d);2601 * nDelete(&(p>coef));2602 * p>coef =hh;2603 */2604 d=n_Mult(h,pGetCoeff(p),r>cf);2605 n_Normalize(d,r>cf);2606 p_SetCoeff(p,d,r);2607 pIter(p);2608 }2609 n_Delete(&h,r>cf);2610 }2611 else2612 {2613 n_Delete(&h,r>cf);2614 break;2615 }2616 }2617 }2618 2572 } 2619 2573 if (h!=NULL) n_Delete(&h,r>cf); 2620 2621 p_Content(ph,r); 2574 p=start; 2575 2576 p_Content(p,r); 2622 2577 #ifdef HAVE_RATGRING 2623 2578 if (rIsRatGRing(r)) 2624 2579 { 2625 2580 /* quick unit detection in the rational case is done in gr_nc_bba */ 2626 pContentRat(p h);2627 start=p h;2628 } 2629 #endif 2630 } 2631 2632 assume( n_GreaterZero(pGetCoeff(p h),C) );2633 if(!n_GreaterZero(pGetCoeff(p h),C)) ph = p_Neg(ph,r);2581 pContentRat(p); 2582 start=p; 2583 } 2584 #endif 2585 } 2586 2587 assume( n_GreaterZero(pGetCoeff(p),C) ); 2588 if(!n_GreaterZero(pGetCoeff(p),C)) p = p_Neg(p,r); 2634 2589 2635 2590 return start; … … 2844 2799 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2845 2800 if(!n_GreaterZero(pGetCoeff(ph),C)) ph = p_Neg(ph,r); 2846 return; 2801 return; 2847 2802 } 2848 2803 p = ph;
Note: See TracChangeset
for help on using the changeset viewer.