benchmark preparations

This commit is contained in:
Daniel Langbein 2024-12-09 10:40:20 +00:00
parent b08816b9a4
commit a84ec84903
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
2 changed files with 7 additions and 3 deletions

View File

@ -61,7 +61,7 @@ import java.util.Comparator;
*
* @author Josh Bloch
*/
class TimSort<T> {
public class TimSort<T> {
/**
* This is the minimum sized sequence that will be merged. Shorter
* sequences will be lengthened by calling binarySort. If the entire
@ -209,7 +209,7 @@ class TimSort<T> {
* @param workLen usable size of work array
* @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) {
assert c != null && a != null && lo >= 0 && lo <= hi && hi <= a.length;

View File

@ -1,5 +1,7 @@
package de.uni_marburg.powersort.benchmark;
import de.uni_marburg.powersort.TimSort;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
@ -25,7 +27,9 @@ public class Main {
static Method[] getSortImplementations() throws NoSuchMethodException {
return new Method[]{
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),
};
}