[Ecm-dev] Proposal from George. Literally.

Paul Zimmermann Paul.Zimmermann at loria.fr
Lun 9 Mai 21:19:26 CEST 2005

   Unfortunately, the Crandall code will still need to be linked in.  So, I'll 
   normalize the
   result and if I'm summarizing the previous email correctly the interface 
   will be:

   int ecmStage1 (
   double k,
   unsigned long b,
   unsigned long n,
   long c,
   unsigned long *num_being_factored_array,
   unsigned long num_being_factored_array_len,
   unsigned long B1,
   unsigned long *B1done,
   unsigned long *A_array,
   unsigned long A_array_len,
   unsigned long *x_array,
   unsigned long *x_array_len,
   int (*stop_check_proc)())


   0 = success, but no factor
   1 = factor found (during sigma->A conversion or normalization)
   2 = could not handle this k,b,n,c combination
   3 = out_of_memory
   4 = execution halted before completion

Two proposals:

1) to avoid passing both array pointers and their lengths, we could
   assume that the length is stored in A_array[0] or A_array[-1]
2) to enable adding more arguments in the future without breaking
   the interface, we could have:
   int ecmStage1 (unsigned long *ptr, unsigned long ptr_len)
   where ptr[0] = k
         ptr[1] = b
         ptr[2] = c
         ptr[3] = num_being_factored_array
         ptr[11] = (*stop_check_proc())
   and ptr_len is the length of ptr[] (could be used to identify the version
   of the interface).


Plus d'informations sur la liste de diffusion Ecm-discuss