Пример #1
0
        public static sbyte[] SortCounting(this sbyte[] inputArray)
        {
            sbyte[] sortedArray = new sbyte[inputArray.Length];

            int[] counts = inputArray.Histogram();

            int startIndex = 0;

            for (uint countIndex = 0; countIndex < counts.Length; countIndex++)
            {
                sortedArray.FillUsingBlockCopy((sbyte)(countIndex - 128), startIndex, counts[countIndex]);
                //sortedArray.FillSse((sbyte)countIndex, startIndex, counts[countIndex]);
                startIndex += counts[countIndex];
            }

            return(sortedArray);
        }