gen01pat {lazy.tools} | R Documentation |
Generate all possible 0-1 patterns of given length.
gen01pat(nitems, sort = 0, print = 0)
nitems |
The length of the pattern |
sort |
= 1 to sort the result from the left = -1 to sort the result from the right |
print |
= 1 to print the result |
Schatzoff et al method is used.
nitems must be less than log(.Machine$integer.max)/log(2).
Essentially the same as
cprod( rep(list(0:1),nitems) )
but gen01pat is much faster.
2^nitems x nitems matrix
gen01pat( 6, print=1 )