Displaying 1 result from an estimated 1 matches for "nmmp1".
2007 Jan 19
2
combn implementation
Hi,
I was checking the source code to the function combn that "generates
all combinations of the elements of 'x' taken 'm' at a time.",
because I wished to modify it. I have a doubt about a statement.
This is the main loop.
._1 <- 1:1
nmmp1 <- n - m + ._1
while (a[1] != nmmp1) {
if (e < n - h) {
h <- ._1
e <- a[m]
j <- ._1
}
else {
e <- a[m - h]
h <- h + ._1
j <- 1:h
}
a[m - h + j] <- e + j...