Changeset 4a01eb in git
- Timestamp:
- Jul 4, 2019, 4:41:57 PM (5 years ago)
- Branches:
- (u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
- Children:
- a2ed8d68de2b01b51593ba6669b4af9cf437a407
- Parents:
- c7893eaae5e03161f0de3f3034ab79ed675510fe
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/flint_mpoly.cc
rc7893ea r4a01eb 39 39 void convSingPFlintMP(fmpq_mpoly_t res, fmpq_mpoly_ctx_t ctx, poly p, int lp, const ring r) 40 40 { 41 int bits=SI_LOG2(r->bitmask); 42 fmpq_mpoly_init3(res,lp,bits,ctx); 43 fmpq_mpoly_resize(res,lp,ctx); 41 fmpq_mpoly_init2(res, lp, ctx); 44 42 ulong* exp=(ulong*)omAlloc((r->N+1)*sizeof(ulong)); 45 int i=0;46 43 while(p!=NULL) 47 44 { … … 51 48 #if SIZEOF_LONG==8 52 49 p_GetExpVL(p,(int64*)exp,r); 53 fmpq_mpoly_ set_term_exp_ui(res,i,exp,ctx);50 fmpq_mpoly_push_term_fmpq_ui(res, c, exp, ctx); 54 51 #else 55 52 p_GetExpV(p,(int*)exp,r); 56 fmpq_mpoly_set_term_exp_ui(res,i,&(exp[1]),ctx); 57 #endif 58 fmpq_mpoly_set_term_coeff_fmpq(res,i,c,ctx); 53 fmpq_mpoly_push_term_fmpq_ui(res, c, &(exp[1]), ctx); 54 #endif 59 55 fmpq_clear(c); 60 i++;61 56 pIter(p); 62 57 } 63 //fmpq_mpoly_print_pretty(res,r->names,ctx);PrintLn();58 fmpq_mpoly_reduce(res, ctx); // extra step for QQ ensures res has content canonically factored out 64 59 omFreeSize(exp,(r->N+1)*sizeof(ulong)); 65 60 } … … 111 106 return pres; 112 107 } 108 113 109 BOOLEAN convSingRFlintR(nmod_mpoly_ctx_t ctx, const ring r) 114 110 { … … 158 154 void convSingPFlintMP(nmod_mpoly_t res, nmod_mpoly_ctx_t ctx, poly p, int lp,const ring r) 159 155 { 160 int bits=SI_LOG2(r->bitmask); 161 nmod_mpoly_init3(res,lp,bits,ctx); 162 nmod_mpoly_resize(res,lp,ctx); 156 nmod_mpoly_init2(res, lp, ctx); 163 157 ulong* exp=(ulong*)omAlloc((r->N+1)*sizeof(ulong)); 164 int i=0;165 158 while(p!=NULL) 166 159 { … … 168 161 #if SIZEOF_LONG==8 169 162 p_GetExpVL(p,(int64*)exp,r); 170 nmod_mpoly_ set_term_exp_ui(res,i,exp,ctx);163 nmod_mpoly_push_term_ui_ui(res, (ulong)n, exp, ctx); 171 164 #else 172 165 p_GetExpV(p,(int*)exp,r); 173 nmod_mpoly_set_term_exp_ui(res,i,&(exp[1]),ctx); 174 #endif 175 nmod_mpoly_set_term_coeff_ui(res,i,(ulong)n,ctx); 176 i++; 166 nmod_mpoly_push_term_ui_ui(res, (ulong)n, &(exp[1]), ctx); 167 #endif 177 168 pIter(p); 178 169 } 179 //nmod_mpoly_print_pretty(res,r->names,ctx);PrintLn();180 170 omFreeSize(exp,(r->N+1)*sizeof(ulong)); 181 171 } … … 197 187 return pres; 198 188 } 189 199 190 poly Flint_GCD_MP(poly p,int lp,poly q,int lq,nmod_mpoly_ctx_t ctx,const ring r) 200 191 {
Note: See TracChangeset
for help on using the changeset viewer.