PetscSortSplit — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# PetscSortSplit

Quick-sort split of an array of `PetscScalar`s in place.

## Synopsis

    #include "petscsys.h"
    PetscErrorCode PetscSortSplit(PetscInt ncut, PetscInt n, PetscScalar a[], PetscInt idx[])

Not Collective

## Input Parameters

- ncut - splitting index

- n - number of values to sort

## Input/Output Parameters

- a - array of values, on output the values are permuted such that its elements satisfy: abs(a[i]) >= abs(a[ncut-1]) for i < ncut and abs(a[i]) <= abs(a[ncut-1]) for i >= ncut

- idx - index for array a, on output permuted accordingly

## See Also

`PetscSortInt()`, `PetscSortRealWithPermutation()`

## Level

intermediate

## Location

src/sys/utils/sortd.c

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