* @param length the maxmium size of the array to be sorted
* @param length the maxmium size of the array to be sorted
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @ArrayType(T)
*/
*/
public static GENERIC_KEY_BRACES void parallelMergeSort(KEY_TYPE[] array, int length, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void parallelMergeSort(KEY_TYPE[] array, int length, COMPARATOR KEY_GENERIC_TYPE comp) {
parallelMergeSort(array, null, 0, length, comp);
parallelMergeSort(array, null, 0, length, comp);
@ -597,6 +630,7 @@ public class ARRAYS
* @param to where the array should be sorted to
* @param to where the array should be sorted to
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @ArrayType(T)
*/
*/
public static GENERIC_KEY_BRACES void parallelMergeSort(KEY_TYPE[] array, KEY_TYPE[] supp, int from, int to, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void parallelMergeSort(KEY_TYPE[] array, KEY_TYPE[] supp, int from, int to, COMPARATOR KEY_GENERIC_TYPE comp) {
if(SanityChecks.canParallelTask() && to - from >= PARALLEL_THRESHOLD) {
if(SanityChecks.canParallelTask() && to - from >= PARALLEL_THRESHOLD) {
@ -611,6 +645,7 @@ public class ARRAYS
* This implementation was copied from <a href="https://github.com/vigna/fastutil">FastUtil</a> with a couple custom optimizations
* This implementation was copied from <a href="https://github.com/vigna/fastutil">FastUtil</a> with a couple custom optimizations
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void parallelMergeSort(KEY_TYPE[] array) {
public static COMPAREABLE_KEY_BRACES void parallelMergeSort(KEY_TYPE[] array) {
parallelMergeSort(array, null, 0, array.length);
parallelMergeSort(array, null, 0, array.length);
@ -622,6 +657,7 @@ public class ARRAYS
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param length the maxmium size of the array to be sorted
* @param length the maxmium size of the array to be sorted
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void parallelMergeSort(KEY_TYPE[] array, int length) {
public static COMPAREABLE_KEY_BRACES void parallelMergeSort(KEY_TYPE[] array, int length) {
parallelMergeSort(array, null, 0, length);
parallelMergeSort(array, null, 0, length);
@ -635,6 +671,7 @@ public class ARRAYS
* @param from where the array should be sorted from
* @param from where the array should be sorted from
* @param to where the array should be sorted to
* @param to where the array should be sorted to
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void parallelMergeSort(KEY_TYPE[] array, KEY_TYPE[] supp, int from, int to) {
public static COMPAREABLE_KEY_BRACES void parallelMergeSort(KEY_TYPE[] array, KEY_TYPE[] supp, int from, int to) {
if(SanityChecks.canParallelTask() && to - from >= PARALLEL_THRESHOLD) {
if(SanityChecks.canParallelTask() && to - from >= PARALLEL_THRESHOLD) {
@ -649,6 +686,7 @@ public class ARRAYS
* This implementation is inspired by <a href="https://github.com/vigna/fastutil">FastUtil</a> original merge sort, but without the need to allocate a copy of the original Array. It is in Very Unsorted Instances 50% slower then Mergesort, otherwise it as fast.
* This implementation is inspired by <a href="https://github.com/vigna/fastutil">FastUtil</a> original merge sort, but without the need to allocate a copy of the original Array. It is in Very Unsorted Instances 50% slower then Mergesort, otherwise it as fast.
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @ArrayType(T)
*/
*/
public static GENERIC_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array, COMPARATOR KEY_GENERIC_TYPE comp) {
memFreeMergeSort(array, 0, array.length, comp);
memFreeMergeSort(array, 0, array.length, comp);
@ -660,6 +698,7 @@ public class ARRAYS
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param length the maxmium size of the array to be sorted
* @param length the maxmium size of the array to be sorted
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @ArrayType(T)
*/
*/
public static GENERIC_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array, int length, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array, int length, COMPARATOR KEY_GENERIC_TYPE comp) {
memFreeMergeSort(array, 0, length, comp);
memFreeMergeSort(array, 0, length, comp);
@ -672,6 +711,7 @@ public class ARRAYS
* @param from where the array should be sorted from
* @param from where the array should be sorted from
* @param to where the array should be sorted to
* @param to where the array should be sorted to
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @ArrayType(T)
*/
*/
public static GENERIC_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array, int from, int to, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array, int from, int to, COMPARATOR KEY_GENERIC_TYPE comp) {
if(to - from < BASE_THRESHOLD) {
if(to - from < BASE_THRESHOLD) {
@ -719,6 +759,7 @@ public class ARRAYS
* It does stack allocate tiny amounts of data for shifting around elements.
* It does stack allocate tiny amounts of data for shifting around elements.
* @author Speiger
* @author Speiger
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array) {
public static COMPAREABLE_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array) {
memFreeMergeSort(array, 0, array.length);
memFreeMergeSort(array, 0, array.length);
@ -732,6 +773,7 @@ public class ARRAYS
* @author Speiger
* @author Speiger
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param length the maxmium size of the array to be sorted
* @param length the maxmium size of the array to be sorted
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array, int length) {
public static COMPAREABLE_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array, int length) {
memFreeMergeSort(array, 0, length);
memFreeMergeSort(array, 0, length);
@ -746,6 +788,7 @@ public class ARRAYS
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param from where the array should be sorted from
* @param from where the array should be sorted from
* @param to where the array should be sorted to
* @param to where the array should be sorted to
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array, int from, int to) {
public static COMPAREABLE_KEY_BRACES void memFreeMergeSort(KEY_TYPE[] array, int from, int to) {
if(to - from < BASE_THRESHOLD) {
if(to - from < BASE_THRESHOLD) {
@ -795,6 +838,7 @@ public class ARRAYS
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @ArrayType(T)
*/
*/
public static GENERIC_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array, COMPARATOR KEY_GENERIC_TYPE comp) {
* @param length the maxmium size of the array to be sorted
* @param length the maxmium size of the array to be sorted
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @ArrayType(T)
*/
*/
public static GENERIC_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array, int length, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array, int length, COMPARATOR KEY_GENERIC_TYPE comp) {
parallelMemFreeMergeSort(array, 0, length, comp);
parallelMemFreeMergeSort(array, 0, length, comp);
@ -826,6 +871,7 @@ public class ARRAYS
* @param to where the array should be sorted to
* @param to where the array should be sorted to
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @ArrayType(T)
*/
*/
public static GENERIC_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array, int from, int to, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array, int from, int to, COMPARATOR KEY_GENERIC_TYPE comp) {
if(SanityChecks.canParallelTask() && to - from >= PARALLEL_THRESHOLD) {
if(SanityChecks.canParallelTask() && to - from >= PARALLEL_THRESHOLD) {
@ -843,6 +889,7 @@ public class ARRAYS
* @author Speiger
* @author Speiger
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array) {
public static COMPAREABLE_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array) {
parallelMemFreeMergeSort(array, 0, array.length);
parallelMemFreeMergeSort(array, 0, array.length);
@ -857,6 +904,7 @@ public class ARRAYS
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param length the maxmium size of the array to be sorted
* @param length the maxmium size of the array to be sorted
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array, int length) {
public static COMPAREABLE_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array, int length) {
parallelMemFreeMergeSort(array, 0, length);
parallelMemFreeMergeSort(array, 0, length);
@ -872,6 +920,7 @@ public class ARRAYS
* @param from where the array should be sorted from
* @param from where the array should be sorted from
* @param to where the array should be sorted to
* @param to where the array should be sorted to
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array, int from, int to) {
public static COMPAREABLE_KEY_BRACES void parallelMemFreeMergeSort(KEY_TYPE[] array, int from, int to) {
if(SanityChecks.canParallelTask() && to - from >= PARALLEL_THRESHOLD) {
if(SanityChecks.canParallelTask() && to - from >= PARALLEL_THRESHOLD) {
@ -887,6 +936,7 @@ public class ARRAYS
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @ArrayType(T)
*/
*/
public static GENERIC_KEY_BRACES void quickSort(KEY_TYPE[] array, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void quickSort(KEY_TYPE[] array, COMPARATOR KEY_GENERIC_TYPE comp) {
quickSort(array, 0, array.length, comp);
quickSort(array, 0, array.length, comp);
@ -899,6 +949,7 @@ public class ARRAYS
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param length the maxmium size of the array to be sorted
* @param length the maxmium size of the array to be sorted
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @ArrayType(T)
*/
*/
public static GENERIC_KEY_BRACES void quickSort(KEY_TYPE[] array, int length, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void quickSort(KEY_TYPE[] array, int length, COMPARATOR KEY_GENERIC_TYPE comp) {
quickSort(array, 0, length, comp);
quickSort(array, 0, length, comp);
@ -912,6 +963,7 @@ public class ARRAYS
* @param from where the array should be sorted from
* @param from where the array should be sorted from
* @param to where the array should be sorted to
* @param to where the array should be sorted to
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @ArrayType(T)
*/
*/
public static GENERIC_KEY_BRACES void quickSort(KEY_TYPE[] array, int from, int to, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void quickSort(KEY_TYPE[] array, int from, int to, COMPARATOR KEY_GENERIC_TYPE comp) {
int length = to - from;
int length = to - from;
@ -942,6 +994,7 @@ public class ARRAYS
* This implementation is a custom of <a href="https://github.com/vigna/fastutil">FastUtil</a> quicksort but with a different code structure,
* This implementation is a custom of <a href="https://github.com/vigna/fastutil">FastUtil</a> quicksort but with a different code structure,
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void quickSort(KEY_TYPE[] array) {
public static COMPAREABLE_KEY_BRACES void quickSort(KEY_TYPE[] array) {
quickSort(array, 0, array.length);
quickSort(array, 0, array.length);
@ -953,6 +1006,7 @@ public class ARRAYS
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param length the maxmium size of the array to be sorted
* @param length the maxmium size of the array to be sorted
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void quickSort(KEY_TYPE[] array, int length) {
public static COMPAREABLE_KEY_BRACES void quickSort(KEY_TYPE[] array, int length) {
quickSort(array, 0, length);
quickSort(array, 0, length);
@ -965,6 +1019,7 @@ public class ARRAYS
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param from where the array should be sorted from
* @param from where the array should be sorted from
* @param to where the array should be sorted to
* @param to where the array should be sorted to
* @ArrayType(T)
*/
*/
public static COMPAREABLE_KEY_BRACES void quickSort(KEY_TYPE[] array, int from, int to) {
public static COMPAREABLE_KEY_BRACES void quickSort(KEY_TYPE[] array, int from, int to) {
int length = to - from;
int length = to - from;
@ -996,6 +1051,7 @@ public class ARRAYS
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @ArrayType(T)
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
*/
*/
public static GENERIC_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array, COMPARATOR KEY_GENERIC_TYPE comp) {
@ -1009,6 +1065,7 @@ public class ARRAYS
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param length the maxmium size of the array to be sorted
* @param length the maxmium size of the array to be sorted
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @ArrayType(T)
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
*/
*/
public static GENERIC_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array, int length, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array, int length, COMPARATOR KEY_GENERIC_TYPE comp) {
@ -1023,6 +1080,7 @@ public class ARRAYS
* @param from where the array should be sorted from
* @param from where the array should be sorted from
* @param to where the array should be sorted to
* @param to where the array should be sorted to
* @param comp the Comparator that decides the sorting order
* @param comp the Comparator that decides the sorting order
* @ArrayType(T)
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
*/
*/
public static GENERIC_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array, int from, int to, COMPARATOR KEY_GENERIC_TYPE comp) {
public static GENERIC_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array, int from, int to, COMPARATOR KEY_GENERIC_TYPE comp) {
@ -1038,6 +1096,7 @@ public class ARRAYS
* This implementation is a custom of <a href="https://github.com/vigna/fastutil">FastUtil</a> quicksort but with a different code structure,
* This implementation is a custom of <a href="https://github.com/vigna/fastutil">FastUtil</a> quicksort but with a different code structure,
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @ArrayType(T)
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
*/
*/
public static COMPAREABLE_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array) {
public static COMPAREABLE_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array) {
@ -1050,6 +1109,7 @@ public class ARRAYS
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* and that sorting Algorithm is based on the tuned quicksort adapted from Jon L. Bentley and M. DouglasMcIlroy, "Engineering a Sort Function", Software: Practice and Experience, 23(11), pages1249−1265, 1993.
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param length the maxmium size of the array to be sorted
* @param length the maxmium size of the array to be sorted
* @ArrayType(T)
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
*/
*/
public static COMPAREABLE_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array, int length) {
public static COMPAREABLE_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array, int length) {
@ -1063,6 +1123,7 @@ public class ARRAYS
* @param array the array that needs to be sorted
* @param array the array that needs to be sorted
* @param from where the array should be sorted from
* @param from where the array should be sorted from
* @param to where the array should be sorted to
* @param to where the array should be sorted to
* @ArrayType(T)
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
* @note This parallelization is invoked through {@link SanityChecks#invokeTask} which the threadpool can be changed as needed
*/
*/
public static COMPAREABLE_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array, int from, int to) {
public static COMPAREABLE_KEY_BRACES void parallelQuickSort(KEY_TYPE[] array, int from, int to) {
* Returns a Immutable EmptyList instance that is automatically casted.
* Returns a Immutable EmptyList instance that is automatically casted.
* @Type(T)
* @return an empty list
* @return an empty list
*/
*/
public static GENERIC_KEY_BRACES EmptyList KEY_GENERIC_TYPE emptyList() {
public static GENERIC_KEY_BRACES EmptyList KEY_GENERIC_TYPE emptyList() {
@ -35,6 +36,7 @@ public class LISTS
/**
/**
* Returns a Immutable List instance based on the instance given.
* Returns a Immutable List instance based on the instance given.
* @param l that should be made immutable/unmodifyable
* @param l that should be made immutable/unmodifyable
* @Type(T)
* @return a unmodifiable list wrapper. If the list is implementing RandomAccess that is also transferred. If the List already a unmodifyable wrapper then it just returns itself.
* @return a unmodifiable list wrapper. If the list is implementing RandomAccess that is also transferred. If the List already a unmodifyable wrapper then it just returns itself.
*/
*/
public static GENERIC_KEY_BRACES LIST KEY_GENERIC_TYPE unmodifiableList(LIST KEY_GENERIC_TYPE l) {
public static GENERIC_KEY_BRACES LIST KEY_GENERIC_TYPE unmodifiableList(LIST KEY_GENERIC_TYPE l) {
@ -44,6 +46,7 @@ public class LISTS
/**
/**
* Returns a synchronized List instance based on the instance given.
* Returns a synchronized List instance based on the instance given.
* @param l that should be synchronized
* @param l that should be synchronized
* @Type(T)
* @return a synchronized list wrapper. If the list is implementing RandomAccess or IARRAY that is also transferred. If the List already a synchronized wrapper then it just returns itself.
* @return a synchronized list wrapper. If the list is implementing RandomAccess or IARRAY that is also transferred. If the List already a synchronized wrapper then it just returns itself.
*/
*/
public static GENERIC_KEY_BRACES LIST KEY_GENERIC_TYPE synchronizedList(LIST KEY_GENERIC_TYPE l) {
public static GENERIC_KEY_BRACES LIST KEY_GENERIC_TYPE synchronizedList(LIST KEY_GENERIC_TYPE l) {
@ -54,6 +57,7 @@ public class LISTS
* Returns a synchronized List instance based on the instance given.
* Returns a synchronized List instance based on the instance given.
* @param l that should be synchronized
* @param l that should be synchronized
* @param mutex is the controller of the synchronization block.
* @param mutex is the controller of the synchronization block.
* @Type(T)
* @return a synchronized list wrapper. If the list is implementing RandomAccess or IARRAY that is also transferred. If the List already a synchronized wrapper then it just returns itself.
* @return a synchronized list wrapper. If the list is implementing RandomAccess or IARRAY that is also transferred. If the List already a synchronized wrapper then it just returns itself.
*/
*/
public static GENERIC_KEY_BRACES LIST KEY_GENERIC_TYPE synchronizedList(LIST KEY_GENERIC_TYPE l, Object mutex) {
public static GENERIC_KEY_BRACES LIST KEY_GENERIC_TYPE synchronizedList(LIST KEY_GENERIC_TYPE l, Object mutex) {
@ -63,6 +67,7 @@ public class LISTS
/**
/**
* Creates a Unmodifiable Singleton list
* Creates a Unmodifiable Singleton list
* @param element that should be used in the Singleton
* @param element that should be used in the Singleton
* @Type(T)
* @return a singleton list that is unmodifiable
* @return a singleton list that is unmodifiable
*/
*/
public static GENERIC_KEY_BRACES LIST KEY_GENERIC_TYPE singletonList(KEY_TYPE element) {
public static GENERIC_KEY_BRACES LIST KEY_GENERIC_TYPE singletonList(KEY_TYPE element) {