spv {trotter}R Documentation

Selections Pseudo-Vector Constructor

Description

The SPV class defines a pseudo-vector containing all the arranged k-selections (combinations with replacement) of the objects stored in items. The function spv is a constructor for this class.

Usage

spv(k, items)

Arguments

k

the number of objects taken at a time.

items

a vector of objects to be selected.

Details

The selections are arranged according to the order in which the objects appear in items. The arrangement is very similar to the arrangement of combinations (see cpv) except that objects may be repeatedly selected.

Value

an instance of SPV.

Author(s)

Richard Ambler

References

Steinhaus-Johnson-Trotter algorithm. (2014, April 29). In Wikipedia, The Free Encyclopedia. Retrieved 13:24, September 5, 2014

See Also

Permutations Pseudo-Vector ppv

Combinations Pseudo-Vector cpv

Amalgams Pseudo-Vector apv

Subsets Pseudo-Vector sspv

Examples

# create a pseudo-vector of 10-selections from the first 15 letters
s <- spv(10, letters[1:15])
# generate a description
print(s)
# compatable with length
length(s)
# inspect a few of the combinations "stored" in s
s[1]
s[1000]
s[1961256]

[Package trotter version 0.6 Index]