Here's one way to do it. lpSove
actually gives you the num.bin.solns that it finds, and you can access that using the $ notation.
You can initially set the num.bin.solns to be some large number (say 1000). And then access the mylp$num.bin.solns to get the exact value.
mylp <- lp('max', c_, A, signs, b, all.bin = TRUE, num.bin.solns=1000)
numcols <- 4
numsols <- mylp$num.bin.solns
solutions <- matrix(head(mylp$solution, numcols*numsols), nrow=numsols, byrow=TRUE)
> numsols
[1] 6
And you can print out the individual solutions:
> solutions
[,1] [,2] [,3] [,4]
[1,] 0 0 1 1
[2,] 0 1 0 1
[3,] 1 0 0 1
[4,] 1 0 1 0
[5,] 1 1 0 0
[6,] 0 1 1 0
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…