PETSc version 3.16.5
Fix/Edit manual page

# PetscDTPermIndex

Encode a permutation of n into an integer in [0, n!). This inverts PetscDTEnumPerm.

### Input Parameters

| n | - a non-negative integer (see note about limits below)
| perm | - the permuted list of the integers [0, ..., n-1]

### Output Parameters

| k | - an integer in [0, n!)
| isOdd | - if not NULL, returns wether the permutation used an even or odd number of swaps.

Note: this is limited to n such that n! can be represented by PetscInt, which is 12 if PetscInt is a signed 32-bit integer and 20 if PetscInt is a signed 64-bit integer.

### Level

beginner

### Location

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