# 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 Parameters

- ***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 Parameter

- ***index -*** the rank of the subset in lexicographic order



## Note
Limited by arguments such that n choose k can be represented by `PetscInt`




## See Also
 `PetscDTEnumSubset()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscdt.h.html#PetscDTSubsetIndex">include/petscdt.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscdt.h)


[Index of all DT routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
