| cNecklaces {Necklaces} | R Documentation |
Elements in a necklace
Description
The function generates the elements of a necklace in equivalence relation with the vector given in input.
Usage
cNecklaces(v=c(), bOut=FALSE)
Arguments
v |
vector: input vector |
bOut |
boolean: if |
Details
The function generates the elements of a necklace which are in equivalence relation with the vector given in input. The first parameter is the input vector. If the second parameter (bOut) is set equal to TRUE, the function produces a compact result.
Example: cNecklaces(c(1,0,2,1)) produces the following result:
[1] 0 2 1 1 |
[1] 1 0 2 1 |
[1] 1 1 0 2 |
[1] 2 1 1 0 |
cNecklaces(c(1,0,2,1),TRUE) produces the following result:
[ 0 2 1 1 ] ( 1 ) |
[ 1 0 2 1 ] ( 2 ) |
[ 1 1 0 2 ] ( 3 ) |
[ 2 1 1 0 ] ( 4 ) |
Note that 0 2 1 1 is the representative of the class, that is the minimum in lexicographical order.
Value
list |
the list containing all the elements of the necklace in equivalence relation with the vector given in input |
Note
The function is called from the fNecklaces, sBruijn, cBracelets functions in the Necklaces package.
Author(s)
Elvira Di Nardo elvira.dinardo@unito.it,
Giuseppe Guarino giuseppe.guarino@rete.basilicata.it
References
Di Nardo, E., and Guarino., G. (2022) kStatistics: Unbiased Estimates of Joint Cumulant Products from the Multivariate Faa Di Bruno's Formula. The R journal - In press. (https://arxiv.org/abs/2206.15348)
Di Nardo, E., and Guarino., G. (2022) Necklaces and bracelets in R - (https://arxiv.org/abs/2208.06855)
Flajolet, P., and Sedgewick, R. (2009) Analytic combinatorics. Cambridge University press.
See Also
fNecklaces,
sBruijn,
cBracelets
Examples
# Generate the elements of the necklace in equivalence relation with
# the input vector c(1,0,2,1)
cNecklaces(c(1,0,2,1))
# The previous result in a compact form
cNecklaces(c(1,0,2,1),TRUE)