commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject svn commit: r747650 - /commons/proper/math/trunk/src/java/org/apache/commons/math/linear/SparseRealVector.java
Date Wed, 25 Feb 2009 03:32:52 GMT
Author: billbarker
Date: Wed Feb 25 03:32:52 2009
New Revision: 747650

URL: http://svn.apache.org/viewvc?rev=747650&view=rev
Log:
epsilon needs to be set before calling isZero, plus copy epsilon for append

Modified:
    commons/proper/math/trunk/src/java/org/apache/commons/math/linear/SparseRealVector.java

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/linear/SparseRealVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/linear/SparseRealVector.java?rev=747650&r1=747649&r2=747650&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/linear/SparseRealVector.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/linear/SparseRealVector.java
Wed Feb 25 03:32:52 2009
@@ -79,7 +79,7 @@
     protected SparseRealVector(SparseRealVector v, int resize) {
         virtualSize = v.getDimension() + resize;
         entries = new OpenIntToDoubleHashMap(v.entries);
-        epsilon = DEFAULT_ZERO_TOLERANCE;
+        epsilon = v.getEpsilon();
     }
 
     /**
@@ -121,13 +121,13 @@
     public SparseRealVector(double[] values, double epsilon) {
         virtualSize = values.length;
         entries = new OpenIntToDoubleHashMap(0.0);
+        this.epsilon = epsilon;
         for (int key = 0; key < values.length; key++) {
             double value = values[key];
             if (!isZero(value)) {
                 entries.put(key, value);
             }
         }
-        this.epsilon = epsilon;
     }
 
     /**
@@ -148,13 +148,13 @@
     public SparseRealVector(Double[] values, double epsilon) {
         virtualSize = values.length;
         entries = new OpenIntToDoubleHashMap(0.0);
+        this.epsilon = epsilon;
         for (int key = 0; key < values.length; key++) {
             double value = values[key].doubleValue();
             if (!isZero(value)) {
                 entries.put(key, value);
             }
         }
-        this.epsilon = epsilon;
     }
 
     /**
@@ -174,13 +174,13 @@
     public SparseRealVector(RealVector v) {
         virtualSize = v.getDimension();
         entries = new OpenIntToDoubleHashMap(0.0);
+        epsilon = DEFAULT_ZERO_TOLERANCE;
         for (int key = 0; key < virtualSize; key++) {
             double value = v.getEntry(key);
             if (!isZero(value)) {
                 entries.put(key, value);
             }
         }
-        epsilon = DEFAULT_ZERO_TOLERANCE;
     }
 
     /**



Mime
View raw message