mirror of
https://gitlab.uni-marburg.de/langbeid/powersort.git
synced 2025-01-21 19:50:35 +01:00
benchmark preparations
This commit is contained in:
parent
b08816b9a4
commit
a84ec84903
@ -61,7 +61,7 @@ import java.util.Comparator;
|
|||||||
*
|
*
|
||||||
* @author Josh Bloch
|
* @author Josh Bloch
|
||||||
*/
|
*/
|
||||||
class TimSort<T> {
|
public class TimSort<T> {
|
||||||
/**
|
/**
|
||||||
* This is the minimum sized sequence that will be merged. Shorter
|
* This is the minimum sized sequence that will be merged. Shorter
|
||||||
* sequences will be lengthened by calling binarySort. If the entire
|
* sequences will be lengthened by calling binarySort. If the entire
|
||||||
@ -209,7 +209,7 @@ class TimSort<T> {
|
|||||||
* @param workLen usable size of work array
|
* @param workLen usable size of work array
|
||||||
* @since 1.8
|
* @since 1.8
|
||||||
*/
|
*/
|
||||||
static <T> void sort(T[] a, int lo, int hi, Comparator<? super T> c,
|
public static <T> void sort(T[] a, int lo, int hi, Comparator<? super T> c,
|
||||||
T[] work, int workBase, int workLen) {
|
T[] work, int workBase, int workLen) {
|
||||||
assert c != null && a != null && lo >= 0 && lo <= hi && hi <= a.length;
|
assert c != null && a != null && lo >= 0 && lo <= hi && hi <= a.length;
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package de.uni_marburg.powersort.benchmark;
|
package de.uni_marburg.powersort.benchmark;
|
||||||
|
|
||||||
|
import de.uni_marburg.powersort.TimSort;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -25,7 +27,9 @@ public class Main {
|
|||||||
static Method[] getSortImplementations() throws NoSuchMethodException {
|
static Method[] getSortImplementations() throws NoSuchMethodException {
|
||||||
return new Method[]{
|
return new Method[]{
|
||||||
DummySort.class.getMethod("sort", Object[].class, int.class, int.class, Comparator.class, Object[].class, int.class, int.class),
|
DummySort.class.getMethod("sort", Object[].class, int.class, int.class, Comparator.class, Object[].class, int.class, int.class),
|
||||||
DummySort2.class.getMethod("sort", Object[].class, int.class, int.class, Comparator.class, Object[].class, int.class, int.class)
|
DummySort2.class.getMethod("sort", Object[].class, int.class, int.class, Comparator.class, Object[].class, int.class, int.class),
|
||||||
|
//
|
||||||
|
TimSort.class.getMethod("sort", Object[].class, int.class, int.class, Comparator.class, Object[].class, int.class, int.class),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user