You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ce...@apache.org on 2012/03/20 08:04:05 UTC

svn commit: r1302788 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SymmLQ.java

Author: celestin
Date: Tue Mar 20 07:04:05 2012
New Revision: 1302788

URL: http://svn.apache.org/viewvc?rev=1302788&view=rev
Log:
In o.a.c.m3.linear.SymmLQ.State, implemented hasConverged() so as to avoid
access to private field State.hasConverged through synthetic getters.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SymmLQ.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SymmLQ.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SymmLQ.java?rev=1302788&r1=1302787&r2=1302788&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SymmLQ.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SymmLQ.java Tue Mar 20 07:04:05 2012
@@ -757,6 +757,15 @@ public class SymmLQ
             }
             hasConverged = (cgnorm <= epsx) || (cgnorm <= epsr);
         }
+
+        /**
+         * Returns {@code true} if the default stopping criterion is fulfilled.
+         *
+         * @return {@code true} if convergence of the iterations has occured
+         */
+        public boolean hasConverged() {
+            return hasConverged;
+        }
     }
 
     /**
@@ -1157,7 +1166,7 @@ public class SymmLQ
         }
         /* Cause termination if beta is essentially zero. */
         final boolean earlyStop;
-        earlyStop = (state.beta < MACH_PREC) || (state.hasConverged);
+        earlyStop = (state.beta < MACH_PREC) || (state.hasConverged());
         manager.fireInitializationEvent(event);
         if (!earlyStop) {
             do {
@@ -1165,7 +1174,7 @@ public class SymmLQ
                 manager.fireIterationStartedEvent(event);
                 state.update();
                 manager.fireIterationPerformedEvent(event);
-            } while (!state.hasConverged);
+            } while (!state.hasConverged());
         }
         state.refine(x);
         /*