mul.praat 478 B

123456789101112131415161718192021222324252627
  1. # mul.praat
  2. iterations = 1000
  3. size = 1000
  4. vec# = zero# (size)
  5. mat## = zero## (size, size)
  6. vecje# = zero# (1)
  7. matje## = zero## (1, 1)
  8. stopwatch
  9. for i to iterations
  10. b## = mat##
  11. endfor
  12. writeInfoLine: stopwatch * 1e9 / size ^ 2 / iterations
  13. stopwatch
  14. for i to iterations
  15. a# = mul# (vec#, mat##)
  16. endfor
  17. appendInfoLine: stopwatch * 1e9 / size ^ 2 / iterations
  18. stopwatch
  19. for i to iterations
  20. a# = mul# (mat##, vec#)
  21. endfor
  22. appendInfoLine: stopwatch * 1e9 / size ^ 2 / iterations