commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1197491 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math: linear/OpenMapRealMatrix.java util/MathArrays.java
Date Fri, 04 Nov 2011 10:27:18 GMT
Author: sebb
Date: Fri Nov  4 10:27:18 2011
New Revision: 1197491

URL: http://svn.apache.org/viewvc?rev=1197491&view=rev
Log:
Unnecessary casts

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/OpenMapRealMatrix.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathArrays.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/OpenMapRealMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/OpenMapRealMatrix.java?rev=1197491&r1=1197490&r2=1197491&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/OpenMapRealMatrix.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/OpenMapRealMatrix.java
Fri Nov  4 10:27:18 2011
@@ -47,9 +47,9 @@ public class OpenMapRealMatrix extends A
      */
     public OpenMapRealMatrix(int rowDimension, int columnDimension) {
         super(rowDimension, columnDimension);
-        long lRow = (long) rowDimension;
-        long lCol = (long) columnDimension;
-        if (lRow * lCol >= (long) Integer.MAX_VALUE) {
+        long lRow = rowDimension;
+        long lCol = columnDimension;
+        if (lRow * lCol >= Integer.MAX_VALUE) {
             throw new NumberIsTooLargeException(lRow * lCol, Integer.MAX_VALUE, false);
         }
         this.rows = rowDimension;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathArrays.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathArrays.java?rev=1197491&r1=1197490&r2=1197491&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathArrays.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathArrays.java Fri
Nov  4 10:27:18 2011
@@ -367,7 +367,7 @@ public class MathArrays {
         double s3 = 0;
         double x1max = 0;
         double x3max = 0;
-        double floatn = (double) v.length;
+        double floatn = v.length;
         double agiant = rgiant / floatn;
         for (int i = 0; i < v.length; i++) {
             double xabs = Math.abs(v[i]);



Mime
View raw message