PetscRealSortSemiOrderedWithArrayInt#
Sorts an array of PetscReal
in place in increasing order and reorders a second array of PetscInt
to match the first.
Synopsis#
#include "petscsys.h"
PetscErrorCode PetscRealSortSemiOrderedWithArrayInt(PetscInt n, PetscReal arr1[], PetscInt arr2[])
Not Collective
Input Parameter#
n - number of values
Input/Output Parameters#
Notes#
This function serves as an alternative to PetscSortRealWithArray()
. While this function works for any array of PetscReal
it is
significantly faster if the array is not totally random. There are exceptions to this and so it is highly
recommended that the user benchmark their code to see which routine is fastest.
See Also#
PetscTimSortWithArray()
, PetscSortRealWithArrayInt()
, PetscSortRealWithPermutation()
Level#
intermediate
Location#
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages