ILNumerics Ultimate VS

ILMath.sort Method (BaseArray<SByte>, OutArray<Int64>, Int32, Boolean)

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Sort elements of A along the specified dimension. Computes indices also.

[ILNumerics Computing Engine]

Namespace:  ILNumerics
Assembly:  ILNumerics.Computing (in ILNumerics.Computing.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax

public static RetArray<sbyte> sort(
	BaseArray<sbyte> A,
	OutArray<long> Indices,
	int dim = -1,
	bool descending = false
)

Parameters

A
Type: ILNumerics.BaseArray<SByte>
Input array.
Indices
Type: ILNumerics.OutArray<Int64>
[Output] On return contains the indices required to sort the array.
dim (Optional)
Type: System.Int32
The index of the working dimension or -1 for determining the working dimension automatically (default).
descending (Optional)
Type: System.Boolean
[Optional] Determins the sorting direction. Default: (false) ascending.

Return Value

Type: RetArray<SByte>
New array with the same shape as A.
Remarks

The working dimension for dim = -1 depends on the value of ArrayStyle. For numpy style it starts with the last dimension to search for a non-singleton dimension. For ILNumericsV4 the search starts with the first dimension (index #0).

If Indices is of the same shape as (non-empty, non-scalar) A on entry, its content is sorted with the values of A. Otherwise and if Indices is null or not of the same shape as A the function will resize Indices and fill it with zero based indices along the working dimension and sort these together with A.

It is recommended to initialize Indices with 0 or empty``1(InArray<Int64> , StorageOrders) to indicate that the indices are required. If A is scalar and Indices is not null, any predefined value of Indices is ignored and 0 is returned in Indices. That means that initializing Indices with 1 or any other scalar literal (for ease of use) does work also, as long as A is not scalar.

[ILNumerics Computing Engine]

See Also

Reference