commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1200384 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java
Date Thu, 10 Nov 2011 15:43:03 GMT
Author: sebb
Date: Thu Nov 10 15:43:02 2011
New Revision: 1200384

URL: http://svn.apache.org/viewvc?rev=1200384&view=rev
Log:
Unnecessary casts; document unused field

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java?rev=1200384&r1=1200383&r2=1200384&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/RegressionResults.java
Thu Nov 10 15:43:02 2011
@@ -48,6 +48,7 @@ public class RegressionResults implement
     /** boolean flag for variance covariance matrix in symm compressed storage */
     private final boolean isSymmetricVCD;
     /** rank of the solution */
+    @SuppressWarnings("unused")
     private final int rank;
     /** number of observations on which results are based */
     private final long nobs;
@@ -116,12 +117,12 @@ public class RegressionResults implement
 
         if (rank > 0) {
             this.globalFitInfo[SST_IDX] = containsConstant ?
-                    (sumysq - sumy * sumy / ((double) nobs)) : sumysq;
+                    (sumysq - sumy * sumy / nobs) : sumysq;
         }
 
         this.globalFitInfo[SSE_IDX] = sse;
         this.globalFitInfo[MSE_IDX] = this.globalFitInfo[SSE_IDX] /
-                ((double) (nobs - rank));
+                (nobs - rank);
         this.globalFitInfo[RSQ_IDX] = 1.0 -
                 this.globalFitInfo[SSE_IDX] /
                 this.globalFitInfo[SST_IDX];



Mime
View raw message