/** * Sorts the data in the array. * @param data Data which is to be sorted. Sorted data is written back into this same array * @param begin First element to be sorted (inclusive) * @param end Last element to be sorted (exclusive) */ public void sort( int data[] , int begin , int end ) { histogram.fill(0); for( int i = begin; i < end; i++ ) { histogram.data[data[i]-minValue]++; } // over wrist the input data with sorted elements int index = begin; for( int i = 0; i < histogram.size; i++ ) { int N = histogram.get(i); int value = i+minValue; for( int j = 0; j < N; j++ ) { data[index++] = value; } } }
/** * Sorts the data in the array. * @param data Data which is to be sorted. Sorted data is written back into this same array * @param begin First element to be sorted (inclusive) * @param end Last element to be sorted (exclusive) */ public void sort( int data[] , int begin , int end ) { histogram.fill(0); for( int i = begin; i < end; i++ ) { histogram.data[data[i]-minValue]++; } // over wrist the input data with sorted elements int index = begin; for( int i = 0; i < histogram.size; i++ ) { int N = histogram.get(i); int value = i+minValue; for( int j = 0; j < N; j++ ) { data[index++] = value; } } }
/** * Sort routine which does not modify the input array. Input and output arrays can be the same instance. * * @param input (Input) Data which is to be sorted. Not modified. * @param startIndex First element in input list * @param output (Output) Sorted data. Modified. * @param length Number of elements */ public void sort( int input[] , int startIndex ,int output[] , int startOutput , int length ) { histogram.fill(0); for( int i = 0; i < length; i++ ) { histogram.data[input[i+startIndex]-minValue]++; } // over wrist the input data with sorted elements int index = startOutput; for( int i = 0; i < histogram.size; i++ ) { int N = histogram.get(i); int value = i+minValue; for( int j = 0; j < N; j++ ) { output[index++] = value; } } }
/** * Sort routine which does not modify the input array. Input and output arrays can be the same instance. * * @param input (Input) Data which is to be sorted. Not modified. * @param startIndex First element in input list * @param output (Output) Sorted data. Modified. * @param length Number of elements */ public void sort( int input[] , int startIndex ,int output[] , int startOutput , int length ) { histogram.fill(0); for( int i = 0; i < length; i++ ) { histogram.data[input[i+startIndex]-minValue]++; } // over wrist the input data with sorted elements int index = startOutput; for( int i = 0; i < histogram.size; i++ ) { int N = histogram.get(i); int value = i+minValue; for( int j = 0; j < N; j++ ) { output[index++] = value; } } }
totals.fill(0);
totals.fill(0);
Arrays.fill(workClusters.data[i],0); memberCount.fill(0);
Arrays.fill(workClusters.data[i],0); memberCount.fill(0);
regionMemberCount.fill(0);