Changeset 2ce3bf in git
- Timestamp:
- Jul 1, 2020, 4:36:02 PM (3 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- cc5a86cc299c9d4d71030662a697af14d56a1bf3
- Parents:
- c1f4d51f741e0a6c42d18ed86f6d5f207f816516
- Location:
- factory
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/FLINTconvert.cc
rc1f4d51 r2ce3bf 63 63 #if ( __FLINT_RELEASE >= 20503) 64 64 #include <flint/fmpq_mpoly.h> 65 66 #if (__FLINT_RELEASE < 20601) 67 // helper for fq_nmod_t -> nmod_poly_t 68 static void fq_nmod_get_nmod_poly(nmod_poly_t a, const fq_nmod_t b, const fq_nmod_ctx_t ctx) 69 { 70 FLINT_ASSERT(b->mod.n == ctx->modulus->mod.n); 71 a->mod = ctx->modulus->mod; 72 nmod_poly_set(a, b); 73 } 74 75 // helper for nmod_poly_t -> fq_nmod_t 76 static void fq_nmod_set_nmod_poly(fq_nmod_t a, const nmod_poly_t b, const fq_nmod_ctx_t ctx) 77 { 78 FLINT_ASSERT(a->mod.n == b->mod.n); 79 FLINT_ASSERT(a->mod.n == ctx->modulus->mod.n); 80 nmod_poly_set(a, b); 81 fq_nmod_reduce(a, ctx); 82 } 83 #endif 84 85 65 86 #endif 66 87 #ifdef __cplusplus … … 363 384 bool save_sym_ff= isOn (SW_SYMMETRIC_FF); 364 385 if (save_sym_ff) Off (SW_SYMMETRIC_FF); 386 nmod_poly_t res; 387 nmod_poly_init(res,getCharacteristic()); 365 388 for (CFIterator i= f; i.hasTerms(); i++) 366 389 { … … 376 399 { 377 400 STICKYASSERT (i.exp() <= fq_nmod_ctx_degree(ctx), "convertFacCF2Fq_nmod_t: element is not reduced"); 378 nmod_poly_set_coeff_ui (result, i.exp(), c.intval()); 379 } 380 } 401 nmod_poly_set_coeff_ui (res, i.exp(), c.intval()); 402 } 403 } 404 fq_nmod_init(result,ctx); 405 fq_nmod_set_nmod_poly(result,res,ctx); 381 406 if (save_sym_ff) On (SW_SYMMETRIC_FF); 382 407 } 383 408 384 409 CanonicalForm 385 convertFq_nmod_t2FacCF (const fq_nmod_t poly, const Variable& alpha) 386 { 387 return convertnmod_poly_t2FacCF (poly, alpha); 410 convertFq_nmod_t2FacCF (const fq_nmod_t poly, const fq_nmod_ctx_t ctx, const Variable& alpha) 411 { 412 nmod_poly_t p; 413 nmod_poly_init(p,getCharacteristic()); 414 fq_nmod_get_nmod_poly(p,poly,ctx); 415 CanonicalForm res= convertnmod_poly_t2FacCF (p, alpha); 416 nmod_poly_clear(p); 417 return res; 388 418 } 389 419 … … 476 506 if (fq_nmod_is_zero (coeff, ctx)) 477 507 continue; 478 result += convertFq_nmod_t2FacCF (coeff, alpha )*power (x, i);508 result += convertFq_nmod_t2FacCF (coeff, alpha, ctx)*power (x, i); 479 509 fq_nmod_zero (coeff, ctx); 480 510 } … … 573 603 { 574 604 (*res)(i,j)=convertFq_nmod_t2FacCF (fq_nmod_mat_entry (m, i-1, j-1), 575 alpha );605 alpha, fq_con); 576 606 } 577 607 } -
factory/FLINTconvert.h
rc1f4d51 r2ce3bf 157 157 CanonicalForm 158 158 convertFq_nmod_t2FacCF (const fq_nmod_t poly, ///< [in] fq_nmod_t 159 const Variable& alpha ///< [in] algebraic variable 159 const Variable& alpha, ///< [in] algebraic variable 160 const fq_nmod_ctx_t ctx ///<[in] context 160 161 ); 161 162 -
factory/cf_map_ext.cc
rc1f4d51 r2ce3bf 90 90 fq_nmod_neg(r0, r0, ctx); 91 91 // convert 92 CanonicalForm r1=convertFq_nmod_t2FacCF(r0,beta );92 CanonicalForm r1=convertFq_nmod_t2FacCF(r0,beta,ctx); 93 93 // cleanup 94 94 fq_nmod_poly_factor_clear(fac,ctx); … … 406 406 fq_nmod_neg(r0, r0, ctx); 407 407 // convert 408 CanonicalForm r1=convertFq_nmod_t2FacCF(r0,alpha );408 CanonicalForm r1=convertFq_nmod_t2FacCF(r0,alpha,ctx); 409 409 // cleanup 410 410 fq_nmod_poly_factor_clear(fac,ctx); … … 469 469 fq_nmod_neg(r0, r0, ctx); 470 470 // convert 471 CanonicalForm r1=convertFq_nmod_t2FacCF(r0,beta );471 CanonicalForm r1=convertFq_nmod_t2FacCF(r0,beta,ctx); 472 472 // cleanup 473 473 fq_nmod_poly_factor_clear(fac,ctx); … … 542 542 fq_nmod_poly_get_coeff(r0,fac->poly+ind,0,ctx); 543 543 fq_nmod_neg(r0,r0,ctx); 544 CanonicalForm r1=convertFq_nmod_t2FacCF(r0,beta );544 CanonicalForm r1=convertFq_nmod_t2FacCF(r0,beta,ctx); 545 545 // cleanup 546 546 fq_nmod_poly_factor_clear(fac,ctx); -
factory/facFqSquarefree.cc
rc1f4d51 r2ce3bf 106 106 107 107 fq_nmod_pow (FLINTA, FLINTA, qp, fq_con); 108 A= convertFq_nmod_t2FacCF (FLINTA, alpha );108 A= convertFq_nmod_t2FacCF (FLINTA, alpha, fq_con); 109 109 110 110 fmpz_clear (qp);
Note: See TracChangeset
for help on using the changeset viewer.