Changeset 67c922 in git for libpolys/polys/clapsing.cc


Ignore:
Timestamp:
Dec 6, 2019, 2:11:20 PM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
d2a9865cca207801d3b0c05a50dfc5a02724120e
Parents:
47504331597a2f8c775772cb002241dcf904a680
Message:
opt: singclap_factorize
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/clapsing.cc

    r475043 r67c922  
    994994
    995995  Variable a;
    996   if ((rField_is_Q(r) || rField_is_Q_a(r)
    997   && (r->cf->convSingNFactoryN!=ndConvSingNFactoryN))) /* Q, Q(a) */
    998   {
    999     //if (f!=NULL) // already tested at start of routine
    1000     {
    1001       number n0=n_Copy(pGetCoeff(f),r->cf);
    1002       if (with_exps==0)
    1003         N=n_Copy(n0,r->cf);
    1004       p_Cleardenom(f, r);
    1005       //after here f should not have a denominator!!
    1006       //PrintS("S:");p_Write(f,r);PrintLn();
    1007       NN=n_Div(n0,pGetCoeff(f),r->cf);
    1008       n_Delete(&n0,r->cf);
    1009       if (with_exps==0)
    1010       {
    1011         n_Delete(&N,r->cf);
    1012         N=n_Copy(NN,r->cf);
    1013       }
    1014     }
    1015   }
    1016   else if (rField_is_Zp_a(r))
    1017   {
    1018     //if (f!=NULL) // already tested at start of routine
    1019     if (singclap_factorize_retry==0)
    1020     {
    1021       number n0=n_Copy(pGetCoeff(f),r->cf);
    1022       if (with_exps==0)
    1023         N=n_Copy(n0,r->cf);
    1024       p_Norm(f,r);
    1025       p_Cleardenom(f, r);
    1026       NN=n_Div(n0,pGetCoeff(f),r->cf);
    1027       n_Delete(&n0,r->cf);
    1028       if (with_exps==0)
    1029       {
    1030         n_Delete(&N,r->cf);
    1031         N=n_Copy(NN,r->cf);
    1032       }
    1033     }
    1034   }
    1035   if ((rField_is_Q(r) || rField_is_Zp(r) || (rField_is_Z(r)))
    1036   || (rField_is_Zn(r)&&(r->cf->convSingNFactoryN!=ndConvSingNFactoryN)))
    1037   {
    1038     setCharacteristic( rChar(r) );
    1039     CanonicalForm F( convSingPFactoryP( f,r ) );
    1040     L = factorize( F );
    1041   }
    1042   // and over Q(a) / Fp(a)
    1043   else if ((r->cf->extRing!=NULL)
    1044   &&(r->cf->extRing->cf->convSingNFactoryN!=ndConvSingNFactoryN))
    1045   {
    1046     if (rField_is_Q_a (r)) setCharacteristic (0);
    1047     else                   setCharacteristic( rChar(r) );
    1048     if (r->cf->extRing->qideal!=NULL) /*algebraic extension */
    1049     {
    1050       CanonicalForm mipo=convSingPFactoryP(r->cf->extRing->qideal->m[0],
    1051                                            r->cf->extRing);
    1052       a=rootOf(mipo);
    1053       CanonicalForm F( convSingAPFactoryAP( f, a, r ) );
    1054       L = factorize( F, a );
    1055       prune(a);
    1056     }
    1057     else /* rational functions */
    1058     {
    1059       CanonicalForm F( convSingTrPFactoryP( f,r ) );
     996  if (r->cf->convSingNFactoryN!=ndConvSingNFactoryN)
     997  {
     998    if (rField_is_Q(r) || rField_is_Q_a(r)) /* Q, Q(a) */
     999    {
     1000      //if (f!=NULL) // already tested at start of routine
     1001      {
     1002        number n0=n_Copy(pGetCoeff(f),r->cf);
     1003        if (with_exps==0)
     1004          N=n_Copy(n0,r->cf);
     1005        p_Cleardenom(f, r);
     1006        //after here f should not have a denominator!!
     1007        //PrintS("S:");p_Write(f,r);PrintLn();
     1008        NN=n_Div(n0,pGetCoeff(f),r->cf);
     1009        n_Delete(&n0,r->cf);
     1010        if (with_exps==0)
     1011        {
     1012          n_Delete(&N,r->cf);
     1013          N=n_Copy(NN,r->cf);
     1014        }
     1015      }
     1016    }
     1017    else if (rField_is_Zp_a(r))
     1018    {
     1019      //if (f!=NULL) // already tested at start of routine
     1020      if (singclap_factorize_retry==0)
     1021      {
     1022        number n0=n_Copy(pGetCoeff(f),r->cf);
     1023        if (with_exps==0)
     1024          N=n_Copy(n0,r->cf);
     1025        p_Norm(f,r);
     1026        p_Cleardenom(f, r);
     1027        NN=n_Div(n0,pGetCoeff(f),r->cf);
     1028        n_Delete(&n0,r->cf);
     1029        if (with_exps==0)
     1030        {
     1031          n_Delete(&N,r->cf);
     1032          N=n_Copy(NN,r->cf);
     1033        }
     1034      }
     1035    }
     1036    if (rField_is_Q(r) || rField_is_Zp(r) || rField_is_Z(r) || rField_is_Zn(r))
     1037    {
     1038      setCharacteristic( rChar(r) );
     1039      CanonicalForm F( convSingPFactoryP( f,r ) );
    10601040      L = factorize( F );
     1041    }
     1042    // and over Q(a) / Fp(a)
     1043    else if (r->cf->extRing!=NULL)
     1044    {
     1045      if (rField_is_Q_a (r)) setCharacteristic (0);
     1046      else                   setCharacteristic( rChar(r) );
     1047      if (r->cf->extRing->qideal!=NULL) /*algebraic extension */
     1048      {
     1049        CanonicalForm mipo=convSingPFactoryP(r->cf->extRing->qideal->m[0],
     1050                                             r->cf->extRing);
     1051        a=rootOf(mipo);
     1052        CanonicalForm F( convSingAPFactoryAP( f, a, r ) );
     1053        L = factorize( F, a );
     1054        prune(a);
     1055      }
     1056      else /* rational functions */
     1057      {
     1058        CanonicalForm F( convSingTrPFactoryP( f,r ) );
     1059        L = factorize( F );
     1060      }
     1061    }
     1062    else
     1063    {
     1064      goto notImpl;
    10611065    }
    10621066  }
     
    10891093      if (with_exps!=1) (**v)[j] = J.getItem().exp();
    10901094      if (rField_is_Zp(r) || rField_is_Q(r)||  rField_is_Z(r)
    1091       || (rField_is_Zn(r) && r->cf->convSingNFactoryN!=ndConvSingNFactoryN))           /* Q, Fp, Z */
     1095      || rField_is_Zn(r))           /* Q, Fp, Z */
    10921096      {
    10931097        //count_Factors(res,*v,f, j, convFactoryPSingP( J.getItem().factor() );
Note: See TracChangeset for help on using the changeset viewer.