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.

19 lines
441 B

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