Skip to content

Commit 0da98da

Browse files
committed
Fix the exit from the loops
1 parent adf67a9 commit 0da98da

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/it/geoframe/blogspot/numerical/ode/NestedNewton.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ public double solve( double x, OrdinaryDifferentialEquation ode ) {
5555

5656
f = ode.compute(x0) - ode.computeRHS();
5757

58+
// System.out.println("\tOuter iteration " + outerIteration + " with residual " + Math.abs(f));
59+
5860
if(Math.abs(f)<tol) {
5961

60-
return x0;
62+
break;
6163

6264
}
6365

@@ -67,9 +69,11 @@ public double solve( double x, OrdinaryDifferentialEquation ode ) {
6769

6870
ff = ode.computePIntegral(x0) - (ode.computeQIntegral(x_k)+ode.computeQ(x_k)*(x0-x_k)) - ode.computeRHS();
6971

72+
// System.out.println("\t\tInner iteration " + innerrIteration + " with residual " + Math.abs(ff));
73+
7074
if(Math.abs(ff)<tol) {
7175

72-
return x0;
76+
break;
7377

7478
}
7579

0 commit comments

Comments
 (0)