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

source("sum1.R")
source("sum2.R")
dyn.load("sum2.so")
comp_sum_funcs <- function(sizes){
msizes = c()
times_1 = c()
times_2 = c()
for(i in sizes) {
m <- matrix(rnorm(i^2), i)
times_1 = append(times_1, summary(system.time(sum1(m)))[1])
times_2 = append(times_2, summary(system.time(sum2(m)))[1])
msizes = append(msizes, i)
}
return(data.frame(size=msizes, sum_1 = times_1, sum_2 = times_2))
}