Changeset c7c7fe4 in git


Ignore:
Timestamp:
Feb 16, 2012, 3:19:10 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
5b410740267969d96b217ae7a6dc01d921a86161
Parents:
e016ba74132ef655a25823cf0f343ce4b9069f7d
git-author:
Martin Lee <martinlee84@web.de>2012-02-16 15:19:10+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-04-04 14:42:25+02:00
Message:
chg: added divisibility test for univariate polys
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/facMul.cc

    re016ba rc7c7fe4  
    24972497}
    24982498
     2499bool
     2500uniFdivides (const CanonicalForm& A, const CanonicalForm& B)
     2501{
     2502  int p= getCharacteristic();
     2503  if (p > 0)
     2504  {
     2505    zz_p::init (p);
     2506    Variable alpha;
     2507    if (hasFirstAlgVar (A, alpha) || hasFirstAlgVar (B, alpha))
     2508    {
     2509      zz_pX NTLMipo= convertFacCF2NTLzzpX (getMipo (alpha));
     2510      zz_pE::init (NTLMipo);
     2511      zz_pEX NTLA= convertFacCF2NTLzz_pEX (A, NTLMipo);
     2512      zz_pEX NTLB= convertFacCF2NTLzz_pEX (B, NTLMipo);
     2513      return divide (NTLB, NTLA);
     2514    }
     2515#ifdef HAVE_FLINT
     2516    nmod_poly_t FLINTA, FLINTB;
     2517    convertFacCF2nmod_poly_t (FLINTA, A);
     2518    convertFacCF2nmod_poly_t (FLINTB, B);
     2519    nmod_poly_rem (FLINTA, FLINTB, FLINTA);
     2520    bool result= nmod_poly_is_zero (FLINTA);
     2521    nmod_poly_clear (FLINTA);
     2522    nmod_poly_clear (FLINTB);
     2523    return result;
     2524#else
     2525    zz_pX NTLA= convertFacCF2NTLzzpX (A);
     2526    zz_pX NTLB= convertFacCF2NTLzzpX (B);
     2527    return divide (NTLB, NTLA);
     2528#endif
     2529  }
     2530#ifdef HAVE_FLINT
     2531  fmpq_poly_t FLINTA,FLINTB;
     2532  fmpq_poly_init (FLINTA);
     2533  fmpq_poly_init (FLINTB);
     2534  convertFacCF2Fmpq_poly_t (FLINTA, A);
     2535  convertFacCF2Fmpq_poly_t (FLINTB, B);
     2536  fmpq_poly_rem (FLINTA, FLINTB, FLINTA);
     2537  bool result= fmpq_poly_is_zero (FLINTA);
     2538  fmpq_poly_clear (FLINTA);
     2539  fmpq_poly_clear (FLINTB);
     2540  return result;
     2541#else
     2542  return fdivides (A, B); //maybe NTL?
     2543#endif
     2544}
     2545
    24992546// end division
    25002547
  • factory/facMul.h

    re016ba rc7c7fe4  
    9999          );
    100100
     101/// divisibility test for univariate polys
     102///
     103/// @return @a uniFdivides returns true if A divides B
     104bool
     105uniFdivides (const CanonicalForm& A, ///< [in] univariate poly
     106             const CanonicalForm& B  ///< [in] univariate poly
     107            );
     108
    101109/// Karatsuba style modular multiplication for bivariate polynomials.
    102110///
Note: See TracChangeset for help on using the changeset viewer.