The function generates all the representatives of the bracelets corresponding
to a fixed configuration. If the second parameter (bOut
) is set equal to TRUE
, the function produces a compact result. The third parameter
(fn
) initializes the first value of the alphabet, which by default is equal to 1. For example, to generate all the representatives of the bracelets
corresponding to the fixed configuration (2,1,1)
, run fBracelets(c(2,1,1))
. In such a case the alphabet is {1,2,3}
. Using the nPerm
function of the kStatistics
package, the function first generates all the permutations of the vector (1,1,2,3)
corresponding to the configuration (2,1,1)
, that is
(I) | (3,2,1,1), (2,3,1,1), (3,1,1,2), ..., (1,1,2,3) (12 in total) |
Then the cBracelets
function of the Necklaces
package is called with input equal to each vector in (I)
. For each obtained list, only the representative survives. At the end all the representatives of the bracelets are printed, that are [1 1 2 3], [1 2 1 3]
.