Changeset c7c7fe4 in git
- Timestamp:
- Feb 16, 2012, 3:19:10 PM (11 years ago)
- 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
- Location:
- factory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/facMul.cc
re016ba rc7c7fe4 2497 2497 } 2498 2498 2499 bool 2500 uniFdivides (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 2499 2546 // end division 2500 2547 -
factory/facMul.h
re016ba rc7c7fe4 99 99 ); 100 100 101 /// divisibility test for univariate polys 102 /// 103 /// @return @a uniFdivides returns true if A divides B 104 bool 105 uniFdivides (const CanonicalForm& A, ///< [in] univariate poly 106 const CanonicalForm& B ///< [in] univariate poly 107 ); 108 101 109 /// Karatsuba style modular multiplication for bivariate polynomials. 102 110 ///
Note: See TracChangeset
for help on using the changeset viewer.