Skip to content

Commit eff247f

Browse files
committed
fixed incompatible JDK8 syntax in parser-ng core module
1 parent 560c5c6 commit eff247f

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

parser-ng/src/main/java/com/github/gbenroscience/parser/turbo/tools/FlatMatrixTurboBench.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static void ifExprTestTurbo1() throws Throwable {
8181
Random r = new Random(System.nanoTime());
8282
double[] vars = new double[1];
8383
for (int i = 0; i < 10; i++) {
84-
double val = -r.nextDouble(1000);
84+
double val = -r.nextDouble();
8585
vars[0] = val;
8686
double res = fce.applyScalar(vars);
8787
System.out.println(m111.getExpression() + ": at x=" + val + " -->> " + res);

parser-ng/src/main/java/com/github/gbenroscience/parser/turbo/tools/ScalarTurboBench.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ static void ifExprTestTurbo1() throws Throwable {
10901090
Random r = new Random(System.nanoTime());
10911091
double[] vars = new double[1];
10921092
for (int i = 0; i < 10; i++) {
1093-
double val = -r.nextDouble(1000);
1093+
double val = -r.nextDouble();
10941094
vars[0] = val;
10951095
double res = fce.applyScalar(vars);
10961096
System.out.println(m111.getExpression() + ": at x=" + val + " -->> " + res);

parser-ng/src/main/java/com/github/gbenroscience/parser/turbo/tools/vector/matrix/FlatMatrix.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ public static void matmulInPlace(FlatMatrix A, FlatMatrix B, FlatMatrix C) {
657657
public static void randomFill(FlatMatrix A) {
658658
ThreadLocalRandom ran = ThreadLocalRandom.current();
659659
for (int i = 0; i < A.data.length; i++) {
660-
A.data[i] = 1 + ran.nextDouble(101);
660+
A.data[i] = 1 + ran.nextDouble();
661661
}
662662
}//end method randomFill
663663
/**

parser-ng/src/test/java/com/github/gbenroscience/parser/MathExpressionTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ void ifExprTest() {
910910

911911
Random r = new Random(System.nanoTime());
912912
for (int i = 0; i < 10; i++) {
913-
double val = -r.nextDouble(1000);
913+
double val = -r.nextDouble();
914914
MathExpression.EvalResult res = m111.solveGeneric(val);
915915
System.out.println(m111.getExpression() + ": at x=" + val + " -->> " + res.scalar);
916916
Assertions.assertTrue(res.scalar == (3 * val + 7 > 5 ? Math.sin(val) : -3));
@@ -929,7 +929,7 @@ void ifExprTestTurbo1() throws Throwable {
929929
Random r = new Random(System.nanoTime());
930930
double[] vars = new double[1];
931931
for (int i = 0; i < 10; i++) {
932-
double val = -r.nextDouble(1000);
932+
double val = -r.nextDouble();
933933
vars[0] = val;
934934
double res = fce.applyScalar(vars);
935935
System.out.println(m111.getExpression() + ": at x=" + val + " -->> " + res);
@@ -946,8 +946,8 @@ void logicTest() {
946946

947947
Random r = new Random(System.nanoTime());
948948
for (int i = 0; i < 10; i++) {
949-
double x = r.nextDouble(20);
950-
double y = r.nextDouble(20);
949+
double x = r.nextDouble();
950+
double y = r.nextDouble();
951951
MathExpression.EvalResult res = m111.solveGeneric(x,y);
952952
System.out.println(m111.getExpression() + ": at x=" + x + ", y ="+y+" -->> " + res.boolVal);
953953
Assertions.assertTrue(res.boolVal == (x>y));

0 commit comments

Comments
 (0)