commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1043075 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/linear/ test/java/org/apache/commons/math/linear/
Date Tue, 07 Dec 2010 14:58:08 GMT
Author: erans
Date: Tue Dec  7 14:58:08 2010
New Revision: 1043075

URL: http://svn.apache.org/viewvc?rev=1043075&view=rev
Log:
MATH-438
Removed deprecated methods.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealVector.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVector.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/AbstractRealVectorTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/ArrayRealVectorTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealVector.java?rev=1043075&r1=1043074&r2=1043075&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealVector.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealVector.java
Tue Dec  7 14:58:08 2010
@@ -378,16 +378,6 @@ public abstract class AbstractRealVector
     }
 
     /** {@inheritDoc} */
-    public RealVector mapPow(double d) {
-        return copy().mapPowToSelf(d);
-    }
-
-    /** {@inheritDoc} */
-    public RealVector mapPowToSelf(double d){
-        return mapToSelf(new Power(d));
-    }
-
-    /** {@inheritDoc} */
     public RealMatrix outerProduct(RealVector v) {
         RealMatrix product;
         if (v instanceof SparseRealVector || this instanceof SparseRealVector) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVector.java?rev=1043075&r1=1043074&r2=1043075&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVector.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVector.java
Tue Dec  7 14:58:08 2010
@@ -247,33 +247,6 @@ public interface RealVector {
     RealVector mapDivideToSelf(double d);
 
     /**
-     * Map a power operation to each entry.
-     *
-     * @param d Operator value.
-     * @return a mapped copy of the vector.
-     * @deprecated in 2.2 (to be removed in 3.0). Please use
-     * {@link #map(UnivariateRealFunction)} directly with
-     * the function classes in package
-     * {@link org.apache.commons.math.analysis.function}.
-     */
-    @Deprecated
-    RealVector mapPow(double d);
-
-    /**
-     * Map a power operation to each entry.
-     * The instance is changed in-place.
-     *
-     * @param d Operator value.
-     * @return the mapped vector.
-     * @deprecated in 2.2 (to be removed in 3.0). Please use
-     * {@link #mapToSelf(UnivariateRealFunction)} directly with
-     * the function classes in package
-     * {@link org.apache.commons.math.analysis.function}.
-     */
-    @Deprecated
-    RealVector mapPowToSelf(double d);
-
-    /**
      * Element-by-element multiplication.
      * @param v vector by which instance elements must be multiplied
      * @return a vector containing this[i] * v[i] for all i

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/AbstractRealVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/AbstractRealVectorTest.java?rev=1043075&r1=1043074&r2=1043075&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/AbstractRealVectorTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/AbstractRealVectorTest.java
Tue Dec  7 14:58:08 2010
@@ -97,15 +97,6 @@ public class AbstractRealVectorTest {
             return this;
         }
 
-        @Override
-        public RealVector mapPowToSelf(double d) {
-            for(int i=0; i<values.length; i++) {
-                values[i] = FastMath.pow(values[i], d);
-            }
-            return this;
-        }
-
-
         public RealVector ebeMultiply(RealVector v) {
             throw unsupported();
         }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/ArrayRealVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/ArrayRealVectorTest.java?rev=1043075&r1=1043074&r2=1043075&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/ArrayRealVectorTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/ArrayRealVectorTest.java
Tue Dec  7 14:58:08 2010
@@ -48,6 +48,7 @@ import org.apache.commons.math.analysis.
 import org.apache.commons.math.analysis.function.Rint;
 import org.apache.commons.math.analysis.function.Signum;
 import org.apache.commons.math.analysis.function.Ulp;
+import org.apache.commons.math.analysis.function.Power;
 
 /**
  * Test cases for the {@link ArrayRealVector} class.
@@ -182,14 +183,6 @@ public class ArrayRealVectorTest {
             throw unsupported();
         }
 
-        public RealVector mapPow(double d) {
-            throw unsupported();
-        }
-
-        public RealVector mapPowToSelf(double d) {
-            throw unsupported();
-        }
-
         public RealVector ebeMultiply(RealVector v) {
             throw unsupported();
         }
@@ -602,13 +595,13 @@ public class ArrayRealVectorTest {
         assertClose("compare vectors" ,result_mapDivideToSelf,v_mapDivideToSelf.getData(),normTolerance);
 
         //octave =  v1 .^ 2.0
-        RealVector v_mapPow = v1.mapPow(2.0d);
+        RealVector v_mapPow = v1.map(new Power(2));
         double[] result_mapPow = {1d, 4d, 9d};
         assertClose("compare vectors" ,result_mapPow,v_mapPow.getData(),normTolerance);
 
         //octave =  v1 .^ 2.0
         RealVector v_mapPowToSelf = v1.copy();
-        v_mapPowToSelf.mapPowToSelf(2.0d);
+        v_mapPowToSelf.mapToSelf(new Power(2));
         double[] result_mapPowToSelf = {1d, 4d, 9d};
         assertClose("compare vectors" ,result_mapPowToSelf,v_mapPowToSelf.getData(),normTolerance);
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java?rev=1043075&r1=1043074&r2=1043075&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java
Tue Dec  7 14:58:08 2010
@@ -48,6 +48,7 @@ import org.apache.commons.math.analysis.
 import org.apache.commons.math.analysis.function.Rint;
 import org.apache.commons.math.analysis.function.Signum;
 import org.apache.commons.math.analysis.function.Ulp;
+import org.apache.commons.math.analysis.function.Power;
 
 /**
  * Test cases for the {@link OpenMapRealVector} class.
@@ -171,16 +172,6 @@ public class SparseRealVectorTest {
             throw unsupported();
         }
 
-        @Override
-        public RealVector mapPow(double d) {
-            throw unsupported();
-        }
-
-        @Override
-        public RealVector mapPowToSelf(double d) {
-            throw unsupported();
-        }
-
         public RealVector ebeMultiply(RealVector v) {
             throw unsupported();
         }
@@ -531,13 +522,13 @@ public class SparseRealVectorTest {
         assertClose("compare vectors" ,result_mapDivideToSelf,v_mapDivideToSelf.getData(),normTolerance);
 
         //octave =  v1 .^ 2.0
-        RealVector v_mapPow = v1.mapPow(2.0d);
+        RealVector v_mapPow = v1.map(new Power(2));
         double[] result_mapPow = {1d, 4d, 9d};
         assertClose("compare vectors" ,result_mapPow,v_mapPow.getData(),normTolerance);
 
         //octave =  v1 .^ 2.0
         RealVector v_mapPowToSelf = v1.copy();
-        v_mapPowToSelf.mapPowToSelf(2.0d);
+        v_mapPowToSelf.mapToSelf(new Power(2));
         double[] result_mapPowToSelf = {1d, 4d, 9d};
         assertClose("compare vectors" ,result_mapPowToSelf,v_mapPowToSelf.getData(),normTolerance);
 



Mime
View raw message