Changeset 8d341e in git
- Timestamp:
- Sep 10, 2012, 2:31:22 PM (12 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
- Children:
- fff61504bea4abfcad24fecfcec903e476caa188
- Parents:
- 9952bd4644408a55960f0436312937dc4ea343e8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/monomials/p_polys.cc
r9952bd r8d341e 2023 2023 static number p_InitContent(poly ph, const ring r); 2024 2024 2025 #define CLEARENUMERATORS 0 2026 2025 2027 void p_Content(poly ph, const ring r) 2026 2028 { 2027 #if 02028 if( ph != NULL)2029 #if CLEARENUMERATORS 2030 if( (ph != NULL) && nCoeff_is_Q(r->cf) ) 2029 2031 { 2030 2032 CPolyCoeffsEnumerator itr(ph); 2031 2033 n_ClearContent(itr, r->cf); 2032 // return; 2033 } 2034 #endif 2035 2036 2034 2035 assume( n_GreaterZero(pGetCoeff(ph),r->cf) ); 2036 2037 return; 2038 } 2039 #endif 2040 2037 2041 #ifdef HAVE_RINGS 2038 2042 if (rField_is_Ring(r)) … … 2053 2057 pIter(h); 2054 2058 } 2059 assume( n_GreaterZero(pGetCoeff(ph),r->cf) ); 2055 2060 } 2056 2061 n_Delete(&k,r->cf); … … 2069 2074 else 2070 2075 { 2076 #if CLEARENUMERATORS 2077 if( (ph != NULL) && nCoeff_is_Q(r->cf) ) 2078 { 2079 CPolyCoeffsEnumerator itr(ph); 2080 n_ClearContent(itr, r->cf); 2081 assume( n_GreaterZero(pGetCoeff(ph),r->cf) ); 2082 return; 2083 } 2084 #endif 2085 2071 2086 n_Normalize(pGetCoeff(ph),r->cf); 2072 2087 if(!n_GreaterZero(pGetCoeff(ph),r->cf)) ph = p_Neg(ph,r); … … 2441 2456 poly p_Cleardenom(poly ph, const ring r) 2442 2457 { 2458 const coeffs C = r->cf; 2459 2443 2460 poly start=ph; 2444 2461 2445 #if 02446 if( ph != NULL)2462 #if CLEARENUMERATORS 2463 if( (ph != NULL) && nCoeff_is_Q(C) ) 2447 2464 { 2448 2465 CPolyCoeffsEnumerator itr(ph); 2449 n_ClearDenominators(itr, r->cf); 2450 // return start; 2451 } 2452 #endif 2453 2466 n_ClearDenominators(itr, C); 2467 n_ClearContent(itr, C); // divide out the content 2468 2469 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2470 2471 return start; 2472 } 2473 #endif 2474 2454 2475 number d, h; 2455 2476 poly p; … … 2459 2480 { 2460 2481 p_Content(ph,r); 2482 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2461 2483 return start; 2462 2484 } 2463 2485 #endif 2464 if (rField_is_Zp(r) && TEST_OPT_INTSTRATEGY) return start; 2486 2487 if (rField_is_Zp(r) && TEST_OPT_INTSTRATEGY) 2488 { 2489 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2490 return start; 2491 } 2465 2492 p = ph; 2493 2494 assume(p != NULL); 2495 2466 2496 if(pNext(p)==NULL) 2467 2497 { … … 2479 2509 else 2480 2510 p_SetCoeff(p,n_Init(1,r->cf),r); 2481 } 2482 else 2511 2512 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2513 2514 return start; 2515 } 2516 2517 #if CLEARENUMERATORS 2518 if( (ph != NULL) && nCoeff_is_Q(C) ) 2519 { 2520 CPolyCoeffsEnumerator itr(ph); 2521 n_ClearDenominators(itr, C); 2522 n_ClearContent(itr, C); // divide out the content 2523 2524 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2525 2526 return start; 2527 } 2528 #endif 2529 2530 if(1) 2483 2531 { 2484 2532 h = n_Init(1,r->cf); … … 2571 2619 #endif 2572 2620 } 2621 2622 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2623 2573 2624 return start; 2574 2625 } … … 2576 2627 void p_Cleardenom_n(poly ph,const ring r,number &c) 2577 2628 { 2578 #if 0 2579 if( ph != NULL ) 2580 { 2581 CPolyCoeffsEnumerator itr(ph); 2582 n_ClearDenominators(itr, c, r->cf); 2583 // return; 2584 } 2585 #endif 2586 2629 const coeffs C = r->cf; 2587 2630 number d, h; 2588 2631 poly p; 2589 2632 2590 2633 p = ph; 2634 2635 assume(ph != NULL); 2636 2637 2638 2639 #if CLEARENUMERATORS 2640 if( (ph != NULL) && nCoeff_is_Q(C) ) 2641 { 2642 CPolyCoeffsEnumerator itr(ph); 2643 n_ClearDenominators(itr, d, C); // multiply with common denom. d 2644 n_ClearContent(itr, h, C); // divide by the content h 2645 2646 c = n_Div(d, h, C); // d/h 2647 2648 n_Delete(&d, C); 2649 n_Delete(&h, C); 2650 2651 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2652 2653 return; 2654 } 2655 #endif 2656 2591 2657 if(pNext(p)==NULL) 2592 2658 { 2593 c=n_Invers(pGetCoeff(p),r->cf); 2594 p_SetCoeff(p,n_Init(1,r->cf),r); 2595 } 2596 else 2659 c=n_Invers(pGetCoeff(p), C); 2660 p_SetCoeff(p, n_Init(1, C), r); 2661 2662 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2663 2664 return; 2665 } 2666 2667 #if CLEARENUMERATORS 2668 if( (ph != NULL) && nCoeff_is_Q(C) ) 2669 { 2670 CPolyCoeffsEnumerator itr(ph); 2671 n_ClearDenominators(itr, d, C); // multiply with common denom. d 2672 n_ClearContent(itr, h, C); // divide by the content h 2673 2674 c = n_Div(d, h, C); // d/h 2675 2676 n_Delete(&d, C); 2677 n_Delete(&h, C); 2678 2679 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2680 2681 return; 2682 } 2683 #endif 2684 2685 2686 2687 2688 if(1) 2597 2689 { 2598 2690 h = n_Init(1,r->cf); … … 2676 2768 } 2677 2769 } 2770 2771 assume( n_GreaterZero(pGetCoeff(ph),C) ); 2678 2772 } 2679 2773
Note: See TracChangeset
for help on using the changeset viewer.