Changeset 07f20e1 in git for Singular/clapsing.cc
- Timestamp:
- Jun 14, 1999, 6:25:42 PM (24 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 05bcd531ee2a91c26af99c19808959dac564df67
- Parents:
- 74fe50d0de12691ddaa37a4a8527e5e220253ab8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/clapsing.cc
r74fe50d r07f20e1 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 // $Id: clapsing.cc,v 1.5 0 1999-04-17 14:58:38 obachmanExp $5 // $Id: clapsing.cc,v 1.51 1999-06-14 16:25:42 Singular Exp $ 6 6 /* 7 7 * ABSTRACT: interface between Singular and factory … … 204 204 else return pCopy(f); // g==0 => gcd=f (but do a pCleardenom) 205 205 if (f==NULL) return pCopy(g); // f==0 => gcd=g (but do a pCleardenom) 206 206 207 207 // for now there is only the possibility to handle polynomials over 208 208 // Q and Fp ... … … 618 618 } 619 619 620 static int primepower(int c) 621 { 622 int p=1; 623 int cc=c; 624 while(cc!= rInternalChar(currRing)) { cc*=c; p++; } 625 return p; 626 } 627 620 628 ideal singclap_factorize ( poly f, intvec ** v , int with_exps) 621 629 { … … 641 649 number NN=NULL; 642 650 643 if (( (nGetChar() == 0) || (nGetChar() > 1) ) 644 && (currRing->parameter==NULL)) 651 if (rField_is_Q() || rField_is_Zp()) 645 652 { 646 653 setCharacteristic( nGetChar() ); … … 676 683 } 677 684 } 685 else if (rField_is_GF()) 686 { 687 int c=rChar(currRing); 688 setCharacteristic( c, primepower(c) ); 689 CanonicalForm F( convSingGFClapGF( f ) ); 690 if (F.isUnivariate()) 691 { 692 L = factorize( F ); 693 } 694 else 695 { 696 goto notImpl; 697 } 698 } 678 699 // and over Q(a) / Fp(a) 679 else if (( nGetChar()==1 ) /* Q(a) */ 680 || (nGetChar() <-1)) /* Fp(a) */ 700 else if (rField_is_Extension()) 681 701 { 682 702 if (nGetChar()==1) setCharacteristic( 0 ); … … 688 708 Variable a=rootOf(mipo); 689 709 CanonicalForm F( convSingAPClapAP( f,a ) ); 710 L.insert(F); 690 711 if (F.isUnivariate()) 691 712 { … … 694 715 else 695 716 { 717 WarnS("complete factorization only for univariate polynomials"); 696 718 CanonicalForm G( convSingTrPClapP( f ) ); 697 L = factorize( G ); 719 if (nGetChar()==1) /* Q(a) */ 720 { 721 L = factorize( G ); 722 } 723 else 724 { 725 #ifdef HAVE_LIBFAC_P 726 L = Factorize( G ); 727 #else 728 goto notImpl; 729 #endif 730 } 698 731 } 699 732 } … … 740 773 { 741 774 if (with_exps!=1) (**v)[j] = J.getItem().exp(); 742 if ( (nGetChar()==0)||(nGetChar()>1)) /* Q, Fp */775 if (rField_is_Zp() || rField_is_Q()) /* Q, Fp */ 743 776 res->m[j] = convClapPSingP( J.getItem().factor() ); 744 else if ((nGetChar()==1)||(nGetChar()<-1)) /* Q(a), Fp(a) */ 777 else if (rField_is_GF()) 778 res->m[j] = convClapGFSingGF( J.getItem().factor() ); 779 else if (rField_is_Extension()) /* Q(a), Fp(a) */ 745 780 { 746 781 if (currRing->minpoly==NULL) … … 763 798 for(;i>=0;i--) 764 799 { 765 if ( pIsConstant(res->m[i]))800 if ((res->m[i]!=NULL) && (pNext(res->m[i])==NULL) && (pIsConstant(res->m[i]))) 766 801 { 767 802 pDelete(&(res->m[i]));
Note: See TracChangeset
for help on using the changeset viewer.