Package stdlib
Class DoublingTest
java.lang.Object
stdlib.DoublingTest
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.private static <T> voidrunOnce(int value, int numTestsPerValue, Function<Integer, T> setup, BiConsumer<Integer, T> timed) private static <T> voidrunOnce(long value, int numTestsPerValue, Function<Long, T> setup, BiConsumer<Long, T> timed) 
- 
Field Details- 
time
- 
ops
 
- 
- 
Constructor Details- 
DoublingTestpublic DoublingTest()
 
- 
- 
Method Details- 
incOpsDuring a doubling test, the provided code may callincOpsand/oraddOps. If either is called, then the number of operations so recorded will be reported byrun.
- 
addOpsDuring a doubling test, the provided code may callincOpsand/oraddOps. If either is called, then the number of operations so recorded will be reported byrun.
- 
runSee fully parameterizedrunfor a description. In this abbreviated form,numTestsPerValueis 1.setupdoes nothing, therefore no value is provided totimed.
- 
runpublic 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.
- 
runpublic 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.
- 
runpublic 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.
- 
runpublic 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.
- 
runpublic 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.
- 
runpublic 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.
- 
runOnceprivate static <T> void runOnce(int value, int numTestsPerValue, Function<Integer, T> setup, BiConsumer<Integer, T> timed) 
- 
runLongSee fully parameterizedrunLongfor a description. In this abbreviated form,numTestsPerValueis 1.setupdoes nothing, therefore no value is provided totimed.
- 
runLongpublic 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.
- 
runLongpublic 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.
- 
runLongpublic 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.
- 
runLongpublic 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.
- 
runLongpublic 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.
- 
runLongpublic 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.
- 
runOnceprivate static <T> void runOnce(long value, int numTestsPerValue, Function<Long, T> setup, BiConsumer<Long, T> timed) 
 
-