Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java?rev=783702&r1=783701&r2=783702&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealVectorFormatAbstractTest.java Thu Jun 11 08:54:02 2009 @@ -44,14 +44,14 @@ } public void testSimpleNoDecimals() { - RealVectorImpl c = new RealVectorImpl(new double[] {1, 1, 1}); + ArrayRealVector c = new ArrayRealVector(new double[] {1, 1, 1}); String expected = "{1; 1; 1}"; String actual = realVectorFormat.format(c); assertEquals(expected, actual); } public void testSimpleWithDecimals() { - RealVectorImpl c = new RealVectorImpl(new double[] {1.23, 1.43, 1.63}); + ArrayRealVector c = new ArrayRealVector(new double[] {1.23, 1.43, 1.63}); String expected = "{1" + getDecimalCharacter() + "23; 1" + getDecimalCharacter() + @@ -62,7 +62,7 @@ } public void testSimpleWithDecimalsTrunc() { - RealVectorImpl c = new RealVectorImpl(new double[] {1.2323, 1.4343, 1.6333}); + ArrayRealVector c = new ArrayRealVector(new double[] {1.2323, 1.4343, 1.6333}); String expected = "{1" + getDecimalCharacter() + "23; 1" + getDecimalCharacter() + @@ -73,7 +73,7 @@ } public void testNegativeX() { - RealVectorImpl c = new RealVectorImpl(new double[] {-1.2323, 1.4343, 1.6333}); + ArrayRealVector c = new ArrayRealVector(new double[] {-1.2323, 1.4343, 1.6333}); String expected = "{-1" + getDecimalCharacter() + "23; 1" + getDecimalCharacter() + @@ -84,7 +84,7 @@ } public void testNegativeY() { - RealVectorImpl c = new RealVectorImpl(new double[] {1.2323, -1.4343, 1.6333}); + ArrayRealVector c = new ArrayRealVector(new double[] {1.2323, -1.4343, 1.6333}); String expected = "{1" + getDecimalCharacter() + "23; -1" + getDecimalCharacter() + @@ -95,7 +95,7 @@ } public void testNegativeZ() { - RealVectorImpl c = new RealVectorImpl(new double[] {1.2323, 1.4343, -1.6333}); + ArrayRealVector c = new ArrayRealVector(new double[] {1.2323, 1.4343, -1.6333}); String expected = "{1" + getDecimalCharacter() + "23; 1" + getDecimalCharacter() + @@ -106,7 +106,7 @@ } public void testNonDefaultSetting() { - RealVectorImpl c = new RealVectorImpl(new double[] {1, 1, 1}); + ArrayRealVector c = new ArrayRealVector(new double[] {1, 1, 1}); String expected = "[1 : 1 : 1]"; String actual = realVectorFormatSquare.format(c); assertEquals(expected, actual); @@ -116,7 +116,7 @@ Locale defaultLocal = Locale.getDefault(); Locale.setDefault(getLocale()); - RealVectorImpl c = new RealVectorImpl(new double[] {232.222, -342.33, 432.444}); + ArrayRealVector c = new ArrayRealVector(new double[] {232.222, -342.33, 432.444}); String expected = "{232" + getDecimalCharacter() + "22; -342" + getDecimalCharacter() + @@ -129,14 +129,14 @@ } public void testNan() { - RealVectorImpl c = new RealVectorImpl(new double[] {Double.NaN, Double.NaN, Double.NaN}); + ArrayRealVector c = new ArrayRealVector(new double[] {Double.NaN, Double.NaN, Double.NaN}); String expected = "{(NaN); (NaN); (NaN)}"; String actual = realVectorFormat.format(c); assertEquals(expected, actual); } public void testPositiveInfinity() { - RealVectorImpl c = new RealVectorImpl(new double[] { + ArrayRealVector c = new ArrayRealVector(new double[] { Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY }); String expected = "{(Infinity); (Infinity); (Infinity)}"; @@ -145,7 +145,7 @@ } public void tesNegativeInfinity() { - RealVectorImpl c = new RealVectorImpl(new double[] { + ArrayRealVector c = new ArrayRealVector(new double[] { Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY }); String expected = "{(-Infinity); (-Infinity); (-Infinity)}"; @@ -155,9 +155,9 @@ public void testParseSimpleNoDecimals() { String source = "{1; 1; 1}"; - RealVectorImpl expected = new RealVectorImpl(new double[] {1, 1, 1}); + ArrayRealVector expected = new ArrayRealVector(new double[] {1, 1, 1}); try { - RealVectorImpl actual = (RealVectorImpl) realVectorFormat.parseObject(source); + ArrayRealVector actual = (ArrayRealVector) realVectorFormat.parseObject(source); assertEquals(expected, actual); } catch (ParseException ex) { fail(ex.getMessage()); @@ -165,7 +165,7 @@ } public void testParseIgnoredWhitespace() { - RealVectorImpl expected = new RealVectorImpl(new double[] {1, 1, 1}); + ArrayRealVector expected = new ArrayRealVector(new double[] {1, 1, 1}); ParsePosition pos1 = new ParsePosition(0); String source1 = "{1;1;1}"; assertEquals(expected, realVectorFormat.parseObject(source1, pos1)); @@ -182,9 +182,9 @@ "23; 1" + getDecimalCharacter() + "43; 1" + getDecimalCharacter() + "63}"; - RealVectorImpl expected = new RealVectorImpl(new double[] {1.23, 1.43, 1.63}); + ArrayRealVector expected = new ArrayRealVector(new double[] {1.23, 1.43, 1.63}); try { - RealVectorImpl actual = (RealVectorImpl) realVectorFormat.parseObject(source); + ArrayRealVector actual = (ArrayRealVector) realVectorFormat.parseObject(source); assertEquals(expected, actual); } catch (ParseException ex) { fail(ex.getMessage()); @@ -197,9 +197,9 @@ "2323; 1" + getDecimalCharacter() + "4343; 1" + getDecimalCharacter() + "6333}"; - RealVectorImpl expected = new RealVectorImpl(new double[] {1.2323, 1.4343, 1.6333}); + ArrayRealVector expected = new ArrayRealVector(new double[] {1.2323, 1.4343, 1.6333}); try { - RealVectorImpl actual = (RealVectorImpl) realVectorFormat.parseObject(source); + ArrayRealVector actual = (ArrayRealVector) realVectorFormat.parseObject(source); assertEquals(expected, actual); } catch (ParseException ex) { fail(ex.getMessage()); @@ -212,9 +212,9 @@ "2323; 1" + getDecimalCharacter() + "4343; 1" + getDecimalCharacter() + "6333}"; - RealVectorImpl expected = new RealVectorImpl(new double[] {-1.2323, 1.4343, 1.6333}); + ArrayRealVector expected = new ArrayRealVector(new double[] {-1.2323, 1.4343, 1.6333}); try { - RealVectorImpl actual = (RealVectorImpl) realVectorFormat.parseObject(source); + ArrayRealVector actual = (ArrayRealVector) realVectorFormat.parseObject(source); assertEquals(expected, actual); } catch (ParseException ex) { fail(ex.getMessage()); @@ -227,9 +227,9 @@ "2323; -1" + getDecimalCharacter() + "4343; 1" + getDecimalCharacter() + "6333}"; - RealVectorImpl expected = new RealVectorImpl(new double[] {1.2323, -1.4343, 1.6333}); + ArrayRealVector expected = new ArrayRealVector(new double[] {1.2323, -1.4343, 1.6333}); try { - RealVectorImpl actual = (RealVectorImpl) realVectorFormat.parseObject(source); + ArrayRealVector actual = (ArrayRealVector) realVectorFormat.parseObject(source); assertEquals(expected, actual); } catch (ParseException ex) { fail(ex.getMessage()); @@ -242,9 +242,9 @@ "2323; 1" + getDecimalCharacter() + "4343; -1" + getDecimalCharacter() + "6333}"; - RealVectorImpl expected = new RealVectorImpl(new double[] {1.2323, 1.4343, -1.6333}); + ArrayRealVector expected = new ArrayRealVector(new double[] {1.2323, 1.4343, -1.6333}); try { - RealVectorImpl actual = (RealVectorImpl) realVectorFormat.parseObject(source); + ArrayRealVector actual = (ArrayRealVector) realVectorFormat.parseObject(source); assertEquals(expected, actual); } catch (ParseException ex) { fail(ex.getMessage()); @@ -257,9 +257,9 @@ "2323; -1" + getDecimalCharacter() + "4343; -1" + getDecimalCharacter() + "6333}"; - RealVectorImpl expected = new RealVectorImpl(new double[] {-1.2323, -1.4343, -1.6333}); + ArrayRealVector expected = new ArrayRealVector(new double[] {-1.2323, -1.4343, -1.6333}); try { - RealVectorImpl actual = (RealVectorImpl) realVectorFormat.parseObject(source); + ArrayRealVector actual = (ArrayRealVector) realVectorFormat.parseObject(source); assertEquals(expected, actual); } catch (ParseException ex) { fail(ex.getMessage()); @@ -272,9 +272,9 @@ "0; -1" + getDecimalCharacter() + "4343; 1" + getDecimalCharacter() + "6333}"; - RealVectorImpl expected = new RealVectorImpl(new double[] {0.0, -1.4343, 1.6333}); + ArrayRealVector expected = new ArrayRealVector(new double[] {0.0, -1.4343, 1.6333}); try { - RealVectorImpl actual = (RealVectorImpl) realVectorFormat.parseObject(source); + ArrayRealVector actual = (ArrayRealVector) realVectorFormat.parseObject(source); assertEquals(expected, actual); } catch (ParseException ex) { fail(ex.getMessage()); @@ -287,9 +287,9 @@ "2323 : 1" + getDecimalCharacter() + "4343 : 1" + getDecimalCharacter() + "6333]"; - RealVectorImpl expected = new RealVectorImpl(new double[] {1.2323, 1.4343, 1.6333}); + ArrayRealVector expected = new ArrayRealVector(new double[] {1.2323, 1.4343, 1.6333}); try { - RealVectorImpl actual = (RealVectorImpl) realVectorFormatSquare.parseObject(source); + ArrayRealVector actual = (ArrayRealVector) realVectorFormatSquare.parseObject(source); assertEquals(expected, actual); } catch (ParseException ex) { fail(ex.getMessage()); @@ -299,8 +299,8 @@ public void testParseNan() { String source = "{(NaN); (NaN); (NaN)}"; try { - RealVectorImpl actual = (RealVectorImpl) realVectorFormat.parseObject(source); - assertEquals(new RealVectorImpl(new double[] {Double.NaN, Double.NaN, Double.NaN}), actual); + ArrayRealVector actual = (ArrayRealVector) realVectorFormat.parseObject(source); + assertEquals(new ArrayRealVector(new double[] {Double.NaN, Double.NaN, Double.NaN}), actual); } catch (ParseException ex) { fail(ex.getMessage()); } @@ -309,8 +309,8 @@ public void testParsePositiveInfinity() { String source = "{(Infinity); (Infinity); (Infinity)}"; try { - RealVectorImpl actual = (RealVectorImpl)realVectorFormat.parseObject(source); - assertEquals(new RealVectorImpl(new double[] { + ArrayRealVector actual = (ArrayRealVector)realVectorFormat.parseObject(source); + assertEquals(new ArrayRealVector(new double[] { Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY }), actual); } catch (ParseException ex) { @@ -321,8 +321,8 @@ public void testParseNegativeInfinity() { String source = "{(-Infinity); (-Infinity); (-Infinity)}"; try { - RealVectorImpl actual = (RealVectorImpl)realVectorFormat.parseObject(source); - assertEquals(new RealVectorImpl(new double[] { + ArrayRealVector actual = (ArrayRealVector)realVectorFormat.parseObject(source); + assertEquals(new ArrayRealVector(new double[] { Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY }), actual); } catch (ParseException ex) { @@ -341,8 +341,8 @@ } public void testParseManyComponents() throws ParseException { - RealVectorImpl parsed = - (RealVectorImpl) realVectorFormat.parseObject("{0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0}"); + ArrayRealVector parsed = + (ArrayRealVector) realVectorFormat.parseObject("{0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0}"); assertEquals(24, parsed.getDimension()); }
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SingularValueSolverTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SingularValueSolverTest.java?rev=783702&r1=783701&r2=783702&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SingularValueSolverTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SingularValueSolverTest.java Thu Jun 11 08:54:02 2009 @@ -25,7 +25,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.linear.SingularValueDecompositionImpl; public class SingularValueSolverTest extends TestCase { @@ -69,7 +69,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 @@ -112,7 +112,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 @@ -139,11 +139,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 RealMatrixImpl + // using Array2DRowRealMatrix for (int i = 0; i < b.getColumnDimension(); ++i) { assertEquals(0, solver.solve(b.getColumnVector(i)).subtract(xRef.getColumnVector(i)).getNorm(), @@ -152,8 +152,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, solver.solve(v).subtract(xRef.getColumnVector(i)).getNorm(), 1.0e-13); Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SparseFieldMatrixTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SparseFieldMatrixTest.java?rev=783702&r1=783701&r2=783702&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SparseFieldMatrixTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SparseFieldMatrixTest.java Thu Jun 11 08:54:02 2009 @@ -207,7 +207,7 @@ SparseFieldMatrix<Fraction> m2 = createSparseMatrix(testData2); assertClose("inverse multiply", m.multiply(mInv), identity, entryTolerance); - assertClose("inverse multiply", m.multiply(new FieldMatrixImpl<Fraction>(testDataInv)), identity, + assertClose("inverse multiply", m.multiply(new Array2DRowFieldMatrix<Fraction>(testDataInv)), identity, entryTolerance); assertClose("inverse multiply", mInv.multiply(m), identity, entryTolerance); @@ -225,7 +225,7 @@ } } - // Additional Test for RealMatrixImplTest.testMultiply + // Additional Test for Array2DRowRealMatrixTest.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) } }; @@ -264,7 +264,7 @@ assertClose("identity operate", testVector, m.operate(testVector), entryTolerance); assertClose("identity operate", testVector, m.operate( - new FieldVectorImpl<Fraction>(testVector)).getData(), entryTolerance); + new ArrayFieldVector<Fraction>(testVector)).getData(), entryTolerance); m = createSparseMatrix(bigSingular); try { m.operate(testVector); @@ -303,7 +303,7 @@ assertClose("premultiply", m.preMultiply(testVector), preMultTest, normTolerance); assertClose("premultiply", m.preMultiply( - new FieldVectorImpl<Fraction>(testVector).getData()), preMultTest, normTolerance); + new ArrayFieldVector<Fraction>(testVector).getData()), preMultTest, normTolerance); m = createSparseMatrix(bigSingular); try { m.preMultiply(testVector); @@ -506,8 +506,8 @@ public void testGetRowVector() { FieldMatrix<Fraction> m = createSparseMatrix(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("Row0", mRow0, m.getRowVector(0)); assertEquals("Row3", mRow3, m.getRowVector(3)); try { @@ -549,7 +549,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 testEqualsAndHashCode() { Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SparseRealMatrixTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SparseRealMatrixTest.java?rev=783702&r1=783701&r2=783702&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SparseRealMatrixTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/SparseRealMatrixTest.java Thu Jun 11 08:54:02 2009 @@ -213,7 +213,7 @@ } } - // Additional Test for RealMatrixImplTest.testMultiply + // Additional Test for Array2DRowRealMatrixTest.testMultiply private double[][] d3 = new double[][] { { 1, 2, 3, 4 }, { 5, 6, 7, 8 } }; private double[][] d4 = new double[][] { { 1 }, { 2 }, { 3 }, { 4 } }; @@ -252,7 +252,7 @@ assertClose("identity operate", testVector, m.operate(testVector), entryTolerance); assertClose("identity operate", testVector, m.operate( - new RealVectorImpl(testVector)).getData(), entryTolerance); + new ArrayRealVector(testVector)).getData(), entryTolerance); m = createSparseMatrix(bigSingular); try { m.operate(testVector); @@ -291,7 +291,7 @@ assertClose("premultiply", m.preMultiply(testVector), preMultTest, normTolerance); assertClose("premultiply", m.preMultiply( - new RealVectorImpl(testVector).getData()), preMultTest, normTolerance); + new ArrayRealVector(testVector).getData()), preMultTest, normTolerance); m = createSparseMatrix(bigSingular); try { m.preMultiply(testVector); @@ -494,8 +494,8 @@ public void testGetRowVector() { RealMatrix m = createSparseMatrix(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 { @@ -537,7 +537,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 testEqualsAndHashCode() { Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/linear/SimplexSolverTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/linear/SimplexSolverTest.java?rev=783702&r1=783701&r2=783702&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/linear/SimplexSolverTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/linear/SimplexSolverTest.java Thu Jun 11 08:54:02 2009 @@ -23,7 +23,7 @@ import java.util.Collection; import org.apache.commons.math.linear.RealVector; -import org.apache.commons.math.linear.RealVectorImpl; +import org.apache.commons.math.linear.ArrayRealVector; import org.apache.commons.math.optimization.GoalType; import org.apache.commons.math.optimization.OptimizationException; import org.apache.commons.math.optimization.RealPointValuePair; @@ -339,7 +339,7 @@ String[] equationParts = s.split("[>|<]?="); double rhs = Double.parseDouble(equationParts[1].trim()); - RealVector lhs = new RealVectorImpl(numCoefficients); + RealVector lhs = new ArrayRealVector(numCoefficients); String left = equationParts[0].replaceAll(" ?x", ""); String[] coefficients = left.split(" "); for (String coefficient : coefficients) { Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/stat/correlation/CovarianceTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/stat/correlation/CovarianceTest.java?rev=783702&r1=783701&r2=783702&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/stat/correlation/CovarianceTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/stat/correlation/CovarianceTest.java Thu Jun 11 08:54:02 2009 @@ -18,7 +18,7 @@ import org.apache.commons.math.TestUtils; import org.apache.commons.math.linear.RealMatrix; -import org.apache.commons.math.linear.RealMatrixImpl; +import org.apache.commons.math.linear.Array2DRowRealMatrix; import org.apache.commons.math.stat.descriptive.moment.Variance; import junit.framework.TestCase; @@ -170,7 +170,7 @@ } catch (IllegalArgumentException ex) { // Expected } - RealMatrix matrix = new RealMatrixImpl(new double[][] {{0},{1}}); + RealMatrix matrix = new Array2DRowRealMatrix(new double[][] {{0},{1}}); try { new Covariance(matrix); fail("Expecting IllegalArgumentException"); @@ -199,7 +199,7 @@ assertEquals(covarianceMatrix.getEntry(2, 3), covarianceMatrix.getEntry(3, 2), Double.MIN_VALUE); // All columns same -> all entries = column variance - RealMatrix repeatedColumns = new RealMatrixImpl(47, 3); + RealMatrix repeatedColumns = new Array2DRowRealMatrix(47, 3); for (int i = 0; i < 3; i++) { repeatedColumns.setColumnMatrix(i, matrix.getColumnMatrix(0)); } @@ -231,6 +231,6 @@ System.arraycopy(data, ptr, matrixData[i], 0, nCols); ptr += nCols; } - return new RealMatrixImpl(matrixData); + return new Array2DRowRealMatrix(matrixData); } } Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java?rev=783702&r1=783701&r2=783702&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java Thu Jun 11 08:54:02 2009 @@ -23,7 +23,7 @@ import org.apache.commons.math.linear.MatrixUtils; import org.apache.commons.math.linear.MatrixVisitorException; import org.apache.commons.math.linear.RealMatrix; -import org.apache.commons.math.linear.RealMatrixImpl; +import org.apache.commons.math.linear.Array2DRowRealMatrix; import org.junit.Before; import org.junit.Test; @@ -91,9 +91,9 @@ TestUtils.assertEquals(residuals, new double[]{0d,0d,0d,0d,0d,0d}, 1e-14); RealMatrix errors = - new RealMatrixImpl(regression.estimateRegressionParametersVariance(), false); + new Array2DRowRealMatrix(regression.estimateRegressionParametersVariance(), false); final double[] s = { 1.0, -1.0 / 2.0, -1.0 / 3.0, -1.0 / 4.0, -1.0 / 5.0, -1.0 / 6.0 }; - RealMatrix referenceVariance = new RealMatrixImpl(s.length, s.length); + RealMatrix referenceVariance = new Array2DRowRealMatrix(s.length, s.length); referenceVariance.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor() { @Override public double visit(int row, int column, double value)
