Changeset f9bd3d in git for factory


Ignore:
Timestamp:
Feb 16, 2012, 5:14:39 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
d3d3168d8614852a68310698973f95ecc6a54139
Parents:
1ade963c1847f591acd6148d1fd1e76d97c688fd
git-author:
Martin Lee <martinlee84@web.de>2012-02-16 17:14:39+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-04-04 14:42:26+02:00
Message:
chg: use NTL for univariate operations with coeff bound
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facMul.cc

    r1ade96 rf9bd3d  
    407407    }
    408408    else if (!F.inCoeffDomain() && !G.inCoeffDomain())
     409    {
     410      if (b.getp() != 0)
     411        return b (mulFLINTQ (F, G));
    409412      return mulFLINTQ (F, G);
     413    }
    410414#endif
     415    if (b.getp() != 0)
     416      return b (F*G);
    411417    return F*G;
    412418  }
     
    451457{
    452458  if (F.inCoeffDomain() && G.isUnivariate())
     459  {
     460    if (b.getp() != 0)
     461      return b(F);
    453462    return F;
     463  }
    454464  else if (F.inCoeffDomain() && G.inCoeffDomain())
     465  {
     466    if (b.getp() != 0)
     467      return b(F%G);
    455468    return mod (F, G);
     469  }
    456470  else if (F.isUnivariate() && G.inCoeffDomain())
     471  {
     472    if (b.getp() != 0)
     473      return b(F%G);
    457474    return mod (F,G);
     475  }
    458476
    459477  if (getCharacteristic() == 0)
     
    462480    Variable alpha;
    463481    if (!hasFirstAlgVar (F, alpha) && !hasFirstAlgVar (G, alpha))
     482    {
     483      if (b.getp() != 0)
     484      {
     485        ZZ NTLpk= power_ZZ (b.getp(), b.getk());
     486        ZZ_p::init (NTLpk);
     487        ZZX ZZf= convertFacCF2NTLZZX (F);
     488        ZZX ZZg= convertFacCF2NTLZZX (G);
     489        ZZ_pX NTLf= to_ZZ_pX (ZZf);
     490        ZZ_pX NTLg= to_ZZ_pX (ZZg);
     491        rem (NTLf, NTLf, NTLg);
     492        return b (convertNTLZZX2CF (to_ZZX (NTLf), F.mvar()));
     493      }
    464494      return modFLINTQ (F, G);
     495    }
    465496    else
    466497    {
     
    470501    }
    471502#else
     503    if (b.getp() != 0)
     504    {
     505      ZZ NTLpk= power_ZZ (b.getp(), b.getk());
     506      ZZ_p::init (NTLpk);
     507      ZZX ZZf= convertFacCF2NTLZZX (F);
     508      ZZX ZZg= convertFacCF2NTLZZX (G);
     509      ZZ_pX NTLf= to_ZZ_pX (ZZf);
     510      ZZ_pX NTLg= to_ZZ_pX (ZZg);
     511      rem (NTLf, NTLf, NTLg);
     512      return b (convertNTLZZX2CF (to_ZZX (NTLf), F.mvar()));
     513    }
    472514    return mod (F, G);
    473515#endif
     
    514556{
    515557  if (F.inCoeffDomain() && G.isUnivariate())
     558  {
     559    if (b.getp() != 0)
     560      return b(F);
    516561    return F;
     562  }
    517563  else if (F.inCoeffDomain() && G.inCoeffDomain())
     564  {
     565    if (b.getp() != 0)
     566      return b(div (F,G));
    518567    return div (F, G);
     568  }
    519569  else if (F.isUnivariate() && G.inCoeffDomain())
    520     return div (F,G);
     570  {
     571    if (b.getp() != 0)
     572      return b(div (F,G));
     573    return div (F, G);
     574  }
    521575
    522576  if (getCharacteristic() == 0)
     
    525579    Variable alpha;
    526580    if (!hasFirstAlgVar (F, alpha) && !hasFirstAlgVar (G, alpha))
     581    {
     582      if (b.getp() != 0)
     583      {
     584        ZZ NTLpk= power_ZZ (b.getp(), b.getk());
     585        ZZ_p::init (NTLpk);
     586        ZZX ZZf= convertFacCF2NTLZZX (F);
     587        ZZX ZZg= convertFacCF2NTLZZX (G);
     588        ZZ_pX NTLf= to_ZZ_pX (ZZf);
     589        ZZ_pX NTLg= to_ZZ_pX (ZZg);
     590        div (NTLf, NTLf, NTLg);
     591        return b (convertNTLZZX2CF (to_ZZX (NTLf), F.mvar()));
     592      }
    527593      return divFLINTQ (F,G);
     594    }
    528595    else
    529596    {
     
    533600    }
    534601#else
     602    if (b.getp() != 0)
     603    {
     604      ZZ NTLpk= power_ZZ (b.getp(), b.getk());
     605      ZZ_p::init (NTLpk);
     606      ZZX ZZf= convertFacCF2NTLZZX (F);
     607      ZZX ZZg= convertFacCF2NTLZZX (G);
     608      ZZ_pX NTLf= to_ZZ_pX (ZZf);
     609      ZZ_pX NTLg= to_ZZ_pX (ZZg);
     610      div (NTLf, NTLf, NTLg);
     611      return b (convertNTLZZX2CF (to_ZZX (NTLf), F.mvar()));
     612    }
    535613    return div (F, G);
    536614#endif
Note: See TracChangeset for help on using the changeset viewer.