Package stdlib
Class DoublingTest
java.lang.Object
stdlib.DoublingTest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddOps(int count) During a doubling test, the provided code may callincOpsand/oraddOps.static voidincOps()During a doubling test, the provided code may callincOpsand/oraddOps.static voidrun(int initialValue, int numValues, int numTestsPerValue, Consumer<Integer> setup, Consumer<Integer> timed) See fully parameterizedrunfor a description.static <T> voidrun(int initialValue, int numValues, int numTestsPerValue, Function<Integer, T> setup, BiConsumer<Integer, T> timed) Run the functiontimedwith increasing large values for the first integer parameter (N).static <T> voidrun(int initialValue, int numValues, int numTestsPerValue, Function<Integer, T> setup, Consumer<T> timed) See fully parameterizedrunfor a description.static voidSee fully parameterizedrunfor a description.static voidSee fully parameterizedrunfor a description.static <T> voidrun(int initialValue, int numValues, Function<Integer, T> setup, BiConsumer<Integer, T> timed) See fully parameterizedrunfor a description.static <T> voidSee fully parameterizedrunfor a description.static voidrunLong(long initialValue, int numValues, int numTestsPerValue, Consumer<Long> setup, Consumer<Long> timed) See fully parameterizedrunLongfor a description.static <T> voidrunLong(long initialValue, int numValues, int numTestsPerValue, Function<Long, T> setup, BiConsumer<Long, T> timed) Run the functiontimedwith increasing large values for the first integer parameter (N).static <T> voidrunLong(long initialValue, int numValues, int numTestsPerValue, Function<Long, T> setup, Consumer<T> timed) See fully parameterizedrunLongfor a description.static voidSee fully parameterizedrunLongfor a description.static voidSee fully parameterizedrunLongfor a description.static <T> voidrunLong(long initialValue, int numValues, Function<Long, T> setup, BiConsumer<Long, T> timed) See fully parameterizedrunLongfor a description.static <T> voidSee fully parameterizedrunLongfor a description.
-
Constructor Details
-
DoublingTest
public DoublingTest()
-
-
Method Details
-
incOps
During a doubling test, the provided code may callincOpsand/oraddOps. If either is called, then the number of operations so recorded will be reported byrun. -
addOps
During a doubling test, the provided code may callincOpsand/oraddOps. If either is called, then the number of operations so recorded will be reported byrun. -
run
See fully parameterizedrunfor a description. In this abbreviated form,numTestsPerValueis 1.setupdoes nothing, therefore no value is provided totimed. -
run
public static void run(int initialValue, int numValues, Consumer<Integer> setup, Consumer<Integer> timed) See fully parameterizedrunfor a description. In this abbreviated form,numTestsPerValueis 1. No value is passed fromsetuptotimed. -
run
public static void run(int initialValue, int numValues, int numTestsPerValue, Consumer<Integer> setup, Consumer<Integer> timed) See fully parameterizedrunfor a description. In this abbreviated form, no value is passed fromsetuptotimed. -
run
public static <T> void run(int initialValue, int numValues, Function<Integer, T> setup, BiConsumer<Integer, T> timed) See fully parameterizedrunfor a description. In this abbreviated form,numTestsPerValueis 1. -
run
public static <T> void run(int initialValue, int numValues, int numTestsPerValue, Function<Integer, T> setup, Consumer<T> timed) See fully parameterizedrunfor a description. In this abbreviated form, the integer value is not passed totimed. -
run
public static <T> void run(int initialValue, int numValues, Function<Integer, T> setup, Consumer<T> timed) See fully parameterizedrunfor a description. In this abbreviated form,numTestsPerValueis 1. The integer value is not passed totimed. -
run
public static <T> void run(int initialValue, int numValues, int numTestsPerValue, Function<Integer, T> setup, BiConsumer<Integer, T> timed) Run the functiontimedwith increasing large values for the first integer parameter (N). Running time is reported to the console. Initial value of N is given byinitialValue. N doubles each time the test is run. The number of different values for N is given bynumValues. IfnumTestsPerValueis larger than one, then the test will be run multiple times for each N, and the average time reported. Thesetupfunction is called beforetimed, and the result (of type T) is provided totimedas the second parameter.setupis called once before each call totimed. -
runLong
See fully parameterizedrunLongfor a description. In this abbreviated form,numTestsPerValueis 1.setupdoes nothing, therefore no value is provided totimed. -
runLong
public static void runLong(long initialValue, int numValues, Consumer<Long> setup, Consumer<Long> timed) See fully parameterizedrunLongfor a description. In this abbreviated form,numTestsPerValueis 1. No value is passed fromsetuptotimed. -
runLong
public static void runLong(long initialValue, int numValues, int numTestsPerValue, Consumer<Long> setup, Consumer<Long> timed) See fully parameterizedrunLongfor a description. In this abbreviated form, no value is passed fromsetuptotimed. -
runLong
public static <T> void runLong(long initialValue, int numValues, Function<Long, T> setup, BiConsumer<Long, T> timed) See fully parameterizedrunLongfor a description. In this abbreviated form,numTestsPerValueis 1. -
runLong
public static <T> void runLong(long initialValue, int numValues, int numTestsPerValue, Function<Long, T> setup, Consumer<T> timed) See fully parameterizedrunLongfor a description. In this abbreviated form, the integer value is not passed totimed. -
runLong
public static <T> void runLong(long initialValue, int numValues, Function<Long, T> setup, Consumer<T> timed) See fully parameterizedrunLongfor a description. In this abbreviated form,numTestsPerValueis 1. The integer value is not passed totimed. -
runLong
public static <T> void runLong(long initialValue, int numValues, int numTestsPerValue, Function<Long, T> setup, BiConsumer<Long, T> timed) Run the functiontimedwith increasing large values for the first integer parameter (N). Running time is reported to the console. Initial value of N is given byinitialValue. N doubles each time the test is runLong. The number of different values for N is given bynumValues. IfnumTestsPerValueis larger than one, then the test will be runLong multiple times for each N, and the average time reported. Thesetupfunction is called beforetimed, and the result (of type T) is provided totimedas the second parameter.setupis called once before each call totimed.
-