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.

20 lines
461 B

3 years ago
  1. source("sum1.R")
  2. source("sum2.R")
  3. dyn.load("sum2.so")
  4. comp_sum_funcs <- function(sizes){
  5. msizes = c()
  6. times_1 = c()
  7. times_2 = c()
  8. for(i in sizes) {
  9. m <- matrix(rnorm(i^2), i)
  10. times_1 = append(times_1, summary(system.time(sum1(m)))[1])
  11. times_2 = append(times_2, summary(system.time(sum2(m)))[1])
  12. msizes = append(msizes, i)
  13. }
  14. return(data.frame(size=msizes, sum_1 = times_1, sum_2 = times_2))
  15. }