Changeset d4cec6a in git for libpolys/polys/operations/p_Mult_q.cc
- Timestamp:
- Jul 23, 2019, 11:31:27 AM (5 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 7161acac8387482214ebcdd85e77266519f0cad2
- Parents:
- d906dc5d406b00b056fb825f5c5c8988ebcaceb3628fc3d0ec524cd36ca82c3a6275c0dcf5d73c83
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/operations/p_Mult_q.cc
rd906dc rd4cec6a 23 23 #include "polys/templates/p_MemAdd.h" 24 24 #include "polys/templates/p_MemCopy.h" 25 #include "polys/flintconv.h" 26 #include "polys/flint_mpoly.h" 25 27 26 28 #include "p_Mult_q.h" … … 268 270 269 271 272 // Use factory if min(pLength(p), pLength(q)) >= MIN_LENGTH_FACTORY (>MIN_LENGTH_BUCKET) 273 // Not thoroughly tested what is best 274 #define MIN_LENGTH_FACTORY 200 275 #define MIN_LENGTH_FACTORY_QQ 60 276 #define MIN_FLINT_QQ 10 277 #define MIN_FLINT_Zp 20 278 270 279 /// Returns: p * q, 271 280 /// Destroys: if !copy then p, q 272 /// Assumes: pLength(p) >= 2 pLength(q) >=2 281 /// Assumes: pLength(p) >= 2 pLength(q) >=2, !rIsPluralRing(r) 273 282 poly _p_Mult_q(poly p, poly q, const int copy, const ring r) 274 283 { … … 281 290 poly pt; 282 291 283 pqLength(p, q, lp, lq, MIN_LENGTH_ BUCKET);292 pqLength(p, q, lp, lq, MIN_LENGTH_FACTORY); 284 293 285 294 if (lp < lq) … … 292 301 lq = l; 293 302 } 303 BOOLEAN pure_polys=(p_GetComp(p,r)==0) && (p_GetComp(q,r)==0); 304 #ifdef HAVE_FLINT 305 #if __FLINT_RELEASE >= 20503 306 if (lq>MIN_FLINT_QQ) 307 { 308 fmpq_mpoly_ctx_t ctx; 309 if (pure_polys && rField_is_Q(r) && !convSingRFlintR(ctx,r)) 310 { 311 lp=pLength(p); 312 //printf("mul in flint\n"); 313 poly res=Flint_Mult_MP(p,lp,q,lq,ctx,r); 314 if (!copy) 315 { 316 p_Delete(&p,r); 317 p_Delete(&q,r); 318 } 319 return res; 320 } 321 } 322 if (lq>MIN_FLINT_Zp) 323 { 324 nmod_mpoly_ctx_t ctx; 325 if (pure_polys && rField_is_Zp(r) && !convSingRFlintR(ctx,r)) 326 { 327 lp=pLength(p); 328 //printf("mul in flint\n"); 329 poly res=Flint_Mult_MP(p,lp,q,lq,ctx,r); 330 if (!copy) 331 { 332 p_Delete(&p,r); 333 p_Delete(&q,r); 334 } 335 return res; 336 } 337 } 338 #endif 339 #endif 294 340 if (lq < MIN_LENGTH_BUCKET || TEST_OPT_NOT_BUCKETS) 295 341 return _p_Mult_q_Normal(p, q, copy, r); 296 else if ((lq >= MIN_LENGTH_FACTORY) 297 && (r->cf->convSingNFactoryN!=ndConvSingNFactoryN)) 342 else if (pure_polys 343 && (((lq >= MIN_LENGTH_FACTORY) 344 && (r->cf->convSingNFactoryN!=ndConvSingNFactoryN)) 345 || ((lq >= MIN_LENGTH_FACTORY_QQ) 346 && rField_is_Q(r)))) 298 347 { 299 348 poly h=singclap_pmult(p,q,r); … … 307 356 else 308 357 { 309 assume(lp == pLength(p));358 lp=pLength(p); 310 359 assume(lq == pLength(q)); 311 360 return _p_Mult_q_Bucket(p, lp, q, lq, copy, r);
Note: See TracChangeset
for help on using the changeset viewer.