Changeset 249d81 in git
- Timestamp:
- Jul 7, 2020, 12:52:39 PM (3 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 914b60371b89ca64f4de49c2623ae8ed3cbe48b9d0adb23686023dffa37da6380408f9f10d314ae4
- Parents:
- 2570f085de2f12e59dac4ee40e02b9172adb8559
- Location:
- factory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/FLINTconvert.cc
r2570f08 r249d81 384 384 bool save_sym_ff= isOn (SW_SYMMETRIC_FF); 385 385 if (save_sym_ff) Off (SW_SYMMETRIC_FF); 386 #if __FLINT_RELEASE >= 20503 386 387 nmod_poly_t res; 387 388 nmod_poly_init(res,getCharacteristic()); 389 #endif 388 390 for (CFIterator i= f; i.hasTerms(); i++) 389 391 { … … 399 401 { 400 402 STICKYASSERT (i.exp() <= fq_nmod_ctx_degree(ctx), "convertFacCF2Fq_nmod_t: element is not reduced"); 403 #if __FLINT_RELEASE >= 20503 401 404 nmod_poly_set_coeff_ui (res, i.exp(), c.intval()); 402 } 403 } 405 #else 406 nmod_poly_set_coeff_ui (result, i.exp(), c.intval()); 407 #endif 408 } 409 } 410 #if __FLINT_RELEASE >= 20503 404 411 fq_nmod_init(result,ctx); 405 412 fq_nmod_set_nmod_poly(result,res,ctx); 413 #endif 406 414 if (save_sym_ff) On (SW_SYMMETRIC_FF); 407 415 } -
factory/cf_map_ext.cc
r2570f08 r249d81 352 352 int d= degree (mipo); 353 353 int p= getCharacteristic (); 354 #if def HAVE_FLINT354 #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503) 355 355 nmod_poly_t FLINT_mipo; 356 356 nmod_poly_init(FLINT_mipo,p); … … 369 369 do 370 370 { 371 #if def HAVE_FLINT371 #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503) 372 372 nmod_poly_randtest_monic_irreducible(FLINT_mipo, FLINTrandom, d+1); 373 373 mipo2=convertnmod_poly_t2FacCF(FLINT_mipo,Variable(1)); … … 386 386 return 0; 387 387 } while (1); 388 #if def HAVE_FLINT388 #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503) 389 389 nmod_poly_clear(FLINT_mipo); 390 390 // convert alpha_mipo … … 451 451 CanonicalForm primElemMipo= findMinPoly (primElem, alpha); 452 452 int p= getCharacteristic (); 453 #if def HAVE_FLINT453 #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503) 454 454 // convert mipo1 455 455 nmod_poly_t mipo1; … … 505 505 } 506 506 int p= getCharacteristic (); 507 #if def HAVE_FLINT507 #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503) 508 508 // convert mipo 509 509 nmod_poly_t mipo1; … … 576 576 } 577 577 578 #if def HAVE_FLINT578 #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503) 579 579 /* 580 580 g is in Fp[x] … … 631 631 ASSERT (F.isUnivariate() && F.mvar()==alpha,"expected element of F_p(alpha)"); 632 632 633 #if defined(HAVE_NTL) && !defined(HAVE_FLINT) 634 if (fac_NTL_char != getCharacteristic()) 635 { 636 fac_NTL_char= getCharacteristic(); 637 zz_p::init (getCharacteristic()); 638 } 639 zz_pX NTLF= convertFacCF2NTLzzpX (F); 640 int d= degree (getMipo (alpha)); 641 642 zz_pX NTLMipo= convertFacCF2NTLzzpX (getMipo(alpha)); 643 zz_pE::init (NTLMipo); 644 vec_zz_p pows; 645 pows.SetLength (2*d); 646 647 zz_pE powNTLF; 648 set (powNTLF); 649 zz_pE NTLFE= to_zz_pE (NTLF); 650 zz_pX buf; 651 for (int i= 0; i < 2*d; i++) 652 { 653 buf= rep (powNTLF); 654 buf.rep.SetLength (d); 655 pows [i]= buf.rep[0]; 656 powNTLF *= NTLFE; 657 } 658 659 zz_pX NTLMinPoly; 660 MinPolySeq (NTLMinPoly, pows, d); 661 662 return convertNTLzzpX2CF (NTLMinPoly, Variable (1)); 663 #elif defined(HAVE_FLINT) 633 #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503) 664 634 nmod_poly_t FLINT_F,FLINT_alpha,g; 665 635 nmod_poly_init(g,getCharacteristic()); … … 672 642 nmod_poly_clear(g); 673 643 return res; 644 #elif defined(HAVE_NTL) 645 if (fac_NTL_char != getCharacteristic()) 646 { 647 fac_NTL_char= getCharacteristic(); 648 zz_p::init (getCharacteristic()); 649 } 650 zz_pX NTLF= convertFacCF2NTLzzpX (F); 651 int d= degree (getMipo (alpha)); 652 653 zz_pX NTLMipo= convertFacCF2NTLzzpX (getMipo(alpha)); 654 zz_pE::init (NTLMipo); 655 vec_zz_p pows; 656 pows.SetLength (2*d); 657 658 zz_pE powNTLF; 659 set (powNTLF); 660 zz_pE NTLFE= to_zz_pE (NTLF); 661 zz_pX buf; 662 for (int i= 0; i < 2*d; i++) 663 { 664 buf= rep (powNTLF); 665 buf.rep.SetLength (d); 666 pows [i]= buf.rep[0]; 667 powNTLF *= NTLFE; 668 } 669 670 zz_pX NTLMinPoly; 671 MinPolySeq (NTLMinPoly, pows, d); 672 673 return convertNTLzzpX2CF (NTLMinPoly, Variable (1)); 674 674 #endif 675 675 }
Note: See TracChangeset
for help on using the changeset viewer.