You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The switch -maxiters recognizes a new argument, 'Infinity' to indicate
that the number of iteration should not be bounded.
If a number is given, it has to be between zero and Integer.MAX_VALUE.
The implementation stores these values as doubles. This allows to stick
to comparisons like if(iters < max_iters) as +Infinity compares greater to
all integer values.
@@ -1165,12 +1165,15 @@ else if (sw.equals("epsilon") || sw.equals("e")) {
1165
1165
elseif (sw.equals("maxiters")) {
1166
1166
if (i < args.length - 1) {
1167
1167
try {
1168
-
j = Integer.parseInt(args[++i]);
1169
-
if (j < 0)
1170
-
thrownewNumberFormatException("");
1171
-
set(PRISM_MAX_ITERS, j);
1168
+
doublemax = Double.parseDouble(args[++i]);
1169
+
System.out.println(max);
1170
+
System.out.println(Double.isInfinite(max));
1171
+
if (! (max > 0 && (max <= Integer.MAX_VALUE && max == Math.floor(max) || Double.isInfinite(max)))) {
1172
+
thrownewNumberFormatException();
1173
+
}
1174
+
set(PRISM_MAX_ITERS, max);
1172
1175
} catch (NumberFormatExceptione) {
1173
-
thrownewPrismException("Invalid value for -" + sw + " switch");
1176
+
thrownewPrismException("Invalid value for -" + sw + " switch. Expected positive integer or 'Infinity'.");
1174
1177
}
1175
1178
} else {
1176
1179
thrownewPrismException("No value specified for -" + sw + " switch");
@@ -1831,9 +1834,9 @@ public static void printHelp(PrismLog mainLog)
1831
1834
mainLog.println("-relative (or -rel) ............ Use relative error for detecting convergence [default]");
1832
1835
mainLog.println("-absolute (or -abs) ............ Use absolute error for detecting convergence");
1833
1836
mainLog.println("-epsilon <x> (or -e <x>) ....... Set value of epsilon (for convergence check) [default: 1e-6]");
1834
-
mainLog.println("-maxiters <n> .................. Set max number of iterations [default: 10000]");
1837
+
mainLog.println("-maxiters <n> .................. Set max number of iterations to positive integer [default: 10000] or 'Infinity' for unbounded interations.");
0 commit comments