15 #error "intDsize too small for trialdivision!"
20 uint32 cl_trialdivision (const cl_I& n, uint32 d1, uint32 d2)
22 var uintL i = cl_small_prime_table_search(d1);
23 var const uint16 * ptr = &cl_small_prime_table[i];
24 var const uint16 * ptr_limit = &cl_small_prime_table[cl_small_prime_table_search(d2+1)];
27 var const uintD* n_MSDptr;
29 I_to_NDS_nocopy(n, n_MSDptr=,n_len=,,cl_false,);
30 if (mspref(n_MSDptr,0)==0) { msshrink(n_MSDptr); n_len--; }
31 // Make room for a quotient.
33 num_stack_alloc(n_len,q_MSDptr=,);
35 for ( ; ptr < ptr_limit; ptr++) {
36 var uint32 prime = *ptr;
37 var uintD r = divucopy_loop_msp(prime,n_MSDptr,q_MSDptr,n_len);