You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
821 B

25 years ago
25 years ago
25 years ago
25 years ago
  1. #include <cln/number.h>
  2. #include <cln/io.h>
  3. #include <cln/integer.h>
  4. #include "cl_DS.h"
  5. #include "cl_2DS.h"
  6. #include <cln/random.h>
  7. #include "cl_random_impl.h"
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #include <cln/timing.h>
  11. int main (int argc, char * argv[])
  12. {
  13. int repetitions = 1;
  14. if ((argc >= 3) && !strcmp(argv[1],"-r")) {
  15. repetitions = atoi(argv[2]);
  16. argc -= 2; argv += 2;
  17. }
  18. if (argc < 2)
  19. exit(1);
  20. uintL len = atoi(argv[1]);
  21. SAVE_NUM_STACK;
  22. uintD* a_MSDptr;
  23. uintD* a_LSDptr;
  24. uintD* b_MSDptr;
  25. uintD* b_LSDptr;
  26. num_stack_alloc(len,a_MSDptr=,a_LSDptr=);
  27. num_stack_alloc(len,b_MSDptr=,b_LSDptr=);
  28. random_UDS(default_random_state,a_MSDptr,len);
  29. lspref(a_LSDptr,0) |= 1; // force a to be odd
  30. { CL_TIMING;
  31. for (int rep = repetitions; rep > 0; rep--)
  32. { recip2adic(len,a_LSDptr,b_LSDptr); }
  33. }
  34. }