[BAEL-2996] Using OptionsBuilder instead of main method for benchmarking
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.baeldung.matrices;
|
||||
|
||||
import org.openjdk.jmh.annotations.Scope;
|
||||
import org.openjdk.jmh.annotations.State;
|
||||
|
||||
@State(Scope.Benchmark)
|
||||
public class MatrixProvider {
|
||||
private double[][] firstMatrix;
|
||||
private double[][] secondMatrix;
|
||||
|
||||
public MatrixProvider() {
|
||||
firstMatrix =
|
||||
new double[][] {
|
||||
new double[] {1d, 5d},
|
||||
new double[] {2d, 3d},
|
||||
new double[] {1d ,7d}
|
||||
};
|
||||
|
||||
secondMatrix =
|
||||
new double[][] {
|
||||
new double[] {1d, 2d, 3d, 7d},
|
||||
new double[] {5d, 2d, 8d, 1d}
|
||||
};
|
||||
}
|
||||
|
||||
public double[][] getFirstMatrix() {
|
||||
return firstMatrix;
|
||||
}
|
||||
|
||||
public double[][] getSecondMatrix() {
|
||||
return secondMatrix;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user