private static ComputeMultilineReordering ( sbyte levels, int linebreaks ) : int[] | ||
levels | sbyte | |
linebreaks | int | |
return | int[] |
private static int[] ComputeMultilineReordering(sbyte[] levels, int[] linebreaks)
{
int[] result = new int[levels.Length];
int start = 0;
for (int i = 0; i < linebreaks.Length; ++i) {
int limit = linebreaks[i];
sbyte[] templevels = new sbyte[limit - start];
Array.Copy(levels, start, templevels, 0, templevels.Length);
int[] temporder = ComputeReordering(templevels);
for (int j = 0; j < temporder.Length; ++j) {
result[start + j] = temporder[j] + start;
}
start = limit;
}
return result;
}