commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r783702 [3/4] - in /commons/proper/math/trunk: ./ src/experimental/org/apache/commons/math/linear/ src/java/org/apache/commons/math/ src/java/org/apache/commons/math/estimation/ src/java/org/apache/commons/math/linear/ src/java/org/apache/c...
Date Thu, 11 Jun 2009 08:54:04 GMT
Copied: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/ArrayRealVectorTest.java (from r783662, commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealVectorImplTest.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/ArrayRealVectorTest.java?p2=commons/proper/math/trunk/src/test/org/apache/commons/math/linear/ArrayRealVectorTest.java&p1=commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealVectorImplTest.java&r1=783662&r2=783702&rev=783702&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealVectorImplTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/ArrayRealVectorTest.java Thu Jun 11 08:54:02 2009
@@ -25,11 +25,11 @@
 import org.apache.commons.math.TestUtils;
 
 /**
- * Test cases for the {@link RealVectorImpl} class.
+ * Test cases for the {@link ArrayRealVector} class.
  *
  * @version $Revision$ $Date$
  */
-public class RealVectorImplTest extends TestCase {
+public class ArrayRealVectorTest extends TestCase {
 
     // 
     protected double[][] ma1 = {{1d, 2d, 3d}, {4d, 5d, 6d}, {7d, 8d, 9d}};
@@ -104,7 +104,7 @@
             for (int i = 0; i < data.length; i++) {
                 out[i] = data[i] * d;
             }
-            return new RealVectorImpl(out);
+            return new ArrayRealVector(out);
         }
 
         public RealVector mapMultiplyToSelf(double d) {
@@ -462,33 +462,33 @@
     }
 
     public static Test suite() {
-        TestSuite suite = new TestSuite(RealVectorImplTest.class);
-        suite.setName("RealVectorImpl Tests");
+        TestSuite suite = new TestSuite(ArrayRealVectorTest.class);
+        suite.setName("ArrayRealVector Tests");
         return suite;
     }
 
     public void testConstructors() {
 
-        RealVectorImpl v0 = new RealVectorImpl();
+        ArrayRealVector v0 = new ArrayRealVector();
         assertEquals("testData len", 0, v0.getDimension());
 
-        RealVectorImpl v1 = new RealVectorImpl(7);
+        ArrayRealVector v1 = new ArrayRealVector(7);
         assertEquals("testData len", 7, v1.getDimension());
         assertEquals("testData is 0.0 ", 0.0, v1.getEntry(6));
 
-        RealVectorImpl v2 = new RealVectorImpl(5, 1.23);
+        ArrayRealVector v2 = new ArrayRealVector(5, 1.23);
         assertEquals("testData len", 5, v2.getDimension());
         assertEquals("testData is 1.23 ", 1.23, v2.getEntry(4));
 
-        RealVectorImpl v3 = new RealVectorImpl(vec1);
+        ArrayRealVector v3 = new ArrayRealVector(vec1);
         assertEquals("testData len", 3, v3.getDimension());
         assertEquals("testData is 2.0 ", 2.0, v3.getEntry(1));
 
-        RealVectorImpl v4 = new RealVectorImpl(vec4, 3, 2);
+        ArrayRealVector v4 = new ArrayRealVector(vec4, 3, 2);
         assertEquals("testData len", 2, v4.getDimension());
         assertEquals("testData is 4.0 ", 4.0, v4.getEntry(0));
         try {
-            new RealVectorImpl(vec4, 8, 3);
+            new ArrayRealVector(vec4, 8, 3);
             fail("IllegalArgumentException expected");
         } catch (IllegalArgumentException ex) {
             // expected behavior
@@ -496,19 +496,19 @@
             fail("wrong exception caught");
         }
 
-        RealVector v5_i = new RealVectorImpl(dvec1);
+        RealVector v5_i = new ArrayRealVector(dvec1);
         assertEquals("testData len", 9, v5_i.getDimension());
         assertEquals("testData is 9.0 ", 9.0, v5_i.getEntry(8));
 
-        RealVectorImpl v5 = new RealVectorImpl(dvec1);
+        ArrayRealVector v5 = new ArrayRealVector(dvec1);
         assertEquals("testData len", 9, v5.getDimension());
         assertEquals("testData is 9.0 ", 9.0, v5.getEntry(8));
 
-        RealVectorImpl v6 = new RealVectorImpl(dvec1, 3, 2);
+        ArrayRealVector v6 = new ArrayRealVector(dvec1, 3, 2);
         assertEquals("testData len", 2, v6.getDimension());
         assertEquals("testData is 4.0 ", 4.0, v6.getEntry(0));
         try {
-            new RealVectorImpl(dvec1, 8, 3);
+            new ArrayRealVector(dvec1, 8, 3);
             fail("IllegalArgumentException expected");
         } catch (IllegalArgumentException ex) {
             // expected behavior
@@ -516,27 +516,27 @@
             fail("wrong exception caught");
         }
 
-        RealVectorImpl v7 = new RealVectorImpl(v1);
+        ArrayRealVector v7 = new ArrayRealVector(v1);
         assertEquals("testData len", 7, v7.getDimension());
         assertEquals("testData is 0.0 ", 0.0, v7.getEntry(6));
 
         RealVectorTestImpl v7_i = new RealVectorTestImpl(vec1);
 
-        RealVectorImpl v7_2 = new RealVectorImpl(v7_i);
+        ArrayRealVector v7_2 = new ArrayRealVector(v7_i);
         assertEquals("testData len", 3, v7_2.getDimension());
         assertEquals("testData is 0.0 ", 2.0d, v7_2.getEntry(1));
 
-        RealVectorImpl v8 = new RealVectorImpl(v1, true);
+        ArrayRealVector v8 = new ArrayRealVector(v1, true);
         assertEquals("testData len", 7, v8.getDimension());
         assertEquals("testData is 0.0 ", 0.0, v8.getEntry(6));
         assertNotSame("testData not same object ", v1.data, v8.data);
 
-        RealVectorImpl v8_2 = new RealVectorImpl(v1, false);
+        ArrayRealVector v8_2 = new ArrayRealVector(v1, false);
         assertEquals("testData len", 7, v8_2.getDimension());
         assertEquals("testData is 0.0 ", 0.0, v8_2.getEntry(6));
         assertEquals("testData same object ", v1.data, v8_2.data);
 
-        RealVectorImpl v9 = new RealVectorImpl(v1, v3);
+        ArrayRealVector v9 = new ArrayRealVector(v1, v3);
         assertEquals("testData len", 10, v9.getDimension());
         assertEquals("testData is 1.0 ", 1.0, v9.getEntry(7));
 
@@ -544,9 +544,9 @@
 
     public void testDataInOut() {
 
-        RealVectorImpl v1 = new RealVectorImpl(vec1);
-        RealVectorImpl v2 = new RealVectorImpl(vec2);
-        RealVectorImpl v4 = new RealVectorImpl(vec4);
+        ArrayRealVector v1 = new ArrayRealVector(vec1);
+        ArrayRealVector v2 = new ArrayRealVector(vec2);
+        ArrayRealVector v4 = new ArrayRealVector(vec4);
         RealVectorTestImpl v2_t = new RealVectorTestImpl(vec2); 
 
         RealVector v_append_1 = v1.append(v2);
@@ -574,7 +574,7 @@
         assertNotSame("testData not same object ", v1.data, a_double);
 
 
-//      RealVectorImpl vout4 = (RealVectorImpl) v1.clone();
+//      ArrayRealVector vout4 = (ArrayRealVector) v1.clone();
 //      assertEquals("testData len", 3, vout4.getDimension());
 //      assertEquals("testData not same object ", v1.data, vout4.data);
 
@@ -591,7 +591,7 @@
             fail("wrong exception caught");
         }
 
-        RealVectorImpl v_set1 = (RealVectorImpl) v1.copy();
+        ArrayRealVector v_set1 = (ArrayRealVector) v1.copy();
         v_set1.setEntry(1, 11.0);
         assertEquals("testData is 11.0 ", 11.0, v_set1.getEntry(1));
         try {
@@ -603,7 +603,7 @@
             fail("wrong exception caught");
         }
 
-        RealVectorImpl v_set2 = (RealVectorImpl) v4.copy();
+        ArrayRealVector v_set2 = (ArrayRealVector) v4.copy();
         v_set2.set(3, v1);
         assertEquals("testData is 1.0 ", 1.0, v_set2.getEntry(3));
         assertEquals("testData is 7.0 ", 7.0, v_set2.getEntry(6));
@@ -616,7 +616,7 @@
             fail("wrong exception caught");
         }
 
-        RealVectorImpl v_set3 = (RealVectorImpl) v1.copy();
+        ArrayRealVector v_set3 = (ArrayRealVector) v1.copy();
         v_set3.set(13.0);
         assertEquals("testData is 13.0 ", 13.0, v_set3.getEntry(2));
 
@@ -629,7 +629,7 @@
             fail("wrong exception caught");
         }
 
-        RealVectorImpl v_set4 = (RealVectorImpl) v4.copy();
+        ArrayRealVector v_set4 = (ArrayRealVector) v4.copy();
         v_set4.setSubVector(3, v2_t);
         assertEquals("testData is 1.0 ", 4.0, v_set4.getEntry(3));
         assertEquals("testData is 7.0 ", 7.0, v_set4.getEntry(6));
@@ -643,8 +643,8 @@
         }
 
 
-        RealVectorImpl vout10 = (RealVectorImpl) v1.copy();       
-        RealVectorImpl vout10_2 = (RealVectorImpl) v1.copy();
+        ArrayRealVector vout10 = (ArrayRealVector) v1.copy();       
+        ArrayRealVector vout10_2 = (ArrayRealVector) v1.copy();
         assertEquals(vout10, vout10_2);
         vout10_2.setEntry(0, 1.1);
         assertNotSame(vout10, vout10_2);
@@ -652,7 +652,7 @@
     }
 
     public void testMapFunctions() { 
-        RealVectorImpl v1 = new RealVectorImpl(vec1);
+        ArrayRealVector v1 = new ArrayRealVector(vec1);
 
         //octave =  v1 .+ 2.0
         RealVector v_mapAdd = v1.mapAdd(2.0d);
@@ -832,7 +832,7 @@
         assertClose("compare vectors" ,result_mapTanToSelf,v_mapTanToSelf.getData(),normTolerance);
 
         double[] vat_a = {0d, 0.5d, 1.0d};
-        RealVectorImpl vat = new RealVectorImpl(vat_a);
+        ArrayRealVector vat = new ArrayRealVector(vat_a);
 
         //octave =  acos(vat)
         RealVector v_mapAcos = vat.mapAcos();
@@ -879,7 +879,7 @@
         assertClose("compare vectors" ,result_mapInvToSelf,v_mapInvToSelf.getData(),normTolerance);
 
         double[] abs_a = {-1.0d, 0.0d, 1.0d};
-        RealVectorImpl abs_v = new RealVectorImpl(abs_a);
+        ArrayRealVector abs_v = new ArrayRealVector(abs_a);
 
         //octave =  abs(abs_v)
         RealVector v_mapAbs = abs_v.mapAbs();
@@ -904,7 +904,7 @@
         assertClose("compare vectors" ,result_mapSqrtToSelf,v_mapSqrtToSelf.getData(),normTolerance);
 
         double[] cbrt_a = {-2.0d, 0.0d, 2.0d};
-        RealVectorImpl cbrt_v = new RealVectorImpl(cbrt_a);
+        ArrayRealVector cbrt_v = new ArrayRealVector(cbrt_a);
 
         //octave =  ???
         RealVector v_mapCbrt = cbrt_v.mapCbrt();
@@ -918,7 +918,7 @@
         assertClose("compare vectors" ,result_mapCbrtToSelf,v_mapCbrtToSelf.getData(),normTolerance);
 
         double[] ceil_a = {-1.1d, 0.9d, 1.1d};
-        RealVectorImpl ceil_v = new RealVectorImpl(ceil_a);
+        ArrayRealVector ceil_v = new ArrayRealVector(ceil_a);
 
         //octave =  ceil(ceil_v)
         RealVector v_mapCeil = ceil_v.mapCeil();
@@ -980,9 +980,9 @@
     }
 
     public void testBasicFunctions() { 
-        RealVectorImpl v1 = new RealVectorImpl(vec1);
-        RealVectorImpl v2 = new RealVectorImpl(vec2);
-        RealVectorImpl v_null = new RealVectorImpl(vec_null);
+        ArrayRealVector v1 = new ArrayRealVector(vec1);
+        ArrayRealVector v2 = new ArrayRealVector(vec2);
+        ArrayRealVector v_null = new ArrayRealVector(vec_null);
 
         RealVectorTestImpl v2_t = new RealVectorTestImpl(vec2); 
 
@@ -1019,7 +1019,7 @@
         assertEquals("compare values  ",3d, d_getLInfDistance_2 );
 
         //octave =  v1 + v2
-        RealVectorImpl v_add = v1.add(v2);
+        ArrayRealVector v_add = v1.add(v2);
         double[] result_add = {5d, 7d, 9d};
         assertClose("compare vect" ,v_add.getData(),result_add,normTolerance);
 
@@ -1029,7 +1029,7 @@
         assertClose("compare vect" ,v_add_i.getData(),result_add_i,normTolerance);
 
         //octave =  v1 - v2
-        RealVectorImpl v_subtract = v1.subtract(v2);
+        ArrayRealVector v_subtract = v1.subtract(v2);
         double[] result_subtract = {-3d, -3d, -3d};
         assertClose("compare vect" ,v_subtract.getData(),result_subtract,normTolerance);
 
@@ -1038,7 +1038,7 @@
         assertClose("compare vect" ,v_subtract_i.getData(),result_subtract_i,normTolerance);
 
         // octave v1 .* v2
-        RealVectorImpl  v_ebeMultiply = v1.ebeMultiply(v2);
+        ArrayRealVector  v_ebeMultiply = v1.ebeMultiply(v2);
         double[] result_ebeMultiply = {4d, 10d, 18d};
         assertClose("compare vect" ,v_ebeMultiply.getData(),result_ebeMultiply,normTolerance);
 
@@ -1047,7 +1047,7 @@
         assertClose("compare vect" ,v_ebeMultiply_2.getData(),result_ebeMultiply_2,normTolerance);
 
         // octave v1 ./ v2
-        RealVectorImpl  v_ebeDivide = v1.ebeDivide(v2);
+        ArrayRealVector  v_ebeDivide = v1.ebeDivide(v2);
         double[] result_ebeDivide = {0.25d, 0.4d, 0.5d};
         assertClose("compare vect" ,v_ebeDivide.getData(),result_ebeDivide,normTolerance);
 
@@ -1082,7 +1082,7 @@
             fail("wrong exception caught");
         }
 
-        RealVectorImpl v_unitize = (RealVectorImpl)v1.copy();
+        ArrayRealVector v_unitize = (ArrayRealVector)v1.copy();
         v_unitize.unitize();
         assertClose("compare vect" ,v_unitVector_2.getData(),v_unitize.getData(),normTolerance);
         try {
@@ -1094,7 +1094,7 @@
             fail("wrong exception caught");
         }
 
-        RealVectorImpl v_projection = v1.projection(v2);
+        ArrayRealVector v_projection = v1.projection(v2);
         double[] result_projection = {1.662337662337662, 2.0779220779220777, 2.493506493506493};
         assertClose("compare vect", v_projection.getData(), result_projection, normTolerance);
 
@@ -1105,9 +1105,9 @@
     }  
 
     public void testMisc() { 
-        RealVectorImpl v1 = new RealVectorImpl(vec1);
-        RealVectorImpl v4 = new RealVectorImpl(vec4);
-        RealVector v4_2 = new RealVectorImpl(vec4);
+        ArrayRealVector v1 = new ArrayRealVector(vec1);
+        ArrayRealVector v4 = new ArrayRealVector(vec4);
+        RealVector v4_2 = new ArrayRealVector(vec4);
 
         String out1 = v1.toString();
         assertTrue("some output ",  out1.length()!=0);
@@ -1147,7 +1147,7 @@
 
     public void testPredicates() {
 
-        RealVectorImpl v = new RealVectorImpl(new double[] { 0, 1, 2 });
+        ArrayRealVector v = new ArrayRealVector(new double[] { 0, 1, 2 });
 
         assertFalse(v.isNaN());
         v.setEntry(1, Double.NaN);
@@ -1160,20 +1160,20 @@
         assertTrue(v.isInfinite());
 
         v.setEntry(0, 0);
-        assertEquals(v, new RealVectorImpl(new double[] { 0, 1, 2 }));
-        assertNotSame(v, new RealVectorImpl(new double[] { 0, 1, 2 + Math.ulp(2)}));
-        assertNotSame(v, new RealVectorImpl(new double[] { 0, 1, 2, 3 }));
+        assertEquals(v, new ArrayRealVector(new double[] { 0, 1, 2 }));
+        assertNotSame(v, new ArrayRealVector(new double[] { 0, 1, 2 + Math.ulp(2)}));
+        assertNotSame(v, new ArrayRealVector(new double[] { 0, 1, 2, 3 }));
 
-        assertEquals(new RealVectorImpl(new double[] { Double.NaN, 1, 2 }).hashCode(),
-                     new RealVectorImpl(new double[] { 0, Double.NaN, 2 }).hashCode());
+        assertEquals(new ArrayRealVector(new double[] { Double.NaN, 1, 2 }).hashCode(),
+                     new ArrayRealVector(new double[] { 0, Double.NaN, 2 }).hashCode());
 
-        assertTrue(new RealVectorImpl(new double[] { Double.NaN, 1, 2 }).hashCode() !=
-                   new RealVectorImpl(new double[] { 0, 1, 2 }).hashCode());
+        assertTrue(new ArrayRealVector(new double[] { Double.NaN, 1, 2 }).hashCode() !=
+                   new ArrayRealVector(new double[] { 0, 1, 2 }).hashCode());
 
     }
 
     public void testSerial()  {
-        RealVectorImpl v = new RealVectorImpl(new double[] { 0, 1, 2 });
+        ArrayRealVector v = new ArrayRealVector(new double[] { 0, 1, 2 });
         assertEquals(v,TestUtils.serializeAndRecover(v));
     }
     

Copied: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BlockFieldMatrixTest.java (from r783678, commons/proper/math/trunk/src/test/org/apache/commons/math/linear/DenseFieldMatrixTest.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BlockFieldMatrixTest.java?p2=commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BlockFieldMatrixTest.java&p1=commons/proper/math/trunk/src/test/org/apache/commons/math/linear/DenseFieldMatrixTest.java&r1=783678&r2=783702&rev=783702&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/DenseFieldMatrixTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BlockFieldMatrixTest.java Thu Jun 11 08:54:02 2009
@@ -33,7 +33,7 @@
  * @version $Revision$ $Date$
  */
 
-public final class DenseFieldMatrixTest extends TestCase {
+public final class BlockFieldMatrixTest extends TestCase {
     
     // 3 x 3 identity matrix
     protected Fraction[][] id = {
@@ -152,12 +152,12 @@
     protected double entryTolerance = 10E-16;
     protected double normTolerance = 10E-14;
     
-    public DenseFieldMatrixTest(String name) {
+    public BlockFieldMatrixTest(String name) {
         super(name);
     }
     
     public static Test suite() {
-        TestSuite suite = new TestSuite(DenseFieldMatrixTest.class);
+        TestSuite suite = new TestSuite(BlockFieldMatrixTest.class);
         suite.setName("BlockFieldMatrix<Fraction> Tests");
         return suite;
     }
@@ -372,7 +372,7 @@
     public void testOperate() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(id);
         TestUtils.assertEquals(testVector, m.operate(testVector));
-        TestUtils.assertEquals(testVector, m.operate(new FieldVectorImpl<Fraction>(testVector)).getData());
+        TestUtils.assertEquals(testVector, m.operate(new ArrayFieldVector<Fraction>(testVector)).getData());
         m = new BlockFieldMatrix<Fraction>(bigSingular);
         try {
             m.operate(testVector);
@@ -437,7 +437,7 @@
     public void testPremultiplyVector() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(testData);
         TestUtils.assertEquals(m.preMultiply(testVector), preMultTest);
-        TestUtils.assertEquals(m.preMultiply(new FieldVectorImpl<Fraction>(testVector).getData()),
+        TestUtils.assertEquals(m.preMultiply(new ArrayFieldVector<Fraction>(testVector).getData()),
                                preMultTest);
         m = new BlockFieldMatrix<Fraction>(bigSingular);
         try {
@@ -801,8 +801,8 @@
     
     public void testGetRowVector() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
-        FieldVector<Fraction> mRow0 = new FieldVectorImpl<Fraction>(subRow0[0]);
-        FieldVector<Fraction> mRow3 = new FieldVectorImpl<Fraction>(subRow3[0]);
+        FieldVector<Fraction> mRow0 = new ArrayFieldVector<Fraction>(subRow0[0]);
+        FieldVector<Fraction> mRow3 = new ArrayFieldVector<Fraction>(subRow3[0]);
         assertEquals(mRow0, m.getRowVector(0));
         assertEquals(mRow3, m.getRowVector(3));
         try {
@@ -821,7 +821,7 @@
 
     public void testSetRowVector() {
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(subTestData);
-        FieldVector<Fraction> mRow3 = new FieldVectorImpl<Fraction>(subRow3[0]);
+        FieldVector<Fraction> mRow3 = new ArrayFieldVector<Fraction>(subRow3[0]);
         assertNotSame(mRow3, m.getRowMatrix(0));
         m.setRowVector(0, mRow3);
         assertEquals(mRow3, m.getRowVector(0));
@@ -832,7 +832,7 @@
             // expected
         }
         try {
-            m.setRowVector(0, new FieldVectorImpl<Fraction>(FractionField.getInstance(), 5));
+            m.setRowVector(0, new ArrayFieldVector<Fraction>(FractionField.getInstance(), 5));
             fail("Expecting InvalidMatrixException");
         } catch (InvalidMatrixException ex) {
             // expected
@@ -842,7 +842,7 @@
     public void testGetSetRowVectorLarge() {
         int n = 3 * BlockFieldMatrix.BLOCK_SIZE;
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), n, n);
-        FieldVector<Fraction> sub = new FieldVectorImpl<Fraction>(n, new Fraction(1));
+        FieldVector<Fraction> sub = new ArrayFieldVector<Fraction>(n, new Fraction(1));
 
         m.setRowVector(2, sub);
         for (int i = 0; i < n; ++i) {
@@ -891,7 +891,7 @@
             // expected
         }
         try {
-            m.setColumnVector(0, new FieldVectorImpl<Fraction>(FractionField.getInstance(), 5));
+            m.setColumnVector(0, new ArrayFieldVector<Fraction>(FractionField.getInstance(), 5));
             fail("Expecting InvalidMatrixException");
         } catch (InvalidMatrixException ex) {
             // expected
@@ -901,7 +901,7 @@
     public void testGetSetColumnVectorLarge() {
         int n = 3 * BlockFieldMatrix.BLOCK_SIZE;
         FieldMatrix<Fraction> m = new BlockFieldMatrix<Fraction>(FractionField.getInstance(), n, n);
-        FieldVector<Fraction> sub = new FieldVectorImpl<Fraction>(n, new Fraction(1));
+        FieldVector<Fraction> sub = new ArrayFieldVector<Fraction>(n, new Fraction(1));
 
         m.setColumnVector(2, sub);
         for (int i = 0; i < n; ++i) {
@@ -922,7 +922,7 @@
         for (int i = 0; i < data.length; ++i) {
             data[i] = column[i][0];
         }
-        return new FieldVectorImpl<Fraction>(data, false);
+        return new ArrayFieldVector<Fraction>(data, false);
     }
 
     public void testGetRow() {

Copied: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BlockRealMatrixTest.java (from r783678, commons/proper/math/trunk/src/test/org/apache/commons/math/linear/DenseRealMatrixTest.java)
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BlockRealMatrixTest.java?p2=commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BlockRealMatrixTest.java&p1=commons/proper/math/trunk/src/test/org/apache/commons/math/linear/DenseRealMatrixTest.java&r1=783678&r2=783702&rev=783702&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/DenseRealMatrixTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BlockRealMatrixTest.java Thu Jun 11 08:54:02 2009
@@ -31,7 +31,7 @@
  * @version $Revision$ $Date$
  */
 
-public final class DenseRealMatrixTest extends TestCase {
+public final class BlockRealMatrixTest extends TestCase {
     
     // 3 x 3 identity matrix
     protected double[][] id = { {1d,0d,0d}, {0d,1d,0d}, {0d,0d,1d} };
@@ -93,12 +93,12 @@
     protected double entryTolerance = 10E-16;
     protected double normTolerance = 10E-14;
     
-    public DenseRealMatrixTest(String name) {
+    public BlockRealMatrixTest(String name) {
         super(name);
     }
     
     public static Test suite() {
-        TestSuite suite = new TestSuite(DenseRealMatrixTest.class);
+        TestSuite suite = new TestSuite(BlockRealMatrixTest.class);
         suite.setName("BlockRealMatrix Tests");
         return suite;
     }
@@ -321,7 +321,7 @@
     public void testOperate() {
         RealMatrix m = new BlockRealMatrix(id);
         assertClose(testVector, m.operate(testVector), entryTolerance);
-        assertClose(testVector, m.operate(new RealVectorImpl(testVector)).getData(), entryTolerance);
+        assertClose(testVector, m.operate(new ArrayRealVector(testVector)).getData(), entryTolerance);
         m = new BlockRealMatrix(bigSingular);
         try {
             m.operate(testVector);
@@ -384,7 +384,7 @@
     public void testPremultiplyVector() {
         RealMatrix m = new BlockRealMatrix(testData);
         assertClose(m.preMultiply(testVector), preMultTest, normTolerance);
-        assertClose(m.preMultiply(new RealVectorImpl(testVector).getData()),
+        assertClose(m.preMultiply(new ArrayRealVector(testVector).getData()),
                     preMultTest, normTolerance);
         m = new BlockRealMatrix(bigSingular);
         try {
@@ -722,8 +722,8 @@
     
     public void testGetRowVector() {
         RealMatrix m = new BlockRealMatrix(subTestData);
-        RealVector mRow0 = new RealVectorImpl(subRow0[0]);
-        RealVector mRow3 = new RealVectorImpl(subRow3[0]);
+        RealVector mRow0 = new ArrayRealVector(subRow0[0]);
+        RealVector mRow3 = new ArrayRealVector(subRow3[0]);
         assertEquals(mRow0, m.getRowVector(0));
         assertEquals(mRow3, m.getRowVector(3));
         try {
@@ -742,7 +742,7 @@
 
     public void testSetRowVector() {
         RealMatrix m = new BlockRealMatrix(subTestData);
-        RealVector mRow3 = new RealVectorImpl(subRow3[0]);
+        RealVector mRow3 = new ArrayRealVector(subRow3[0]);
         assertNotSame(mRow3, m.getRowMatrix(0));
         m.setRowVector(0, mRow3);
         assertEquals(mRow3, m.getRowVector(0));
@@ -753,7 +753,7 @@
             // expected
         }
         try {
-            m.setRowVector(0, new RealVectorImpl(5));
+            m.setRowVector(0, new ArrayRealVector(5));
             fail("Expecting InvalidMatrixException");
         } catch (InvalidMatrixException ex) {
             // expected
@@ -763,7 +763,7 @@
     public void testGetSetRowVectorLarge() {
         int n = 3 * BlockRealMatrix.BLOCK_SIZE;
         RealMatrix m = new BlockRealMatrix(n, n);
-        RealVector sub = new RealVectorImpl(n, 1.0);
+        RealVector sub = new ArrayRealVector(n, 1.0);
 
         m.setRowVector(2, sub);
         for (int i = 0; i < n; ++i) {
@@ -812,7 +812,7 @@
             // expected
         }
         try {
-            m.setColumnVector(0, new RealVectorImpl(5));
+            m.setColumnVector(0, new ArrayRealVector(5));
             fail("Expecting InvalidMatrixException");
         } catch (InvalidMatrixException ex) {
             // expected
@@ -822,7 +822,7 @@
     public void testGetSetColumnVectorLarge() {
         int n = 3 * BlockRealMatrix.BLOCK_SIZE;
         RealMatrix m = new BlockRealMatrix(n, n);
-        RealVector sub = new RealVectorImpl(n, 1.0);
+        RealVector sub = new ArrayRealVector(n, 1.0);
 
         m.setColumnVector(2, sub);
         for (int i = 0; i < n; ++i) {
@@ -843,7 +843,7 @@
         for (int i = 0; i < data.length; ++i) {
             data[i] = column[i][0];
         }
-        return new RealVectorImpl(data, false);
+        return new ArrayRealVector(data, false);
     }
 
     public void testGetRow() {

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/CholeskySolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/CholeskySolverTest.java?rev=783702&r1=783701&r2=783702&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/CholeskySolverTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/CholeskySolverTest.java Thu Jun 11 08:54:02 2009
@@ -26,7 +26,7 @@
 import org.apache.commons.math.linear.DecompositionSolver;
 import org.apache.commons.math.linear.MatrixUtils;
 import org.apache.commons.math.linear.RealMatrix;
-import org.apache.commons.math.linear.RealVectorImpl;
+import org.apache.commons.math.linear.ArrayRealVector;
 
 public class CholeskySolverTest extends TestCase {
 
@@ -70,7 +70,7 @@
             fail("wrong exception caught");
         }
         try {
-            solver.solve(new RealVectorImplTest.RealVectorTestImpl(b.getColumn(0)));
+            solver.solve(new ArrayRealVectorTest.RealVectorTestImpl(b.getColumn(0)));
             fail("an exception should have been thrown");
         } catch (IllegalArgumentException iae) {
             // expected behavior
@@ -104,11 +104,11 @@
         // using double[]
         for (int i = 0; i < b.getColumnDimension(); ++i) {
             assertEquals(0,
-                         new RealVectorImpl(solver.solve(b.getColumn(i))).subtract(xRef.getColumnVector(i)).getNorm(),
+                         new ArrayRealVector(solver.solve(b.getColumn(i))).subtract(xRef.getColumnVector(i)).getNorm(),
                          1.0e-13);
         }
 
-        // using RealVectorImpl
+        // using ArrayRealVector
         for (int i = 0; i < b.getColumnDimension(); ++i) {
             assertEquals(0,
                          solver.solve(b.getColumnVector(i)).subtract(xRef.getColumnVector(i)).getNorm(),
@@ -117,8 +117,8 @@
 
         // using RealVector with an alternate implementation
         for (int i = 0; i < b.getColumnDimension(); ++i) {
-            RealVectorImplTest.RealVectorTestImpl v =
-                new RealVectorImplTest.RealVectorTestImpl(b.getColumn(i));
+            ArrayRealVectorTest.RealVectorTestImpl v =
+                new ArrayRealVectorTest.RealVectorTestImpl(b.getColumn(i));
             assertEquals(0,
                          solver.solve(v).subtract(xRef.getColumnVector(i)).getNorm(),
                          1.0e-13);

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/EigenSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/EigenSolverTest.java?rev=783702&r1=783701&r2=783702&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/EigenSolverTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/EigenSolverTest.java Thu Jun 11 08:54:02 2009
@@ -28,7 +28,7 @@
 import org.apache.commons.math.linear.InvalidMatrixException;
 import org.apache.commons.math.linear.MatrixUtils;
 import org.apache.commons.math.linear.RealMatrix;
-import org.apache.commons.math.linear.RealVectorImpl;
+import org.apache.commons.math.linear.ArrayRealVector;
 import org.apache.commons.math.util.MathUtils;
 
 public class EigenSolverTest extends TestCase {
@@ -97,7 +97,7 @@
             fail("wrong exception caught");
         }
         try {
-            es.solve(new RealVectorImplTest.RealVectorTestImpl(b.getColumn(0)));
+            es.solve(new ArrayRealVectorTest.RealVectorTestImpl(b.getColumn(0)));
             fail("an exception should have been thrown");
         } catch (IllegalArgumentException iae) {
             // expected behavior
@@ -140,11 +140,11 @@
         // using double[]
         for (int i = 0; i < b.getColumnDimension(); ++i) {
             assertEquals(0,
-                         new RealVectorImpl(es.solve(b.getColumn(i))).subtract(xRef.getColumnVector(i)).getNorm(),
+                         new ArrayRealVector(es.solve(b.getColumn(i))).subtract(xRef.getColumnVector(i)).getNorm(),
                          2.0e-11);
         }
 
-        // using RealMatrixImpl
+        // using Array2DRowRealMatrix
         for (int i = 0; i < b.getColumnDimension(); ++i) {
             assertEquals(0,
                          es.solve(b.getColumnVector(i)).subtract(xRef.getColumnVector(i)).getNorm(),
@@ -153,8 +153,8 @@
 
         // using RealMatrix with an alternate implementation
         for (int i = 0; i < b.getColumnDimension(); ++i) {
-            RealVectorImplTest.RealVectorTestImpl v =
-                new RealVectorImplTest.RealVectorTestImpl(b.getColumn(i));
+            ArrayRealVectorTest.RealVectorTestImpl v =
+                new ArrayRealVectorTest.RealVectorTestImpl(b.getColumn(i));
             assertEquals(0,
                          es.solve(v).subtract(xRef.getColumnVector(i)).getNorm(),
                          2.0e-11);

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/FieldLUDecompositionImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/FieldLUDecompositionImplTest.java?rev=783702&r1=783701&r2=783702&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/FieldLUDecompositionImplTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/FieldLUDecompositionImplTest.java Thu Jun 11 08:54:02 2009
@@ -27,7 +27,7 @@
 import org.apache.commons.math.linear.FieldLUDecomposition;
 import org.apache.commons.math.linear.FieldLUDecompositionImpl;
 import org.apache.commons.math.linear.FieldMatrix;
-import org.apache.commons.math.linear.FieldMatrixImpl;
+import org.apache.commons.math.linear.Array2DRowFieldMatrix;
 import org.apache.commons.math.linear.InvalidMatrixException;
 
 public class FieldLUDecompositionImplTest extends TestCase {
@@ -71,7 +71,7 @@
 
     /** test dimensions */
     public void testDimensions() {
-        FieldMatrix<Fraction> matrix = new FieldMatrixImpl<Fraction>(testData);
+        FieldMatrix<Fraction> matrix = new Array2DRowFieldMatrix<Fraction>(testData);
         FieldLUDecomposition<Fraction> LU = new FieldLUDecompositionImpl<Fraction>(matrix);
         assertEquals(testData.length, LU.getL().getRowDimension());
         assertEquals(testData.length, LU.getL().getColumnDimension());
@@ -85,7 +85,7 @@
     /** test non-square matrix */
     public void testNonSquare() {
         try {
-            new FieldLUDecompositionImpl<Fraction>(new FieldMatrixImpl<Fraction>(new Fraction[][] {
+            new FieldLUDecompositionImpl<Fraction>(new Array2DRowFieldMatrix<Fraction>(new Fraction[][] {
                     { Fraction.ZERO, Fraction.ZERO },
                     { Fraction.ZERO, Fraction.ZERO },
                     { Fraction.ZERO, Fraction.ZERO }
@@ -99,21 +99,21 @@
 
     /** test PA = LU */
     public void testPAEqualLU() {
-        FieldMatrix<Fraction> matrix = new FieldMatrixImpl<Fraction>(testData);
+        FieldMatrix<Fraction> matrix = new Array2DRowFieldMatrix<Fraction>(testData);
         FieldLUDecomposition<Fraction> lu = new FieldLUDecompositionImpl<Fraction>(matrix);
         FieldMatrix<Fraction> l = lu.getL();
         FieldMatrix<Fraction> u = lu.getU();
         FieldMatrix<Fraction> p = lu.getP();
         TestUtils.assertEquals(p.multiply(matrix), l.multiply(u));
 
-        matrix = new FieldMatrixImpl<Fraction>(testDataMinus);
+        matrix = new Array2DRowFieldMatrix<Fraction>(testDataMinus);
         lu = new FieldLUDecompositionImpl<Fraction>(matrix);
         l = lu.getL();
         u = lu.getU();
         p = lu.getP();
         TestUtils.assertEquals(p.multiply(matrix), l.multiply(u));
 
-        matrix = new FieldMatrixImpl<Fraction>(FractionField.getInstance(), 17, 17);
+        matrix = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), 17, 17);
         for (int i = 0; i < matrix.getRowDimension(); ++i) {
             matrix.setEntry(i, i, Fraction.ONE);
         }
@@ -123,14 +123,14 @@
         p = lu.getP();
         TestUtils.assertEquals(p.multiply(matrix), l.multiply(u));
 
-        matrix = new FieldMatrixImpl<Fraction>(singular);
+        matrix = new Array2DRowFieldMatrix<Fraction>(singular);
         lu = new FieldLUDecompositionImpl<Fraction>(matrix);
         assertFalse(lu.getSolver().isNonSingular());
         assertNull(lu.getL());
         assertNull(lu.getU());
         assertNull(lu.getP());
 
-        matrix = new FieldMatrixImpl<Fraction>(bigSingular);
+        matrix = new Array2DRowFieldMatrix<Fraction>(bigSingular);
         lu = new FieldLUDecompositionImpl<Fraction>(matrix);
         assertFalse(lu.getSolver().isNonSingular());
         assertNull(lu.getL());
@@ -141,7 +141,7 @@
 
     /** test that L is lower triangular with unit diagonal */
     public void testLLowerTriangular() {
-        FieldMatrix<Fraction> matrix = new FieldMatrixImpl<Fraction>(testData);
+        FieldMatrix<Fraction> matrix = new Array2DRowFieldMatrix<Fraction>(testData);
         FieldMatrix<Fraction> l = new FieldLUDecompositionImpl<Fraction>(matrix).getL();
         for (int i = 0; i < l.getRowDimension(); i++) {
             assertEquals(Fraction.ONE, l.getEntry(i, i));
@@ -153,7 +153,7 @@
 
     /** test that U is upper triangular */
     public void testUUpperTriangular() {
-        FieldMatrix<Fraction> matrix = new FieldMatrixImpl<Fraction>(testData);
+        FieldMatrix<Fraction> matrix = new Array2DRowFieldMatrix<Fraction>(testData);
         FieldMatrix<Fraction> u = new FieldLUDecompositionImpl<Fraction>(matrix).getU();
         for (int i = 0; i < u.getRowDimension(); i++) {
             for (int j = 0; j < i; j++) {
@@ -164,12 +164,12 @@
 
     /** test that P is a permutation matrix */
     public void testPPermutation() {
-        FieldMatrix<Fraction> matrix = new FieldMatrixImpl<Fraction>(testData);
+        FieldMatrix<Fraction> matrix = new Array2DRowFieldMatrix<Fraction>(testData);
         FieldMatrix<Fraction> p   = new FieldLUDecompositionImpl<Fraction>(matrix).getP();
 
         FieldMatrix<Fraction> ppT = p.multiply(p.transpose());
         FieldMatrix<Fraction> id  =
-            new FieldMatrixImpl<Fraction>(FractionField.getInstance(),
+            new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(),
                                           p.getRowDimension(), p.getRowDimension());
         for (int i = 0; i < id.getRowDimension(); ++i) {
             id.setEntry(i, i, Fraction.ONE);
@@ -220,29 +220,29 @@
     /** test singular */
     public void testSingular() {
         FieldLUDecomposition<Fraction> lu =
-            new FieldLUDecompositionImpl<Fraction>(new FieldMatrixImpl<Fraction>(testData));
+            new FieldLUDecompositionImpl<Fraction>(new Array2DRowFieldMatrix<Fraction>(testData));
         assertTrue(lu.getSolver().isNonSingular());
-        lu = new FieldLUDecompositionImpl<Fraction>(new FieldMatrixImpl<Fraction>(singular));
+        lu = new FieldLUDecompositionImpl<Fraction>(new Array2DRowFieldMatrix<Fraction>(singular));
         assertFalse(lu.getSolver().isNonSingular());
-        lu = new FieldLUDecompositionImpl<Fraction>(new FieldMatrixImpl<Fraction>(bigSingular));
+        lu = new FieldLUDecompositionImpl<Fraction>(new Array2DRowFieldMatrix<Fraction>(bigSingular));
         assertFalse(lu.getSolver().isNonSingular());
     }
 
     /** test matrices values */
     public void testMatricesValues1() {
        FieldLUDecomposition<Fraction> lu =
-            new FieldLUDecompositionImpl<Fraction>(new FieldMatrixImpl<Fraction>(testData));
-        FieldMatrix<Fraction> lRef = new FieldMatrixImpl<Fraction>(new Fraction[][] {
+            new FieldLUDecompositionImpl<Fraction>(new Array2DRowFieldMatrix<Fraction>(testData));
+        FieldMatrix<Fraction> lRef = new Array2DRowFieldMatrix<Fraction>(new Fraction[][] {
                 { new Fraction(1), new Fraction(0), new Fraction(0) },
                 { new Fraction(2), new Fraction(1), new Fraction(0) },
                 { new Fraction(1), new Fraction(-2), new Fraction(1) }
         });
-        FieldMatrix<Fraction> uRef = new FieldMatrixImpl<Fraction>(new Fraction[][] {
+        FieldMatrix<Fraction> uRef = new Array2DRowFieldMatrix<Fraction>(new Fraction[][] {
                 { new Fraction(1),  new Fraction(2), new Fraction(3) },
                 { new Fraction(0), new Fraction(1), new Fraction(-3) },
                 { new Fraction(0),  new Fraction(0), new Fraction(-1) }
         });
-        FieldMatrix<Fraction> pRef = new FieldMatrixImpl<Fraction>(new Fraction[][] {
+        FieldMatrix<Fraction> pRef = new Array2DRowFieldMatrix<Fraction>(new Fraction[][] {
                 { new Fraction(1), new Fraction(0), new Fraction(0) },
                 { new Fraction(0), new Fraction(1), new Fraction(0) },
                 { new Fraction(0), new Fraction(0), new Fraction(1) }
@@ -271,18 +271,18 @@
     /** test matrices values */
     public void testMatricesValues2() {
        FieldLUDecomposition<Fraction> lu =
-            new FieldLUDecompositionImpl<Fraction>(new FieldMatrixImpl<Fraction>(luData));
-        FieldMatrix<Fraction> lRef = new FieldMatrixImpl<Fraction>(new Fraction[][] {
+            new FieldLUDecompositionImpl<Fraction>(new Array2DRowFieldMatrix<Fraction>(luData));
+        FieldMatrix<Fraction> lRef = new Array2DRowFieldMatrix<Fraction>(new Fraction[][] {
                 { new Fraction(1), new Fraction(0), new Fraction(0) },
                 { new Fraction(3), new Fraction(1), new Fraction(0) },
                 { new Fraction(1), new Fraction(0), new Fraction(1) }
         });
-        FieldMatrix<Fraction> uRef = new FieldMatrixImpl<Fraction>(new Fraction[][] {
+        FieldMatrix<Fraction> uRef = new Array2DRowFieldMatrix<Fraction>(new Fraction[][] {
                 { new Fraction(2), new Fraction(3), new Fraction(3)    },
                 { new Fraction(0), new Fraction(-3), new Fraction(-1)  },
                 { new Fraction(0), new Fraction(0), new Fraction(4) }
         });
-        FieldMatrix<Fraction> pRef = new FieldMatrixImpl<Fraction>(new Fraction[][] {
+        FieldMatrix<Fraction> pRef = new Array2DRowFieldMatrix<Fraction>(new Fraction[][] {
                 { new Fraction(1), new Fraction(0), new Fraction(0) },
                 { new Fraction(0), new Fraction(0), new Fraction(1) },
                 { new Fraction(0), new Fraction(1), new Fraction(0) }

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/FieldMatrixImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/FieldMatrixImplTest.java?rev=783702&r1=783701&r2=783702&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/FieldMatrixImplTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/FieldMatrixImplTest.java Thu Jun 11 08:54:02 2009
@@ -25,7 +25,7 @@
 import org.apache.commons.math.fraction.FractionField;
 
 /**
- * Test cases for the {@link FieldMatrixImpl} class.
+ * Test cases for the {@link Array2DRowFieldMatrix} class.
  *
  * @version $Revision$ $Date$
  */
@@ -98,14 +98,14 @@
     
     public static Test suite() {
         TestSuite suite = new TestSuite(FieldMatrixImplTest.class);
-        suite.setName("FieldMatrixImpl<Fraction> Tests");
+        suite.setName("Array2DRowFieldMatrix<Fraction> Tests");
         return suite;
     }
     
     /** test dimensions */
     public void testDimensions() {
-        FieldMatrixImpl<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
-        FieldMatrixImpl<Fraction> m2 = new FieldMatrixImpl<Fraction>(testData2);
+        Array2DRowFieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
+        Array2DRowFieldMatrix<Fraction> m2 = new Array2DRowFieldMatrix<Fraction>(testData2);
         assertEquals("testData row dimension",3,m.getRowDimension());
         assertEquals("testData column dimension",3,m.getColumnDimension());
         assertTrue("testData is square",m.isSquare());
@@ -116,18 +116,18 @@
     
     /** test copy functions */
     public void testCopyFunctions() {
-        FieldMatrixImpl<Fraction> m1 = new FieldMatrixImpl<Fraction>(testData);
-        FieldMatrixImpl<Fraction> m2 = new FieldMatrixImpl<Fraction>(m1.getData());
+        Array2DRowFieldMatrix<Fraction> m1 = new Array2DRowFieldMatrix<Fraction>(testData);
+        Array2DRowFieldMatrix<Fraction> m2 = new Array2DRowFieldMatrix<Fraction>(m1.getData());
         assertEquals(m2,m1);
-        FieldMatrixImpl<Fraction> m3 = new FieldMatrixImpl<Fraction>(testData);
-        FieldMatrixImpl<Fraction> m4 = new FieldMatrixImpl<Fraction>(m3.getData(), false);
+        Array2DRowFieldMatrix<Fraction> m3 = new Array2DRowFieldMatrix<Fraction>(testData);
+        Array2DRowFieldMatrix<Fraction> m4 = new Array2DRowFieldMatrix<Fraction>(m3.getData(), false);
         assertEquals(m4,m3);
     }           
     
     /** test add */
     public void testAdd() {
-        FieldMatrixImpl<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
-        FieldMatrixImpl<Fraction> mInv = new FieldMatrixImpl<Fraction>(testDataInv);
+        Array2DRowFieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
+        Array2DRowFieldMatrix<Fraction> mInv = new Array2DRowFieldMatrix<Fraction>(testDataInv);
         FieldMatrix<Fraction> mPlusMInv = m.add(mInv);
         Fraction[][] sumEntries = mPlusMInv.getData();
         for (int row = 0; row < m.getRowDimension(); row++) {
@@ -139,8 +139,8 @@
     
     /** test add failure */
     public void testAddFail() {
-        FieldMatrixImpl<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
-        FieldMatrixImpl<Fraction> m2 = new FieldMatrixImpl<Fraction>(testData2);
+        Array2DRowFieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
+        Array2DRowFieldMatrix<Fraction> m2 = new Array2DRowFieldMatrix<Fraction>(testData2);
         try {
             m.add(m2);
             fail("IllegalArgumentException expected");
@@ -151,11 +151,11 @@
     
      /** test m-n = m + -n */
     public void testPlusMinus() {
-        FieldMatrixImpl<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
-        FieldMatrixImpl<Fraction> m2 = new FieldMatrixImpl<Fraction>(testDataInv);
+        Array2DRowFieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
+        Array2DRowFieldMatrix<Fraction> m2 = new Array2DRowFieldMatrix<Fraction>(testDataInv);
         TestUtils.assertEquals(m.subtract(m2),m2.scalarMultiply(new Fraction(-1)).add(m));        
         try {
-            m.subtract(new FieldMatrixImpl<Fraction>(testData2));
+            m.subtract(new Array2DRowFieldMatrix<Fraction>(testData2));
             fail("Expecting illegalArgumentException");
         } catch (IllegalArgumentException ex) {
             // ignored
@@ -164,41 +164,41 @@
    
     /** test multiply */
      public void testMultiply() {
-        FieldMatrixImpl<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
-        FieldMatrixImpl<Fraction> mInv = new FieldMatrixImpl<Fraction>(testDataInv);
-        FieldMatrixImpl<Fraction> identity = new FieldMatrixImpl<Fraction>(id);
-        FieldMatrixImpl<Fraction> m2 = new FieldMatrixImpl<Fraction>(testData2);
+        Array2DRowFieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
+        Array2DRowFieldMatrix<Fraction> mInv = new Array2DRowFieldMatrix<Fraction>(testDataInv);
+        Array2DRowFieldMatrix<Fraction> identity = new Array2DRowFieldMatrix<Fraction>(id);
+        Array2DRowFieldMatrix<Fraction> m2 = new Array2DRowFieldMatrix<Fraction>(testData2);
         TestUtils.assertEquals(m.multiply(mInv), identity);
         TestUtils.assertEquals(mInv.multiply(m), identity);
         TestUtils.assertEquals(m.multiply(identity), m);
         TestUtils.assertEquals(identity.multiply(mInv), mInv);
         TestUtils.assertEquals(m2.multiply(identity), m2); 
         try {
-            m.multiply(new FieldMatrixImpl<Fraction>(bigSingular));
+            m.multiply(new Array2DRowFieldMatrix<Fraction>(bigSingular));
             fail("Expecting illegalArgumentException");
         } catch (IllegalArgumentException ex) {
             // ignored
         }      
     }   
     
-    //Additional Test for FieldMatrixImpl<Fraction>Test.testMultiply
+    //Additional Test for Array2DRowFieldMatrix<Fraction>Test.testMultiply
 
     private Fraction[][] d3 = new Fraction[][] {{new Fraction(1),new Fraction(2),new Fraction(3),new Fraction(4)},{new Fraction(5),new Fraction(6),new Fraction(7),new Fraction(8)}};
     private Fraction[][] d4 = new Fraction[][] {{new Fraction(1)},{new Fraction(2)},{new Fraction(3)},{new Fraction(4)}};
     private Fraction[][] d5 = new Fraction[][] {{new Fraction(30)},{new Fraction(70)}};
      
     public void testMultiply2() { 
-       FieldMatrix<Fraction> m3 = new FieldMatrixImpl<Fraction>(d3);   
-       FieldMatrix<Fraction> m4 = new FieldMatrixImpl<Fraction>(d4);
-       FieldMatrix<Fraction> m5 = new FieldMatrixImpl<Fraction>(d5);
+       FieldMatrix<Fraction> m3 = new Array2DRowFieldMatrix<Fraction>(d3);   
+       FieldMatrix<Fraction> m4 = new Array2DRowFieldMatrix<Fraction>(d4);
+       FieldMatrix<Fraction> m5 = new Array2DRowFieldMatrix<Fraction>(d5);
        TestUtils.assertEquals(m3.multiply(m4), m5);
    }  
         
     /** test trace */
     public void testTrace() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(id);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(id);
         assertEquals("identity trace",new Fraction(3),m.getTrace());
-        m = new FieldMatrixImpl<Fraction>(testData2);
+        m = new Array2DRowFieldMatrix<Fraction>(testData2);
         try {
             m.getTrace();
             fail("Expecting NonSquareMatrixException");
@@ -209,16 +209,16 @@
     
     /** test sclarAdd */
     public void testScalarAdd() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
-        TestUtils.assertEquals(new FieldMatrixImpl<Fraction>(testDataPlus2), m.scalarAdd(new Fraction(2)));
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
+        TestUtils.assertEquals(new Array2DRowFieldMatrix<Fraction>(testDataPlus2), m.scalarAdd(new Fraction(2)));
     }
                     
     /** test operate */
     public void testOperate() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(id);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(id);
         TestUtils.assertEquals(testVector, m.operate(testVector));
-        TestUtils.assertEquals(testVector, m.operate(new FieldVectorImpl<Fraction>(testVector)).getData());
-        m = new FieldMatrixImpl<Fraction>(bigSingular);
+        TestUtils.assertEquals(testVector, m.operate(new ArrayFieldVector<Fraction>(testVector)).getData());
+        m = new Array2DRowFieldMatrix<Fraction>(bigSingular);
         try {
             m.operate(testVector);
             fail("Expecting illegalArgumentException");
@@ -229,7 +229,7 @@
 
     /** test issue MATH-209 */
     public void testMath209() {
-        FieldMatrix<Fraction> a = new FieldMatrixImpl<Fraction>(new Fraction[][] {
+        FieldMatrix<Fraction> a = new Array2DRowFieldMatrix<Fraction>(new Fraction[][] {
                 { new Fraction(1), new Fraction(2) }, { new Fraction(3), new Fraction(4) }, { new Fraction(5), new Fraction(6) }
         }, false);
         Fraction[] b = a.operate(new Fraction[] { new Fraction(1), new Fraction(1) });
@@ -241,22 +241,22 @@
     
     /** test transpose */
     public void testTranspose() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(testData); 
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData); 
         FieldMatrix<Fraction> mIT = new FieldLUDecompositionImpl<Fraction>(m).getSolver().getInverse().transpose();
         FieldMatrix<Fraction> mTI = new FieldLUDecompositionImpl<Fraction>(m.transpose()).getSolver().getInverse();
         TestUtils.assertEquals(mIT, mTI);
-        m = new FieldMatrixImpl<Fraction>(testData2);
-        FieldMatrix<Fraction> mt = new FieldMatrixImpl<Fraction>(testData2T);
+        m = new Array2DRowFieldMatrix<Fraction>(testData2);
+        FieldMatrix<Fraction> mt = new Array2DRowFieldMatrix<Fraction>(testData2T);
         TestUtils.assertEquals(mt, m.transpose());
     }
     
     /** test preMultiply by vector */
     public void testPremultiplyVector() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
         TestUtils.assertEquals(m.preMultiply(testVector), preMultTest);
-        TestUtils.assertEquals(m.preMultiply(new FieldVectorImpl<Fraction>(testVector).getData()),
+        TestUtils.assertEquals(m.preMultiply(new ArrayFieldVector<Fraction>(testVector).getData()),
                                preMultTest);
-        m = new FieldMatrixImpl<Fraction>(bigSingular);
+        m = new Array2DRowFieldMatrix<Fraction>(bigSingular);
         try {
             m.preMultiply(testVector);
             fail("expecting IllegalArgumentException");
@@ -266,20 +266,20 @@
     }
     
     public void testPremultiply() {
-        FieldMatrix<Fraction> m3 = new FieldMatrixImpl<Fraction>(d3);   
-        FieldMatrix<Fraction> m4 = new FieldMatrixImpl<Fraction>(d4);
-        FieldMatrix<Fraction> m5 = new FieldMatrixImpl<Fraction>(d5);
+        FieldMatrix<Fraction> m3 = new Array2DRowFieldMatrix<Fraction>(d3);   
+        FieldMatrix<Fraction> m4 = new Array2DRowFieldMatrix<Fraction>(d4);
+        FieldMatrix<Fraction> m5 = new Array2DRowFieldMatrix<Fraction>(d5);
         TestUtils.assertEquals(m4.preMultiply(m3), m5);
         
-        FieldMatrixImpl<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
-        FieldMatrixImpl<Fraction> mInv = new FieldMatrixImpl<Fraction>(testDataInv);
-        FieldMatrixImpl<Fraction> identity = new FieldMatrixImpl<Fraction>(id);
+        Array2DRowFieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
+        Array2DRowFieldMatrix<Fraction> mInv = new Array2DRowFieldMatrix<Fraction>(testDataInv);
+        Array2DRowFieldMatrix<Fraction> identity = new Array2DRowFieldMatrix<Fraction>(id);
         TestUtils.assertEquals(m.preMultiply(mInv), identity);
         TestUtils.assertEquals(mInv.preMultiply(m), identity);
         TestUtils.assertEquals(m.preMultiply(identity), m);
         TestUtils.assertEquals(identity.preMultiply(mInv), mInv);
         try {
-            m.preMultiply(new FieldMatrixImpl<Fraction>(bigSingular));
+            m.preMultiply(new Array2DRowFieldMatrix<Fraction>(bigSingular));
             fail("Expecting illegalArgumentException");
         } catch (IllegalArgumentException ex) {
             // ignored
@@ -287,7 +287,7 @@
     }
     
     public void testGetVectors() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
         TestUtils.assertEquals(m.getRow(0), testDataRow1);
         TestUtils.assertEquals(m.getColumn(2), testDataCol3);
         try {
@@ -305,7 +305,7 @@
     }
     
     public void testGetEntry() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
         assertEquals("get entry",m.getEntry(0,1),new Fraction(2));
         try {
             m.getEntry(10, 4);
@@ -322,14 +322,14 @@
                 {new Fraction(1),new Fraction(2),new Fraction(3)},
                 {new Fraction(2),new Fraction(5),new Fraction(3)}
         };
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(matrixData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(matrixData);
         // One more with three rows, two columns
         Fraction[][] matrixData2 = {
                 {new Fraction(1),new Fraction(2)},
                 {new Fraction(2),new Fraction(5)},
                 {new Fraction(1), new Fraction(7)}
         };
-        FieldMatrix<Fraction> n = new FieldMatrixImpl<Fraction>(matrixData2);
+        FieldMatrix<Fraction> n = new Array2DRowFieldMatrix<Fraction>(matrixData2);
         // Now multiply m by n
         FieldMatrix<Fraction> p = m.multiply(n);
         assertEquals(2, p.getRowDimension());
@@ -345,7 +345,7 @@
                 {new Fraction(-1), new Fraction(7), new Fraction(6)},
                 {new Fraction(4), new Fraction(-3), new Fraction(-5)}
         };
-        FieldMatrix<Fraction> coefficients = new FieldMatrixImpl<Fraction>(coefficientsData);
+        FieldMatrix<Fraction> coefficients = new Array2DRowFieldMatrix<Fraction>(coefficientsData);
         Fraction[] constants = {new Fraction(1), new Fraction(-2), new Fraction(1)};
         Fraction[] solution = new FieldLUDecompositionImpl<Fraction>(coefficients).getSolver().solve(constants);
         assertEquals(new Fraction(2).multiply(solution[0]).
@@ -362,7 +362,7 @@
     
     // test submatrix accessors
     public void testGetSubMatrix() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
         checkGetSubMatrix(m, subRows23Cols00,  2 , 3 , 0, 0, false);
         checkGetSubMatrix(m, subRows00Cols33,  0 , 0 , 3, 3, false);
         checkGetSubMatrix(m, subRows01Cols23,  0 , 1 , 2, 3, false);   
@@ -385,7 +385,7 @@
                                    boolean mustFail) {
         try {
             FieldMatrix<Fraction> sub = m.getSubMatrix(startRow, endRow, startColumn, endColumn);
-            assertEquals(new FieldMatrixImpl<Fraction>(reference), sub);
+            assertEquals(new Array2DRowFieldMatrix<Fraction>(reference), sub);
             if (mustFail) {
                 fail("Expecting MatrixIndexException");
             }
@@ -401,7 +401,7 @@
                                    boolean mustFail) {
         try {
             FieldMatrix<Fraction> sub = m.getSubMatrix(selectedRows, selectedColumns);
-            assertEquals(new FieldMatrixImpl<Fraction>(reference), sub);
+            assertEquals(new Array2DRowFieldMatrix<Fraction>(reference), sub);
             if (mustFail) {
                 fail("Expecting MatrixIndexException");
             }
@@ -413,7 +413,7 @@
     }
 
     public void testCopySubMatrix() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
         checkCopy(m, subRows23Cols00,  2 , 3 , 0, 0, false);
         checkCopy(m, subRows00Cols33,  0 , 0 , 3, 3, false);
         checkCopy(m, subRows01Cols23,  0 , 1 , 2, 3, false);   
@@ -440,7 +440,7 @@
                              new Fraction[1][1] :
                              new Fraction[reference.length][reference[0].length];
             m.copySubMatrix(startRow, endRow, startColumn, endColumn, sub);
-            assertEquals(new FieldMatrixImpl<Fraction>(reference), new FieldMatrixImpl<Fraction>(sub));
+            assertEquals(new Array2DRowFieldMatrix<Fraction>(reference), new Array2DRowFieldMatrix<Fraction>(sub));
             if (mustFail) {
                 fail("Expecting MatrixIndexException");
             }
@@ -459,7 +459,7 @@
                     new Fraction[1][1] :
                     new Fraction[reference.length][reference[0].length];
             m.copySubMatrix(selectedRows, selectedColumns, sub);
-            assertEquals(new FieldMatrixImpl<Fraction>(reference), new FieldMatrixImpl<Fraction>(sub));
+            assertEquals(new Array2DRowFieldMatrix<Fraction>(reference), new Array2DRowFieldMatrix<Fraction>(sub));
             if (mustFail) {
                 fail("Expecting MatrixIndexException");
             }
@@ -471,9 +471,9 @@
     }
 
     public void testGetRowMatrix() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
-        FieldMatrix<Fraction> mRow0 = new FieldMatrixImpl<Fraction>(subRow0);
-        FieldMatrix<Fraction> mRow3 = new FieldMatrixImpl<Fraction>(subRow3);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
+        FieldMatrix<Fraction> mRow0 = new Array2DRowFieldMatrix<Fraction>(subRow0);
+        FieldMatrix<Fraction> mRow3 = new Array2DRowFieldMatrix<Fraction>(subRow3);
         assertEquals("Row0", mRow0, 
                 m.getRowMatrix(0));
         assertEquals("Row3", mRow3, 
@@ -493,8 +493,8 @@
     }
     
     public void testSetRowMatrix() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
-        FieldMatrix<Fraction> mRow3 = new FieldMatrixImpl<Fraction>(subRow3);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
+        FieldMatrix<Fraction> mRow3 = new Array2DRowFieldMatrix<Fraction>(subRow3);
         assertNotSame(mRow3, m.getRowMatrix(0));
         m.setRowMatrix(0, mRow3);
         assertEquals(mRow3, m.getRowMatrix(0));
@@ -513,9 +513,9 @@
     }
     
     public void testGetColumnMatrix() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
-        FieldMatrix<Fraction> mColumn1 = new FieldMatrixImpl<Fraction>(subColumn1);
-        FieldMatrix<Fraction> mColumn3 = new FieldMatrixImpl<Fraction>(subColumn3);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
+        FieldMatrix<Fraction> mColumn1 = new Array2DRowFieldMatrix<Fraction>(subColumn1);
+        FieldMatrix<Fraction> mColumn3 = new Array2DRowFieldMatrix<Fraction>(subColumn3);
         assertEquals("Column1", mColumn1, 
                 m.getColumnMatrix(1));
         assertEquals("Column3", mColumn3, 
@@ -535,8 +535,8 @@
     }
 
     public void testSetColumnMatrix() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
-        FieldMatrix<Fraction> mColumn3 = new FieldMatrixImpl<Fraction>(subColumn3);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
+        FieldMatrix<Fraction> mColumn3 = new Array2DRowFieldMatrix<Fraction>(subColumn3);
         assertNotSame(mColumn3, m.getColumnMatrix(1));
         m.setColumnMatrix(1, mColumn3);
         assertEquals(mColumn3, m.getColumnMatrix(1));
@@ -555,9 +555,9 @@
     }
 
     public void testGetRowVector() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
-        FieldVector<Fraction> mRow0 = new FieldVectorImpl<Fraction>(subRow0[0]);
-        FieldVector<Fraction> mRow3 = new FieldVectorImpl<Fraction>(subRow3[0]);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
+        FieldVector<Fraction> mRow0 = new ArrayFieldVector<Fraction>(subRow0[0]);
+        FieldVector<Fraction> mRow3 = new ArrayFieldVector<Fraction>(subRow3[0]);
         assertEquals("Row0", mRow0, m.getRowVector(0));
         assertEquals("Row3", mRow3, m.getRowVector(3));
         try {
@@ -575,8 +575,8 @@
     }
 
     public void testSetRowVector() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
-        FieldVector<Fraction> mRow3 = new FieldVectorImpl<Fraction>(subRow3[0]);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
+        FieldVector<Fraction> mRow3 = new ArrayFieldVector<Fraction>(subRow3[0]);
         assertNotSame(mRow3, m.getRowMatrix(0));
         m.setRowVector(0, mRow3);
         assertEquals(mRow3, m.getRowVector(0));
@@ -587,7 +587,7 @@
             // expected
         }
         try {
-            m.setRowVector(0, new FieldVectorImpl<Fraction>(FractionField.getInstance(), 5));
+            m.setRowVector(0, new ArrayFieldVector<Fraction>(FractionField.getInstance(), 5));
             fail("Expecting InvalidMatrixException");
         } catch (InvalidMatrixException ex) {
             // expected
@@ -595,7 +595,7 @@
     }
     
     public void testGetColumnVector() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
         FieldVector<Fraction> mColumn1 = columnToVector(subColumn1);
         FieldVector<Fraction> mColumn3 = columnToVector(subColumn3);
         assertEquals("Column1", mColumn1, m.getColumnVector(1));
@@ -615,7 +615,7 @@
     }
 
     public void testSetColumnVector() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
         FieldVector<Fraction> mColumn3 = columnToVector(subColumn3);
         assertNotSame(mColumn3, m.getColumnVector(1));
         m.setColumnVector(1, mColumn3);
@@ -627,7 +627,7 @@
             // expected
         }
         try {
-            m.setColumnVector(0, new FieldVectorImpl<Fraction>(FractionField.getInstance(), 5));
+            m.setColumnVector(0, new ArrayFieldVector<Fraction>(FractionField.getInstance(), 5));
             fail("Expecting InvalidMatrixException");
         } catch (InvalidMatrixException ex) {
             // expected
@@ -639,11 +639,11 @@
         for (int i = 0; i < data.length; ++i) {
             data[i] = column[i][0];
         }
-        return new FieldVectorImpl<Fraction>(data, false);
+        return new ArrayFieldVector<Fraction>(data, false);
     }
 
     public void testGetRow() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
         checkArrays(subRow0[0], m.getRow(0));
         checkArrays(subRow3[0], m.getRow(3));
         try {
@@ -661,7 +661,7 @@
     }
 
     public void testSetRow() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
         assertTrue(subRow3[0][0] != m.getRow(0)[0]);
         m.setRow(0, subRow3[0]);
         checkArrays(subRow3[0], m.getRow(0));
@@ -680,7 +680,7 @@
     }
     
     public void testGetColumn() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
         Fraction[] mColumn1 = columnToArray(subColumn1);
         Fraction[] mColumn3 = columnToArray(subColumn3);
         checkArrays(mColumn1, m.getColumn(1));
@@ -700,7 +700,7 @@
     }
 
     public void testSetColumn() {
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(subTestData);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(subTestData);
         Fraction[] mColumn3 = columnToArray(subColumn3);
         assertTrue(mColumn3[0] != m.getColumn(1)[0]);
         m.setColumn(1, mColumn3);
@@ -735,29 +735,29 @@
     }
     
     public void testEqualsAndHashCode() {
-        FieldMatrixImpl<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
-        FieldMatrixImpl<Fraction> m1 = (FieldMatrixImpl<Fraction>) m.copy();
-        FieldMatrixImpl<Fraction> mt = (FieldMatrixImpl<Fraction>) m.transpose();
+        Array2DRowFieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
+        Array2DRowFieldMatrix<Fraction> m1 = (Array2DRowFieldMatrix<Fraction>) m.copy();
+        Array2DRowFieldMatrix<Fraction> mt = (Array2DRowFieldMatrix<Fraction>) m.transpose();
         assertTrue(m.hashCode() != mt.hashCode());
         assertEquals(m.hashCode(), m1.hashCode());
         assertEquals(m, m);
         assertEquals(m, m1);
         assertFalse(m.equals(null));
         assertFalse(m.equals(mt));
-        assertFalse(m.equals(new FieldMatrixImpl<Fraction>(bigSingular))); 
+        assertFalse(m.equals(new Array2DRowFieldMatrix<Fraction>(bigSingular))); 
     }
     
     public void testToString() {
-        FieldMatrixImpl<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
-        assertEquals("FieldMatrixImpl{{1,2,3},{2,5,3},{1,0,8}}", m.toString());
-        m = new FieldMatrixImpl<Fraction>(FractionField.getInstance());
-        assertEquals("FieldMatrixImpl{}", m.toString());
+        Array2DRowFieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
+        assertEquals("Array2DRowFieldMatrix{{1,2,3},{2,5,3},{1,0,8}}", m.toString());
+        m = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance());
+        assertEquals("Array2DRowFieldMatrix{}", m.toString());
     }
     
     public void testSetSubMatrix() throws Exception {
-        FieldMatrixImpl<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
+        Array2DRowFieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
         m.setSubMatrix(detData2,1,1);
-        FieldMatrix<Fraction> expected = new FieldMatrixImpl<Fraction>
+        FieldMatrix<Fraction> expected = new Array2DRowFieldMatrix<Fraction>
             (new Fraction[][] {
                     {new Fraction(1),new Fraction(2),new Fraction(3)},
                     {new Fraction(2),new Fraction(1),new Fraction(3)},
@@ -766,7 +766,7 @@
         assertEquals(expected, m);  
         
         m.setSubMatrix(detData2,0,0);
-        expected = new FieldMatrixImpl<Fraction>
+        expected = new Array2DRowFieldMatrix<Fraction>
             (new Fraction[][] {
                     {new Fraction(1),new Fraction(3),new Fraction(3)},
                     {new Fraction(2),new Fraction(4),new Fraction(3)},
@@ -775,7 +775,7 @@
         assertEquals(expected, m);  
         
         m.setSubMatrix(testDataPlus2,0,0);      
-        expected = new FieldMatrixImpl<Fraction>
+        expected = new Array2DRowFieldMatrix<Fraction>
             (new Fraction[][] {
                     {new Fraction(3),new Fraction(4),new Fraction(5)},
                     {new Fraction(4),new Fraction(7),new Fraction(5)},
@@ -811,7 +811,7 @@
         } catch (NullPointerException e) {
             // expected
         }
-        FieldMatrixImpl<Fraction> m2 = new FieldMatrixImpl<Fraction>(FractionField.getInstance());
+        Array2DRowFieldMatrix<Fraction> m2 = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance());
         try {
             m2.setSubMatrix(testData,0,1);
             fail("expecting IllegalStateException");
@@ -848,13 +848,13 @@
         int columns = 75;
 
         FieldMatrix<Fraction> m =
-            new FieldMatrixImpl<Fraction>(FractionField.getInstance(), rows, columns);
+            new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInRowOrder(new SetVisitor());
         GetVisitor getVisitor = new GetVisitor();
         m.walkInOptimizedOrder(getVisitor);
         assertEquals(rows * columns, getVisitor.getCount());
 
-        m = new FieldMatrixImpl<Fraction>(FractionField.getInstance(), rows, columns);
+        m = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInRowOrder(new SetVisitor(), 1, rows - 2, 1, columns - 2);
         getVisitor = new GetVisitor();
         m.walkInOptimizedOrder(getVisitor, 1, rows - 2, 1, columns - 2);
@@ -868,13 +868,13 @@
             assertEquals(new Fraction(0), m.getEntry(rows - 1, j));
         }
 
-        m = new FieldMatrixImpl<Fraction>(FractionField.getInstance(), rows, columns);
+        m = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInColumnOrder(new SetVisitor());
         getVisitor = new GetVisitor();
         m.walkInOptimizedOrder(getVisitor);
         assertEquals(rows * columns, getVisitor.getCount());
 
-        m = new FieldMatrixImpl<Fraction>(FractionField.getInstance(), rows, columns);
+        m = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInColumnOrder(new SetVisitor(), 1, rows - 2, 1, columns - 2);
         getVisitor = new GetVisitor();
         m.walkInOptimizedOrder(getVisitor, 1, rows - 2, 1, columns - 2);
@@ -888,13 +888,13 @@
             assertEquals(new Fraction(0), m.getEntry(rows - 1, j));
         }
 
-        m = new FieldMatrixImpl<Fraction>(FractionField.getInstance(), rows, columns);
+        m = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInOptimizedOrder(new SetVisitor());
         getVisitor = new GetVisitor();
         m.walkInRowOrder(getVisitor);
         assertEquals(rows * columns, getVisitor.getCount());
 
-        m = new FieldMatrixImpl<Fraction>(FractionField.getInstance(), rows, columns);
+        m = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInOptimizedOrder(new SetVisitor(), 1, rows - 2, 1, columns - 2);
         getVisitor = new GetVisitor();
         m.walkInRowOrder(getVisitor, 1, rows - 2, 1, columns - 2);
@@ -908,13 +908,13 @@
             assertEquals(new Fraction(0), m.getEntry(rows - 1, j));
         }
 
-        m = new FieldMatrixImpl<Fraction>(FractionField.getInstance(), rows, columns);
+        m = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInOptimizedOrder(new SetVisitor());
         getVisitor = new GetVisitor();
         m.walkInColumnOrder(getVisitor);
         assertEquals(rows * columns, getVisitor.getCount());
 
-        m = new FieldMatrixImpl<Fraction>(FractionField.getInstance(), rows, columns);
+        m = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), rows, columns);
         m.walkInOptimizedOrder(new SetVisitor(), 1, rows - 2, 1, columns - 2);
         getVisitor = new GetVisitor();
         m.walkInColumnOrder(getVisitor, 1, rows - 2, 1, columns - 2);
@@ -931,7 +931,7 @@
     }
 
     public void testSerial()  {
-        FieldMatrixImpl<Fraction> m = new FieldMatrixImpl<Fraction>(testData);
+        Array2DRowFieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(testData);
         assertEquals(m,TestUtils.serializeAndRecover(m));
     }
   
@@ -1005,7 +1005,7 @@
                 out[i][j] = matrix.getEntry(permutation[i], j);
             }
         }
-        return new FieldMatrixImpl<Fraction>(out);
+        return new Array2DRowFieldMatrix<Fraction>(out);
     }
     
 }

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/LUSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/LUSolverTest.java?rev=783702&r1=783701&r2=783702&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/LUSolverTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/LUSolverTest.java Thu Jun 11 08:54:02 2009
@@ -26,7 +26,7 @@
 import org.apache.commons.math.linear.LUDecompositionImpl;
 import org.apache.commons.math.linear.MatrixUtils;
 import org.apache.commons.math.linear.RealMatrix;
-import org.apache.commons.math.linear.RealVectorImpl;
+import org.apache.commons.math.linear.ArrayRealVector;
 
 public class LUSolverTest extends TestCase {
     private double[][] testData = {
@@ -106,7 +106,7 @@
             fail("wrong exception caught");
         }
         try {
-            solver.solve(new RealVectorImplTest.RealVectorTestImpl(b.getColumn(0)));
+            solver.solve(new ArrayRealVectorTest.RealVectorTestImpl(b.getColumn(0)));
             fail("an exception should have been thrown");
         } catch (IllegalArgumentException iae) {
             // expected behavior
@@ -145,7 +145,7 @@
             fail("wrong exception caught");
         }
         try {
-            solver.solve(new RealVectorImplTest.RealVectorTestImpl(b.getColumn(0)));
+            solver.solve(new ArrayRealVectorTest.RealVectorTestImpl(b.getColumn(0)));
             fail("an exception should have been thrown");
         } catch (InvalidMatrixException ime) {
             // expected behavior
@@ -171,11 +171,11 @@
         // using double[]
         for (int i = 0; i < b.getColumnDimension(); ++i) {
             assertEquals(0,
-                         new RealVectorImpl(solver.solve(b.getColumn(i))).subtract(xRef.getColumnVector(i)).getNorm(),
+                         new ArrayRealVector(solver.solve(b.getColumn(i))).subtract(xRef.getColumnVector(i)).getNorm(),
                          1.0e-13);
         }
 
-        // using RealVectorImpl
+        // using ArrayRealVector
         for (int i = 0; i < b.getColumnDimension(); ++i) {
             assertEquals(0,
                          solver.solve(b.getColumnVector(i)).subtract(xRef.getColumnVector(i)).getNorm(),
@@ -184,8 +184,8 @@
 
         // using RealVector with an alternate implementation
         for (int i = 0; i < b.getColumnDimension(); ++i) {
-            RealVectorImplTest.RealVectorTestImpl v =
-                new RealVectorImplTest.RealVectorTestImpl(b.getColumn(i));
+            ArrayRealVectorTest.RealVectorTestImpl v =
+                new ArrayRealVectorTest.RealVectorTestImpl(b.getColumn(i));
             assertEquals(0,
                          solver.solve(v).subtract(xRef.getColumnVector(i)).getNorm(),
                          1.0e-13);

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixUtilsTest.java?rev=783702&r1=783701&r2=783702&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixUtilsTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixUtilsTest.java Thu Jun 11 08:54:02 2009
@@ -97,9 +97,9 @@
     }
 
     public void testcreateFieldMatrix() {
-        assertEquals(new FieldMatrixImpl<Fraction>(asFraction(testData)), 
+        assertEquals(new Array2DRowFieldMatrix<Fraction>(asFraction(testData)), 
                      MatrixUtils.createFieldMatrix(asFraction(testData)));
-        assertEquals(new FieldMatrixImpl<Fraction>(fractionColMatrix), 
+        assertEquals(new Array2DRowFieldMatrix<Fraction>(fractionColMatrix), 
                      MatrixUtils.createFieldMatrix(fractionColMatrix));
         try {
             MatrixUtils.createFieldMatrix(asFraction(new double[][] {{1}, {1,2}}));  // ragged
@@ -172,9 +172,9 @@
     
     public void testCreateRowFieldMatrix() {
         assertEquals(MatrixUtils.createRowFieldMatrix(asFraction(row)),
-                     new FieldMatrixImpl<Fraction>(asFraction(rowMatrix)));
+                     new Array2DRowFieldMatrix<Fraction>(asFraction(rowMatrix)));
         assertEquals(MatrixUtils.createRowFieldMatrix(fractionRow),
-                     new FieldMatrixImpl<Fraction>(fractionRowMatrix));
+                     new Array2DRowFieldMatrix<Fraction>(fractionRowMatrix));
         try {
             MatrixUtils.createRowFieldMatrix(new Fraction[] {});  // empty
             fail("Expecting IllegalArgumentException");
@@ -230,9 +230,9 @@
     
     public void testCreateColumnFieldMatrix() {
         assertEquals(MatrixUtils.createColumnFieldMatrix(asFraction(col)),
-                     new FieldMatrixImpl<Fraction>(asFraction(colMatrix)));
+                     new Array2DRowFieldMatrix<Fraction>(asFraction(colMatrix)));
         assertEquals(MatrixUtils.createColumnFieldMatrix(fractionCol),
-                     new FieldMatrixImpl<Fraction>(fractionColMatrix));
+                     new Array2DRowFieldMatrix<Fraction>(fractionColMatrix));
 
         try {
             MatrixUtils.createColumnFieldMatrix(new Fraction[] {});  // empty
@@ -329,9 +329,9 @@
                 { new BigFraction(2), new BigFraction(5), new BigFraction(3) },
                 { new BigFraction(1), new BigFraction(0), new BigFraction(8) }
         };
-        FieldMatrix<BigFraction> m = new FieldMatrixImpl<BigFraction>(bfData, false);
+        FieldMatrix<BigFraction> m = new Array2DRowFieldMatrix<BigFraction>(bfData, false);
         RealMatrix converted = MatrixUtils.bigFractionMatrixToRealMatrix(m);
-        RealMatrix reference = new RealMatrixImpl(testData, false);
+        RealMatrix reference = new Array2DRowRealMatrix(testData, false);
         assertEquals(0.0, converted.subtract(reference).getNorm(), 0.0);
     }
 
@@ -341,9 +341,9 @@
                 { new Fraction(2), new Fraction(5), new Fraction(3) },
                 { new Fraction(1), new Fraction(0), new Fraction(8) }
         };
-        FieldMatrix<Fraction> m = new FieldMatrixImpl<Fraction>(fData, false);
+        FieldMatrix<Fraction> m = new Array2DRowFieldMatrix<Fraction>(fData, false);
         RealMatrix converted = MatrixUtils.fractionMatrixToRealMatrix(m);
-        RealMatrix reference = new RealMatrixImpl(testData, false);
+        RealMatrix reference = new Array2DRowRealMatrix(testData, false);
         assertEquals(0.0, converted.subtract(reference).getNorm(), 0.0);
     }
 

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/QRSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/QRSolverTest.java?rev=783702&r1=783701&r2=783702&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/QRSolverTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/QRSolverTest.java Thu Jun 11 08:54:02 2009
@@ -33,7 +33,7 @@
 import org.apache.commons.math.linear.QRDecompositionImpl;
 import org.apache.commons.math.linear.RealMatrix;
 import org.apache.commons.math.linear.RealVector;
-import org.apache.commons.math.linear.RealVectorImpl;
+import org.apache.commons.math.linear.ArrayRealVector;
 
 public class QRSolverTest extends TestCase {
     double[][] testData3x3NonSingular = { 
@@ -168,11 +168,11 @@
         // using double[]
         for (int i = 0; i < b.getColumnDimension(); ++i) {
             final double[] x = solver.solve(b.getColumn(i));
-            final double error = new RealVectorImpl(x).subtract(xRef.getColumnVector(i)).getNorm();
+            final double error = new ArrayRealVector(x).subtract(xRef.getColumnVector(i)).getNorm();
             assertEquals(0, error, 3.0e-16 * xRef.getColumnVector(i).getNorm());
         }
 
-        // using RealVectorImpl
+        // using ArrayRealVector
         for (int i = 0; i < b.getColumnDimension(); ++i) {
             final RealVector x = solver.solve(b.getColumnVector(i));
             final double error = x.subtract(xRef.getColumnVector(i)).getNorm();
@@ -181,8 +181,8 @@
 
         // using RealVector with an alternate implementation
         for (int i = 0; i < b.getColumnDimension(); ++i) {
-            RealVectorImplTest.RealVectorTestImpl v =
-                new RealVectorImplTest.RealVectorTestImpl(b.getColumn(i));
+            ArrayRealVectorTest.RealVectorTestImpl v =
+                new ArrayRealVectorTest.RealVectorTestImpl(b.getColumn(i));
             final RealVector x = solver.solve(v);
             final double error = x.subtract(xRef.getColumnVector(i)).getNorm();
             assertEquals(0, error, 3.0e-16 * xRef.getColumnVector(i).getNorm());

Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java?rev=783702&r1=783701&r2=783702&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java Thu Jun 11 08:54:02 2009
@@ -27,7 +27,7 @@
  *
  * @version $Revision$ $Date$
  */
-
+@Deprecated
 public final class RealMatrixImplTest extends TestCase {
     
     // 3 x 3 identity matrix
@@ -242,7 +242,7 @@
         TestUtils.assertEquals("identity operate", testVector,
                     m.operate(testVector), entryTolerance);
         TestUtils.assertEquals("identity operate", testVector,
-                    m.operate(new RealVectorImpl(testVector)).getData(), entryTolerance);
+                    m.operate(new ArrayRealVector(testVector)).getData(), entryTolerance);
         m = new RealMatrixImpl(bigSingular);
         try {
             m.operate(testVector);
@@ -280,7 +280,7 @@
         RealMatrix m = new RealMatrixImpl(testData);
         TestUtils.assertEquals("premultiply", m.preMultiply(testVector),
                     preMultTest, normTolerance);
-        TestUtils.assertEquals("premultiply", m.preMultiply(new RealVectorImpl(testVector).getData()),
+        TestUtils.assertEquals("premultiply", m.preMultiply(new ArrayRealVector(testVector).getData()),
                     preMultTest, normTolerance);
         m = new RealMatrixImpl(bigSingular);
         try {
@@ -569,8 +569,8 @@
 
     public void testGetRowVector() {
         RealMatrix m = new RealMatrixImpl(subTestData);
-        RealVector mRow0 = new RealVectorImpl(subRow0[0]);
-        RealVector mRow3 = new RealVectorImpl(subRow3[0]);
+        RealVector mRow0 = new ArrayRealVector(subRow0[0]);
+        RealVector mRow3 = new ArrayRealVector(subRow3[0]);
         assertEquals("Row0", mRow0, m.getRowVector(0));
         assertEquals("Row3", mRow3, m.getRowVector(3));
         try {
@@ -589,7 +589,7 @@
 
     public void testSetRowVector() {
         RealMatrix m = new RealMatrixImpl(subTestData);
-        RealVector mRow3 = new RealVectorImpl(subRow3[0]);
+        RealVector mRow3 = new ArrayRealVector(subRow3[0]);
         assertNotSame(mRow3, m.getRowMatrix(0));
         m.setRowVector(0, mRow3);
         assertEquals(mRow3, m.getRowVector(0));
@@ -600,7 +600,7 @@
             // expected
         }
         try {
-            m.setRowVector(0, new RealVectorImpl(5));
+            m.setRowVector(0, new ArrayRealVector(5));
             fail("Expecting InvalidMatrixException");
         } catch (InvalidMatrixException ex) {
             // expected
@@ -640,7 +640,7 @@
             // expected
         }
         try {
-            m.setColumnVector(0, new RealVectorImpl(5));
+            m.setColumnVector(0, new ArrayRealVector(5));
             fail("Expecting InvalidMatrixException");
         } catch (InvalidMatrixException ex) {
             // expected
@@ -652,7 +652,7 @@
         for (int i = 0; i < data.length; ++i) {
             data[i] = column[i][0];
         }
-        return new RealVectorImpl(data, false);
+        return new ArrayRealVector(data, false);
     }
 
     public void testGetRow() {



Mime
View raw message