gen01pat {lazy.tools}R Documentation

Generate all possible 0-1 patterns of given length.

Description

Generate all possible 0-1 patterns of given length.

Usage

gen01pat(nitems, sort = 0, print = 0)

Arguments

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

Details

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.

Value

2^nitems x nitems matrix

Examples

gen01pat( 6, print=1 )


[Package lazy.tools version 0.1.3 Index]