commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From celes...@apache.org
Subject svn commit: r1358346 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorTest.java
Date Fri, 06 Jul 2012 18:59:13 GMT
Author: celestin
Date: Fri Jul  6 18:59:12 2012
New Revision: 1358346

URL: http://svn.apache.org/viewvc?rev=1358346&view=rev
Log:
MATH-795: in RealVectorTest, removed
  - testCombineToSelfPrecondition()
  - testCombineToSelf()
which are redundant with other tests already implemented in RealVectorAbstractTest.

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorTest.java?rev=1358346&r1=1358345&r2=1358346&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/linear/RealVectorTest.java
Fri Jul  6 18:59:12 2012
@@ -219,47 +219,6 @@ public class RealVectorTest extends Real
         }
     }
 
-    @Test(expected=DimensionMismatchException.class)
-    public void testCombineToSelfPrecondition() {
-        final double a = 1d;
-        final double b = 2d;
-        double[] aux = new double[] { 3d, 4d, 5d };
-        final RealVector x = new RealVectorTestImpl(aux);
-        aux = new double[] { 6d, 7d };
-        final RealVector y = new RealVectorTestImpl(aux);
-        x.combineToSelf(a, b, y);
-    }
-
-    @Test
-    public void testCombineToSelf() {
-        final Random random = new Random(20110726);
-        final int dim = 10;
-        final double a = (2 * random.nextDouble() - 1);
-        final double b = (2 * random.nextDouble() - 1);
-        final RealVector x = new RealVectorTestImpl(new double[dim]);
-        final RealVector y = new RealVectorTestImpl(new double[dim]);
-        final double[] expected = new double[dim];
-        for (int i = 0; i < dim; i++) {
-            final double xi = 2 * random.nextDouble() - 1;
-            final double yi = 2 * random.nextDouble() - 1;
-            x.setEntry(i, xi);
-            y.setEntry(i, yi);
-            expected[i] = a * xi + b * yi;
-        }
-        Assert.assertSame(x, x.combineToSelf(a, b, y));
-        final double[] actual = x.toArray();
-        for (int i = 0; i < dim; i++) {
-            final double delta;
-            if (expected[i] == 0d) {
-                delta = Math.ulp(1d);
-            } else {
-                delta = Math.ulp(expected[i]);
-            }
-            Assert.assertEquals("elements [" + i + "] differ", expected[i],
-                                actual[i], delta);
-        }
-    }
-
     @Override
     @Test
     public void testAddToEntry() {



Mime
View raw message