Changeset c1f4d51 in git
- Timestamp:
- Jul 1, 2020, 4:16:14 PM (3 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 2ce3bf354077ca50ab9dbbed78c68d8e279f1297
- Parents:
- f542551517fde5e0e330f2a5f4ae6e3fdfd32454
- Location:
- factory
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cfGcdUtil.cc
rf542551 rc1f4d51 22 22 /// result is false, d is set to the degree of the gcd of f and g evaluated at a 23 23 /// random point in K^n-1. This gcd is a gcd of univariate polynomials. 24 #ifdef HAVE_NTL // mapPrimElem25 24 bool 26 25 gcd_test_one ( const CanonicalForm & f, const CanonicalForm & g, bool swap, int & d ) … … 245 244 return result; 246 245 } 247 #endif248 246 249 247 /** -
factory/cfModResultant.cc
rf542551 rc1f4d51 345 345 } 346 346 347 #ifdef HAVE_NTL // mapPrimElem348 347 CanonicalForm 349 348 resultantFp (const CanonicalForm& A, const CanonicalForm& B, const Variable& x, … … 522 521 return N (H); 523 522 } 524 #endif525 523 526 524 static inline -
factory/cf_map_ext.cc
rf542551 rc1f4d51 440 440 } 441 441 442 #ifdef HAVE_NTL // findMinPoly443 442 CanonicalForm 444 443 mapPrimElem (const CanonicalForm& primElem, const Variable& alpha, … … 491 490 } 492 491 } 493 #endif494 492 495 493 CanonicalForm … … 576 574 } 577 575 578 #ifdef HAVE_NTL 576 #ifdef HAVE_FLINT 577 /* 578 g is in Fp[x] 579 F is in Fp[t] 580 h is in Fp[t] 581 In the finite field Fp[t]/h(t), find g(x) in Fp[x] such that 582 g(F(t)) = 0 mod h(t) 583 i.e. g is the minpoly of the element F(t) of the finite field. 584 */ 585 static void minpoly(nmod_poly_t g, const nmod_poly_t F, const nmod_poly_t h) 586 { 587 slong i; 588 slong d = nmod_poly_degree(h); 589 mp_limb_t p = h->mod.n; 590 nmod_poly_t Fpow; 591 nmod_berlekamp_massey_t bma; 592 593 nmod_poly_init(Fpow, p); 594 nmod_berlekamp_massey_init(bma, p); 595 596 nmod_poly_one(Fpow); 597 for (i = 0; i < 2*d; i++) 598 { 599 nmod_berlekamp_massey_add_point(bma, nmod_poly_get_coeff_ui(Fpow, 0)); 600 nmod_poly_mulmod(Fpow, Fpow, F, h); 601 } 602 603 nmod_berlekamp_massey_reduce(bma); 604 605 /* something went horribly wrong if V does not kill the whole sequence */ 606 FLINT_ASSERT(nmod_poly_degree(nmod_berlekamp_massey_R_poly(bma)) < 607 nmod_poly_degree(nmod_berlekamp_massey_V_poly(bma))); 608 609 nmod_poly_make_monic(g, nmod_berlekamp_massey_V_poly(bma)); 610 #if WANT_ASSERT 611 { 612 nmod_poly_t z; 613 nmod_poly_init(z, p); 614 nmod_poly_compose_mod(z, g, F, h); 615 FLINT_ASSERT(nmod_poly_is_zero(z)); 616 nmod_poly_clear(z); 617 } 618 #endif 619 nmod_poly_clear(Fpow); 620 nmod_berlekamp_massey_clear(bma); 621 } 622 #endif 623 624 625 #if defined(HAVE_NTL) || defined(HAVE_FLINT) 579 626 CanonicalForm 580 627 findMinPoly (const CanonicalForm& F, const Variable& alpha) … … 582 629 ASSERT (F.isUnivariate() && F.mvar()==alpha,"expected element of F_p(alpha)"); 583 630 631 #if defined(HAVE_NTL) && !defined(HAVE_FLINT) 584 632 if (fac_NTL_char != getCharacteristic()) 585 633 { … … 611 659 612 660 return convertNTLzzpX2CF (NTLMinPoly, Variable (1)); 613 } 614 661 #elif defined(HAVE_FLINT) 662 nmod_poly_t FLINT_F,FLINT_alpha,g; 663 nmod_poly_init(g,getCharacteristic()); 664 convertFacCF2nmod_poly_t(FLINT_F,F); 665 convertFacCF2nmod_poly_t(FLINT_alpha,getMipo(alpha)); 666 minpoly(g,FLINT_F,FLINT_alpha); 667 nmod_poly_clear(FLINT_alpha); 668 nmod_poly_clear(FLINT_F); 669 CanonicalForm res=convertnmod_poly_t2FacCF(g,Variable(1)); 670 nmod_poly_clear(g); 671 return res; 672 #endif 673 } 615 674 #endif -
factory/facFqBivar.cc
rf542551 rc1f4d51 8922 8922 #endif 8923 8923 8924 #ifdef HAVE_NTL // primitiveElement8925 8924 CFList 8926 8925 extBiFactorize (const CanonicalForm& F, const ExtensionInfo& info) … … 9097 9096 } 9098 9097 #endif 9099 #endif -
factory/facFqFactorize.cc
rf542551 rc1f4d51 33 33 #include "facMul.h" 34 34 #include "cfUnivarGcd.h" 35 36 #ifdef HAVE_NTL37 #include "NTLconvert.h"38 35 39 36 TIMING_DEFINE_PRINT(fac_fq_bi_factorizer) … … 736 733 } 737 734 735 #if defined(HAVE_NTL) || defined(HAVE_FLINT) 738 736 #define CHAR_THRESHOLD 8 739 737 CFList … … 909 907 return result; 910 908 } 909 #endif 911 910 912 911 static inline … … 1993 1992 } 1994 1993 1995 #endif1996 1997 1994 static inline 1998 1995 CanonicalForm prodEval (const CFList& l, const CanonicalForm& evalPoint, … … 2165 2162 } 2166 2163 2167 #if def HAVE_NTL2164 #if defined(HAVE_NTL) || defined(HAVE_FLINT) 2168 2165 void 2169 2166 factorizationWRTDifferentSecondVars (const CanonicalForm& A, CFList*& Aeval, … … 2204 2201 } 2205 2202 } 2203 #endif 2206 2204 2207 2205 CFList conv (const CFArray & A) … … 2904 2902 } 2905 2903 2904 #if defined(HAVE_NTL) || defined(HAVE_FLINT) 2906 2905 CFList 2907 2906 extFactorize (const CanonicalForm& F, const ExtensionInfo& info); … … 3828 3827 } 3829 3828 } 3830 3831 3829 #endif 3832 /* HAVE_NTL */
Note: See TracChangeset
for help on using the changeset viewer.