# NOT RUN {
library(simplextree)
all(nat_to_sub(seq(choose(100,2)), n = 100, k = 2) == combn(100,2))
## Generating pairwise combinadics is particularly fast
## Below: test to generate ~ 45k combinadics (note: better to use microbenchmark)
system.time({
x <- seq(choose(300,2))
nat_to_sub(x, n = 300, k = 2L)
})
## Compare with generating raw combinations
system.time(combn(300,2))
# }
Run the code above in your browser using DataLab