petsc-3.13.6 2020-09-29
Report Typos and Errors

# PetscDTSubsetIndex

Convert an ordered subset of k integers from the set [0, ..., n - 1] to its encoding as an integers in [0, n choose k) in lexicographic order. This is the inverse of PetscDTEnumSubset.

### Input Arguments

| n | - a non-negative integer (see note about limits below)
| k | - an integer in [0, n]
| subset | - an ordered subset of the integers [0, ..., n - 1]

### Output Arguments

index -the rank of the subset in lexicographic order

Note: this is limited by arguments such that n choose k can be represented by PetscInt

### See Also

PetscDTEnumSubset()

### Level

beginner

### Location

src/dm/dt/../../../include/petscdt.h
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages