sub_to_nat: sub_to_nat

Description Usage Arguments Details Value References

View source: R/combinadic.R

Description

Given a combination x, computes its position out of all lexicographically-ordered (n choose 2) combinations.

Usage

1
sub_to_nat(x, n)

Arguments

x

matrix whose columns represent k-combinations.

n

numerator of the binomial coefficient

Details

The mapping is done via an lexicographically-ordered combinadic mapping.

Value

integer vector of the positions of the given combinations.

References

McCaffrey, J. D. "Generating the mth lexicographical element of a mathematical combination." MSDN Library (2004).


simplextree documentation built on Sept. 13, 2020, 5:06 p.m.