PetscSortRealWithPermutation#

Computes the permutation of PetscReal that gives a sorted sequence.

Synopsis#

#include "petscsys.h"  
PetscErrorCode PetscSortRealWithPermutation(PetscInt n, const PetscReal i[], PetscInt idx[])

Not Collective

Input Parameters#

  • n - number of values to sort

  • i - values to sort

  • idx - permutation array. Must be initialized to 0:n-1 on input.

Note#

i is unchanged on output.

See Also#

PetscSortReal(), PetscSortIntWithPermutation()

Level#

intermediate

Location#

src/sys/utils/sortip.c

Examples#

src/snes/tutorials/ex13.c
src/ts/tutorials/extchem.c


Edit on GitLab

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages