C# Class CSharpGL.SortingHelper

Helper class for sorting unmanaged array.
Show file Open project: bitzhuwei/CSharpGL

Public Methods

Method Description
Sort ( IntPtr array, int start, int length, Comparer comparer ) : void

Sort unmanaged array specified with array at specified area.

Sort ( IntPtr array, int start, int length, bool descending ) : void

Sort unmanaged array specified with array at specified area.

Private Methods

Method Description
QuickSort ( IntPtr array, Comparer comparer, Stack stack ) : void
QuickSort ( IntPtr array, bool descending, Stack stack ) : void
QuickSort ( IntPtr array, int start, int end, Comparer comparer ) : void
QuickSort ( IntPtr array, int start, int end, bool descending ) : void
QuickSortPartion ( TemplateStructType array, int start, int end, Comparer comparer ) : int
QuickSortPartion ( TemplateStructType array, int start, int end, bool descending ) : int
Test ( ) : void

Method Details

Sort() public static method

Sort unmanaged array specified with array at specified area.
public static Sort ( IntPtr array, int start, int length, Comparer comparer ) : void
array System.IntPtr
start int index of first value to be sorted.
length int length of to bo sorted.
comparer Comparer /// If you want descending sort, make it returns -1 when [left] < [right]. /// Otherwise, make it returns -1 when [left] > [right].
return void

Sort() public static method

Sort unmanaged array specified with array at specified area.
public static Sort ( IntPtr array, int start, int length, bool descending ) : void
array System.IntPtr
start int index of first value to be sorted.
length int length of to bo sorted.
descending bool true for descending sort; otherwise false.
return void