Changeset 47dc5ea in git


Ignore:
Timestamp:
Mar 5, 2012, 10:09:04 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
69fdf90b08eb79adafd1cd78ccee33b8748b3c85
Parents:
c729f26220e3c5188b3151f01a80a302441e8dfd
git-author:
Martin Lee <martinlee84@web.de>2012-03-05 22:09:04+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-04-04 14:42:26+02:00
Message:
chg: *,/,% for univariate polys over Z_p^k[x]/(f) via NTL
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facMul.cc

    rc729f2 r47dc5ea  
    404404        (hasFirstAlgVar (F, alpha) || hasFirstAlgVar (G, alpha)))
    405405    {
     406      if (b.getp() != 0)
     407      {
     408        ZZ_p::init (convertFacCF2NTLZZ (b.getpk()));
     409        ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (getMipo (alpha)));
     410        ZZ_pE::init (NTLmipo);
     411        ZZ_pEX NTLg= convertFacCF2NTLZZ_pEX (G, NTLmipo);
     412        ZZ_pEX NTLf= convertFacCF2NTLZZ_pEX (F, NTLmipo);
     413        mul (NTLf, NTLf, NTLg);
     414        return b (convertNTLZZ_pEX2CF (NTLf, F.mvar(), alpha));
     415      }
    406416      CanonicalForm result= mulFLINTQa (F, G, alpha);
    407417      return result;
     
    427437#endif
    428438    if (b.getp() != 0)
     439    {
     440      if (!F.inBaseDomain() && !G.inBaseDomain())
     441      {
     442        if (hasFirstAlgVar (G, alpha) || hasFirstAlgVar (F, alpha))
     443        {
     444          ZZ_p::init (convertFacCF2NTLZZ (b.getpk()));
     445          if (F.inCoeffDomain() && !G.inCoeffDomain())
     446          {
     447            ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (getMipo (alpha)));
     448            ZZ_pE::init (NTLmipo);
     449            ZZ_pEX NTLg= convertFacCF2NTLZZ_pEX (G, NTLmipo);
     450            ZZ_pX NTLf= convertFacCF2NTLZZpX (F);
     451            mul (NTLg, to_ZZ_pE (NTLf), NTLg);
     452            return b (convertNTLZZ_pEX2CF (NTLg, G.mvar(), alpha));
     453          }
     454          else if (!F.inCoeffDomain() && G.inCoeffDomain())
     455          {
     456            ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (getMipo (alpha)));
     457            ZZ_pE::init (NTLmipo);
     458            ZZ_pX NTLg= convertFacCF2NTLZZpX (G);
     459            ZZ_pEX NTLf= convertFacCF2NTLZZ_pEX (F, NTLmipo);
     460            mul (NTLf, NTLf, to_ZZ_pE (NTLg));
     461            return b (convertNTLZZ_pEX2CF (NTLf, F.mvar(), alpha));
     462          }
     463          else
     464          {
     465            ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (getMipo (alpha)));
     466            ZZ_pE::init (NTLmipo);
     467            ZZ_pX NTLg= convertFacCF2NTLZZpX (G);
     468            ZZ_pX NTLf= convertFacCF2NTLZZpX (F);
     469            ZZ_pE result;
     470            mul (result, to_ZZ_pE (NTLg), to_ZZ_pE (NTLf));
     471            return b (convertNTLZZpX2CF (rep (result), alpha));
     472          }
     473        }
     474      }
    429475      return b (F*G);
     476    }
    430477    return F*G;
    431478  }
     
    512559    else
    513560    {
     561      if (b.getp() != 0)
     562      {
     563        ZZ_p::init (convertFacCF2NTLZZ (b.getpk()));
     564        ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (getMipo (alpha)));
     565        ZZ_pE::init (NTLmipo);
     566        ZZ_pEX NTLg= convertFacCF2NTLZZ_pEX (G, NTLmipo);
     567        ZZ_pEX NTLf= convertFacCF2NTLZZ_pEX (F, NTLmipo);
     568        rem (NTLf, NTLf, NTLg);
     569        return b (convertNTLZZ_pEX2CF (NTLf, F.mvar(), alpha));
     570      }
    514571      CanonicalForm Q, R;
    515572      newtonDivrem (F, G, Q, R);
     
    580637  {
    581638    if (b.getp() != 0)
     639    {
     640      if (!F.inBaseDomain() || !G.inBaseDomain())
     641      {
     642        Variable alpha;
     643        hasFirstAlgVar (F, alpha);
     644        hasFirstAlgVar (G, alpha);
     645        ZZ_p::init (convertFacCF2NTLZZ (b.getpk()));
     646        ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (getMipo (alpha)));
     647        ZZ_pE::init (NTLmipo);
     648        ZZ_pX NTLg= convertFacCF2NTLZZpX (G);
     649        ZZ_pX NTLf= convertFacCF2NTLZZpX (F);
     650        ZZ_pE result;
     651        div (result, to_ZZ_pE (NTLg), to_ZZ_pE (NTLf));
     652        return b (convertNTLZZpX2CF (rep (result), alpha));
     653      }
    582654      return b(div (F,G));
     655    }
    583656    return div (F, G);
    584657  }
     
    586659  {
    587660    if (b.getp() != 0)
     661    {
     662      if (!G.inBaseDomain())
     663      {
     664        Variable alpha;
     665        hasFirstAlgVar (G, alpha);
     666        ZZ_p::init (convertFacCF2NTLZZ (b.getpk()));
     667        ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (getMipo (alpha)));
     668        ZZ_pE::init (NTLmipo);
     669        ZZ_pX NTLg= convertFacCF2NTLZZpX (G);
     670        ZZ_pEX NTLf= convertFacCF2NTLZZ_pEX (F, NTLmipo);
     671        div (NTLf, NTLf, to_ZZ_pE (NTLg));
     672        return b (convertNTLZZ_pEX2CF (NTLf, F.mvar(), alpha));
     673      }
    588674      return b(div (F,G));
     675    }
    589676    return div (F, G);
    590677  }
     
    614701    else
    615702    {
     703      if (b.getp() != 0)
     704      {
     705        ZZ_p::init (convertFacCF2NTLZZ (b.getpk()));
     706        ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (getMipo (alpha)));
     707        ZZ_pE::init (NTLmipo);
     708        ZZ_pEX NTLg= convertFacCF2NTLZZ_pEX (G, NTLmipo);
     709        ZZ_pEX NTLf= convertFacCF2NTLZZ_pEX (F, NTLmipo);
     710        div (NTLf, NTLf, NTLg);
     711        return b (convertNTLZZ_pEX2CF (NTLf, F.mvar(), alpha));
     712      }
    616713      CanonicalForm Q;
    617714      newtonDiv (F, G, Q);
Note: See TracChangeset for help on using the changeset viewer.