commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1166629 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/filter/ main/java/org/apache/commons/math/linear/ main/java/org/apache/commons/math/optimization/direct/ main/java/org/apache/commons/math/optimization/linear/ ...
Date Thu, 08 Sep 2011 11:15:03 GMT
Author: erans
Date: Thu Sep  8 11:15:02 2011
New Revision: 1166629

URL: http://svn.apache.org/viewvc?rev=1166629&view=rev
Log:
MATH-663
Removed "getData" method in "RealVector"; replaced calls with "toArray()".

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/filter/KalmanFilter.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayRealVector.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecompositionImpl.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/InvertibleRealLinearOperator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVector.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexTableau.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/AbstractMultipleLinearRegression.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegression.java
    commons/proper/math/trunk/src/site/xdoc/changes.xml
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/Array2DRowRealMatrixTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/ArrayRealVectorTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockRealMatrixTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealMatrixTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/GLSMultipleLinearRegressionTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/filter/KalmanFilter.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/filter/KalmanFilter.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/filter/KalmanFilter.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/filter/KalmanFilter.java Thu Sep  8 11:15:02 2011
@@ -234,7 +234,7 @@ public class KalmanFilter {
      * @return the state estimation vector
      */
     public double[] getStateEstimation() {
-        return stateEstimation.getData();
+        return stateEstimation.toArray();
     }
 
     /**

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayRealVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayRealVector.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayRealVector.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayRealVector.java Thu Sep  8 11:15:02 2011
@@ -430,12 +430,6 @@ public class ArrayRealVector extends Rea
         }
     }
 
-    /** {@inheritDoc} */
-    @Override
-    public double[] getData() {
-        return data.clone();
-    }
-
     /**
      * Get a reference to the underlying data array.
      * This method does not make a fresh copy of the underlying data.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecompositionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecompositionImpl.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecompositionImpl.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecompositionImpl.java Thu Sep  8 11:15:02 2011
@@ -202,7 +202,7 @@ public class CholeskyDecompositionImpl i
                 throw new DimensionMismatchException(b.getDimension(), m);
             }
 
-            final double[] x = b.getData();
+            final double[] x = b.toArray();
 
             // Solve LY = b
             for (int j = 0; j < m; j++) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/InvertibleRealLinearOperator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/InvertibleRealLinearOperator.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/InvertibleRealLinearOperator.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/InvertibleRealLinearOperator.java Thu Sep  8 11:15:02 2011
@@ -42,7 +42,7 @@ public abstract class InvertibleRealLine
         if (x instanceof ArrayRealVector) {
             return ((ArrayRealVector) x).getDataRef();
         } else {
-            return x.getData();
+            return x.toArray();
         }
     }
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/OpenMapRealVector.java Thu Sep  8 11:15:02 2011
@@ -375,18 +375,6 @@ public class OpenMapRealVector extends S
     }
 
     /** {@inheritDoc} */
-    @Override
-    public double[] getData() {
-        double[] res = new double[virtualSize];
-        Iterator iter = entries.iterator();
-        while (iter.hasNext()) {
-            iter.advance();
-            res[iter.key()] = iter.value();
-        }
-        return res;
-    }
-
-    /** {@inheritDoc} */
     public int getDimension() {
         return virtualSize;
     }
@@ -656,7 +644,13 @@ public class OpenMapRealVector extends S
     /** {@inheritDoc} */
     @Override
     public double[] toArray() {
-        return getData();
+        double[] res = new double[virtualSize];
+        Iterator iter = entries.iterator();
+        while (iter.hasNext()) {
+            iter.advance();
+            res[iter.key()] = iter.value();
+        }
+        return res;
     }
 
     /**

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVector.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVector.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVector.java Thu Sep  8 11:15:02 2011
@@ -639,17 +639,6 @@ public abstract class RealVector {
     }
 
     /**
-     * Convert the vector to an array of {@code double}s.
-     * The array is independent from this vector data: the elements
-     * are copied.
-     *
-     * @return an array containing a copy of the vector elements.
-     */
-    public double[] getData() {
-        return toArray();
-    }
-
-    /**
      * Creates a unit vector pointing in the direction of this vector.
      * The instance is not changed by this method.
      *
@@ -947,12 +936,6 @@ public abstract class RealVector {
         return new RealVector() {
             /** {@inheritDoc} */
             @Override
-            public double[] getData() {
-                return v.getData();
-            }
-
-            /** {@inheritDoc} */
-            @Override
             public RealVector mapToSelf(UnivariateRealFunction function) {
                 throw new MathUnsupportedOperationException();
             }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java Thu Sep  8 11:15:02 2011
@@ -831,7 +831,7 @@ public class BOBYQAOptimizer
                 }
             }
 
-            f = computeObjectiveValue(currentBest.getData());
+            f = computeObjectiveValue(currentBest.toArray());
             
             if (!isMinimize)
                 f = -f;
@@ -1742,7 +1742,7 @@ public class BOBYQAOptimizer
                 }
             }
             
-            final double objectiveValue = computeObjectiveValue(currentBest.getData());
+            final double objectiveValue = computeObjectiveValue(currentBest.toArray());
             final double f = isMinimize ? objectiveValue : -objectiveValue;
             final int numEval = getEvaluations(); // nfm + 1
             fval.setEntry(nfm, f);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexTableau.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexTableau.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexTableau.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexTableau.java Thu Sep  8 11:15:02 2011
@@ -191,7 +191,7 @@ class SimplexTableau implements Serializ
         matrix.setEntry(zIndex, zIndex, maximize ? 1 : -1);
         RealVector objectiveCoefficients =
             maximize ? f.getCoefficients().mapMultiply(-1) : f.getCoefficients();
-        copyArray(objectiveCoefficients.getData(), matrix.getDataRef()[zIndex]);
+        copyArray(objectiveCoefficients.toArray(), matrix.getDataRef()[zIndex]);
         matrix.setEntry(zIndex, width - 1,
             maximize ? f.getConstantTerm() : -1 * f.getConstantTerm());
 
@@ -208,7 +208,7 @@ class SimplexTableau implements Serializ
             int row = getNumObjectiveFunctions() + i;
 
             // decision variable coefficients
-            copyArray(constraint.getCoefficients().getData(), matrix.getDataRef()[row]);
+            copyArray(constraint.getCoefficients().toArray(), matrix.getDataRef()[row]);
 
             // x-
             if (!restrictToNonNegative) {
@@ -296,7 +296,7 @@ class SimplexTableau implements Serializ
      */
     protected static double getInvertedCoefficientSum(final RealVector coefficients) {
         double sum = 0;
-        for (double coefficient : coefficients.getData()) {
+        for (double coefficient : coefficients.toArray()) {
             sum -= coefficient;
         }
         return sum;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/AbstractMultipleLinearRegression.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/AbstractMultipleLinearRegression.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/AbstractMultipleLinearRegression.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/AbstractMultipleLinearRegression.java Thu Sep  8 11:15:02 2011
@@ -245,7 +245,7 @@ public abstract class AbstractMultipleLi
      */
     public double[] estimateRegressionParameters() {
         RealVector b = calculateBeta();
-        return b.getData();
+        return b.toArray();
     }
 
     /**
@@ -254,7 +254,7 @@ public abstract class AbstractMultipleLi
     public double[] estimateResiduals() {
         RealVector b = calculateBeta();
         RealVector e = Y.subtract(X.operate(b));
-        return e.getData();
+        return e.toArray();
     }
 
     /**
@@ -328,7 +328,7 @@ public abstract class AbstractMultipleLi
      * @return Y variance
      */
     protected double calculateYVariance() {
-        return new Variance().evaluate(Y.getData());
+        return new Variance().evaluate(Y.toArray());
     }
 
     /**

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegression.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegression.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegression.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegression.java Thu Sep  8 11:15:02 2011
@@ -133,9 +133,9 @@ public class OLSMultipleLinearRegression
      */
     public double calculateTotalSumOfSquares() {
         if (isNoIntercept()) {
-            return StatUtils.sumSq(Y.getData());
+            return StatUtils.sumSq(Y.toArray());
         } else {
-            return new SecondMoment().evaluate(Y.getData());
+            return new SecondMoment().evaluate(Y.toArray());
         }
     }
 

Modified: commons/proper/math/trunk/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/changes.xml?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/changes.xml Thu Sep  8 11:15:02 2011
@@ -52,6 +52,10 @@ The <action> type attribute can be add,u
     If the output is not quite correct, check for invisible trailing spaces!
      -->
     <release version="3.0" date="TBD" description="TBD">
+      <action dev="erans" type="fix" issue="MATH-663">
+        Removed "getData()" method from "RealVector" as it was redundant with
+        "toArray()".
+      </action>
       <action dev="luc" type="update" issue="MATH-195" >
         Removed completely MathUserException. 
       </action>

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/Array2DRowRealMatrixTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/Array2DRowRealMatrixTest.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/Array2DRowRealMatrixTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/Array2DRowRealMatrixTest.java Thu Sep  8 11:15:02 2011
@@ -306,7 +306,7 @@ public final class Array2DRowRealMatrixT
         TestUtils.assertEquals("identity operate", testVector,
                     m.operate(testVector), entryTolerance);
         TestUtils.assertEquals("identity operate", testVector,
-                    m.operate(new ArrayRealVector(testVector)).getData(), entryTolerance);
+                    m.operate(new ArrayRealVector(testVector)).toArray(), entryTolerance);
         m = new Array2DRowRealMatrix(bigSingular);
         try {
             m.operate(testVector);
@@ -347,7 +347,7 @@ public final class Array2DRowRealMatrixT
         RealMatrix m = new Array2DRowRealMatrix(testData);
         TestUtils.assertEquals("premultiply", m.preMultiply(testVector),
                     preMultTest, normTolerance);
-        TestUtils.assertEquals("premultiply", m.preMultiply(new ArrayRealVector(testVector).getData()),
+        TestUtils.assertEquals("premultiply", m.preMultiply(new ArrayRealVector(testVector).toArray()),
                     preMultTest, normTolerance);
         m = new Array2DRowRealMatrix(bigSingular);
         try {

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/ArrayRealVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/ArrayRealVectorTest.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/ArrayRealVectorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/ArrayRealVectorTest.java Thu Sep  8 11:15:02 2011
@@ -204,10 +204,6 @@ public class ArrayRealVectorTest {
             throw unsupported();
         }
 
-        public double[] getData() {
-            return data.clone();
-        }
-
         public double dotProduct(RealVector v) {
             double dot = 0;
             for (int i = 0; i < data.length; i++) {
@@ -383,13 +379,13 @@ public class ArrayRealVectorTest {
         Assert.assertEquals("testData len", 3, v3_bis.getDimension());
         Assert.assertEquals("testData is 2.0 ", 2.0, v3_bis.getEntry(1), 0);
         Assert.assertNotSame(v3_bis.getDataRef(), vec1);
-        Assert.assertNotSame(v3_bis.getData(), vec1);
+        Assert.assertNotSame(v3_bis.toArray(), vec1);
 
         ArrayRealVector v3_ter = new ArrayRealVector(vec1, false);
         Assert.assertEquals("testData len", 3, v3_ter.getDimension());
         Assert.assertEquals("testData is 2.0 ", 2.0, v3_ter.getEntry(1), 0);
         Assert.assertSame(v3_ter.getDataRef(), vec1);
-        Assert.assertNotSame(v3_ter.getData(), vec1);
+        Assert.assertNotSame(v3_ter.toArray(), vec1);
 
         ArrayRealVector v4 = new ArrayRealVector(vec4, 3, 2);
         Assert.assertEquals("testData len", 2, v4.getDimension());
@@ -496,7 +492,7 @@ public class ArrayRealVectorTest {
 
         RealVector v_copy = v1.copy();
         Assert.assertEquals("testData len", 3, v_copy.getDimension());
-        Assert.assertNotSame("testData not same object ", v1.data, v_copy.getData());
+        Assert.assertNotSame("testData not same object ", v1.data, v_copy.toArray());
 
         double[] a_double = v1.toArray();
         Assert.assertEquals("testData len", 3, a_double.length);
@@ -566,179 +562,179 @@ public class ArrayRealVectorTest {
         //octave =  v1 .+ 2.0
         RealVector v_mapAdd = v1.mapAdd(2.0d);
         double[] result_mapAdd = {3d, 4d, 5d};
-        assertClose("compare vectors" ,result_mapAdd,v_mapAdd.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAdd,v_mapAdd.toArray(),normTolerance);
 
         //octave =  v1 .+ 2.0
         RealVector v_mapAddToSelf = v1.copy();
         v_mapAddToSelf.mapAddToSelf(2.0d);
         double[] result_mapAddToSelf = {3d, 4d, 5d};
-        assertClose("compare vectors" ,result_mapAddToSelf,v_mapAddToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAddToSelf,v_mapAddToSelf.toArray(),normTolerance);
 
         //octave =  v1 .- 2.0
         RealVector v_mapSubtract = v1.mapSubtract(2.0d);
         double[] result_mapSubtract = {-1d, 0d, 1d};
-        assertClose("compare vectors" ,result_mapSubtract,v_mapSubtract.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSubtract,v_mapSubtract.toArray(),normTolerance);
 
         //octave =  v1 .- 2.0
         RealVector v_mapSubtractToSelf = v1.copy();
         v_mapSubtractToSelf.mapSubtractToSelf(2.0d);
         double[] result_mapSubtractToSelf = {-1d, 0d, 1d};
-        assertClose("compare vectors" ,result_mapSubtractToSelf,v_mapSubtractToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSubtractToSelf,v_mapSubtractToSelf.toArray(),normTolerance);
 
         //octave =  v1 .* 2.0
         RealVector v_mapMultiply = v1.mapMultiply(2.0d);
         double[] result_mapMultiply = {2d, 4d, 6d};
-        assertClose("compare vectors" ,result_mapMultiply,v_mapMultiply.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapMultiply,v_mapMultiply.toArray(),normTolerance);
 
         //octave =  v1 .* 2.0
         RealVector v_mapMultiplyToSelf = v1.copy();
         v_mapMultiplyToSelf.mapMultiplyToSelf(2.0d);
         double[] result_mapMultiplyToSelf = {2d, 4d, 6d};
-        assertClose("compare vectors" ,result_mapMultiplyToSelf,v_mapMultiplyToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapMultiplyToSelf,v_mapMultiplyToSelf.toArray(),normTolerance);
 
         //octave =  v1 ./ 2.0
         RealVector v_mapDivide = v1.mapDivide(2.0d);
         double[] result_mapDivide = {.5d, 1d, 1.5d};
-        assertClose("compare vectors" ,result_mapDivide,v_mapDivide.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapDivide,v_mapDivide.toArray(),normTolerance);
 
         //octave =  v1 ./ 2.0
         RealVector v_mapDivideToSelf = v1.copy();
         v_mapDivideToSelf.mapDivideToSelf(2.0d);
         double[] result_mapDivideToSelf = {.5d, 1d, 1.5d};
-        assertClose("compare vectors" ,result_mapDivideToSelf,v_mapDivideToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapDivideToSelf,v_mapDivideToSelf.toArray(),normTolerance);
 
         //octave =  v1 .^ 2.0
         RealVector v_mapPow = v1.map(new Power(2));
         double[] result_mapPow = {1d, 4d, 9d};
-        assertClose("compare vectors" ,result_mapPow,v_mapPow.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapPow,v_mapPow.toArray(),normTolerance);
 
         //octave =  v1 .^ 2.0
         RealVector v_mapPowToSelf = v1.copy();
         v_mapPowToSelf.mapToSelf(new Power(2));
         double[] result_mapPowToSelf = {1d, 4d, 9d};
-        assertClose("compare vectors" ,result_mapPowToSelf,v_mapPowToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapPowToSelf,v_mapPowToSelf.toArray(),normTolerance);
 
         //octave =  exp(v1)
         RealVector v_mapExp = v1.map(new Exp());
         double[] result_mapExp = {2.718281828459045e+00d,7.389056098930650e+00d, 2.008553692318767e+01d};
-        assertClose("compare vectors" ,result_mapExp,v_mapExp.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapExp,v_mapExp.toArray(),normTolerance);
 
         //octave =  exp(v1)
         RealVector v_mapExpToSelf = v1.copy();
         v_mapExpToSelf.mapToSelf(new Exp());
         double[] result_mapExpToSelf = {2.718281828459045e+00d,7.389056098930650e+00d, 2.008553692318767e+01d};
-        assertClose("compare vectors" ,result_mapExpToSelf,v_mapExpToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapExpToSelf,v_mapExpToSelf.toArray(),normTolerance);
 
 
         //octave =  ???
         RealVector v_mapExpm1 = v1.map(new Expm1());
         double[] result_mapExpm1 = {1.718281828459045d,6.38905609893065d, 19.085536923187668d};
-        assertClose("compare vectors" ,result_mapExpm1,v_mapExpm1.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapExpm1,v_mapExpm1.toArray(),normTolerance);
 
         //octave =  ???
         RealVector v_mapExpm1ToSelf = v1.copy();
         v_mapExpm1ToSelf.mapToSelf(new Expm1());
         double[] result_mapExpm1ToSelf = {1.718281828459045d,6.38905609893065d, 19.085536923187668d};
-        assertClose("compare vectors" ,result_mapExpm1ToSelf,v_mapExpm1ToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapExpm1ToSelf,v_mapExpm1ToSelf.toArray(),normTolerance);
 
         //octave =  log(v1)
         RealVector v_mapLog = v1.map(new Log());
         double[] result_mapLog = {0d,6.931471805599453e-01d, 1.098612288668110e+00d};
-        assertClose("compare vectors" ,result_mapLog,v_mapLog.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLog,v_mapLog.toArray(),normTolerance);
 
         //octave =  log(v1)
         RealVector v_mapLogToSelf = v1.copy();
         v_mapLogToSelf.mapToSelf(new Log());
         double[] result_mapLogToSelf = {0d,6.931471805599453e-01d, 1.098612288668110e+00d};
-        assertClose("compare vectors" ,result_mapLogToSelf,v_mapLogToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLogToSelf,v_mapLogToSelf.toArray(),normTolerance);
 
         //octave =  log10(v1)
         RealVector v_mapLog10 = v1.map(new Log10());
         double[] result_mapLog10 = {0d,3.010299956639812e-01d, 4.771212547196624e-01d};
-        assertClose("compare vectors" ,result_mapLog10,v_mapLog10.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLog10,v_mapLog10.toArray(),normTolerance);
 
         //octave =  log(v1)
         RealVector v_mapLog10ToSelf = v1.copy();
         v_mapLog10ToSelf.mapToSelf(new Log10());
         double[] result_mapLog10ToSelf = {0d,3.010299956639812e-01d, 4.771212547196624e-01d};
-        assertClose("compare vectors" ,result_mapLog10ToSelf,v_mapLog10ToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLog10ToSelf,v_mapLog10ToSelf.toArray(),normTolerance);
 
         //octave =  ???
         RealVector v_mapLog1p = v1.map(new Log1p());
         double[] result_mapLog1p = {0.6931471805599453d,1.0986122886681096d,1.3862943611198906d};
-        assertClose("compare vectors" ,result_mapLog1p,v_mapLog1p.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLog1p,v_mapLog1p.toArray(),normTolerance);
 
         //octave =  ???
         RealVector v_mapLog1pToSelf = v1.copy();
         v_mapLog1pToSelf.mapToSelf(new Log1p());
         double[] result_mapLog1pToSelf = {0.6931471805599453d,1.0986122886681096d,1.3862943611198906d};
-        assertClose("compare vectors" ,result_mapLog1pToSelf,v_mapLog1pToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLog1pToSelf,v_mapLog1pToSelf.toArray(),normTolerance);
 
         //octave =  cosh(v1)
         RealVector v_mapCosh = v1.map(new Cosh());
         double[] result_mapCosh = {1.543080634815244e+00d,3.762195691083631e+00d, 1.006766199577777e+01d};
-        assertClose("compare vectors" ,result_mapCosh,v_mapCosh.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCosh,v_mapCosh.toArray(),normTolerance);
 
         //octave =  cosh(v1)
         RealVector v_mapCoshToSelf = v1.copy();
         v_mapCoshToSelf.mapToSelf(new Cosh());
         double[] result_mapCoshToSelf = {1.543080634815244e+00d,3.762195691083631e+00d, 1.006766199577777e+01d};
-        assertClose("compare vectors" ,result_mapCoshToSelf,v_mapCoshToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCoshToSelf,v_mapCoshToSelf.toArray(),normTolerance);
 
         //octave =  sinh(v1)
         RealVector v_mapSinh = v1.map(new Sinh());
         double[] result_mapSinh = {1.175201193643801e+00d,3.626860407847019e+00d, 1.001787492740990e+01d};
-        assertClose("compare vectors" ,result_mapSinh,v_mapSinh.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSinh,v_mapSinh.toArray(),normTolerance);
 
         //octave =  sinh(v1)
         RealVector v_mapSinhToSelf = v1.copy();
         v_mapSinhToSelf.mapToSelf(new Sinh());
         double[] result_mapSinhToSelf = {1.175201193643801e+00d,3.626860407847019e+00d, 1.001787492740990e+01d};
-        assertClose("compare vectors" ,result_mapSinhToSelf,v_mapSinhToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSinhToSelf,v_mapSinhToSelf.toArray(),normTolerance);
 
         //octave =  tanh(v1)
         RealVector v_mapTanh = v1.map(new Tanh());
         double[] result_mapTanh = {7.615941559557649e-01d,9.640275800758169e-01d,9.950547536867305e-01d};
-        assertClose("compare vectors" ,result_mapTanh,v_mapTanh.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapTanh,v_mapTanh.toArray(),normTolerance);
 
         //octave =  tanh(v1)
         RealVector v_mapTanhToSelf = v1.copy();
         v_mapTanhToSelf.mapToSelf(new Tanh());
         double[] result_mapTanhToSelf = {7.615941559557649e-01d,9.640275800758169e-01d,9.950547536867305e-01d};
-        assertClose("compare vectors" ,result_mapTanhToSelf,v_mapTanhToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapTanhToSelf,v_mapTanhToSelf.toArray(),normTolerance);
 
         //octave =  cos(v1)
         RealVector v_mapCos = v1.map(new Cos());
         double[] result_mapCos = {5.403023058681398e-01d,-4.161468365471424e-01d, -9.899924966004454e-01d};
-        assertClose("compare vectors" ,result_mapCos,v_mapCos.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCos,v_mapCos.toArray(),normTolerance);
 
         //octave =  cos(v1)
         RealVector v_mapCosToSelf = v1.copy();
         v_mapCosToSelf.mapToSelf(new Cos());
         double[] result_mapCosToSelf = {5.403023058681398e-01d,-4.161468365471424e-01d, -9.899924966004454e-01d};
-        assertClose("compare vectors" ,result_mapCosToSelf,v_mapCosToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCosToSelf,v_mapCosToSelf.toArray(),normTolerance);
 
         //octave =  sin(v1)
         RealVector v_mapSin = v1.map(new Sin());
         double[] result_mapSin = {8.414709848078965e-01d,9.092974268256817e-01d,1.411200080598672e-01d};
-        assertClose("compare vectors" ,result_mapSin,v_mapSin.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSin,v_mapSin.toArray(),normTolerance);
 
         //octave =  sin(v1)
         RealVector v_mapSinToSelf = v1.copy();
         v_mapSinToSelf.mapToSelf(new Sin());
         double[] result_mapSinToSelf = {8.414709848078965e-01d,9.092974268256817e-01d,1.411200080598672e-01d};
-        assertClose("compare vectors" ,result_mapSinToSelf,v_mapSinToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSinToSelf,v_mapSinToSelf.toArray(),normTolerance);
 
         //octave =  tan(v1)
         RealVector v_mapTan = v1.map(new Tan());
         double[] result_mapTan = {1.557407724654902e+00d,-2.185039863261519e+00d,-1.425465430742778e-01d};
-        assertClose("compare vectors" ,result_mapTan,v_mapTan.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapTan,v_mapTan.toArray(),normTolerance);
 
         //octave =  tan(v1)
         RealVector v_mapTanToSelf = v1.copy();
         v_mapTanToSelf.mapToSelf(new Tan());
         double[] result_mapTanToSelf = {1.557407724654902e+00d,-2.185039863261519e+00d,-1.425465430742778e-01d};
-        assertClose("compare vectors" ,result_mapTanToSelf,v_mapTanToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapTanToSelf,v_mapTanToSelf.toArray(),normTolerance);
 
         double[] vat_a = {0d, 0.5d, 1.0d};
         ArrayRealVector vat = new ArrayRealVector(vat_a);
@@ -746,46 +742,46 @@ public class ArrayRealVectorTest {
         //octave =  acos(vat)
         RealVector v_mapAcos = vat.map(new Acos());
         double[] result_mapAcos = {1.570796326794897e+00d,1.047197551196598e+00d, 0.0d};
-        assertClose("compare vectors" ,result_mapAcos,v_mapAcos.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAcos,v_mapAcos.toArray(),normTolerance);
 
         //octave =  acos(vat)
         RealVector v_mapAcosToSelf = vat.copy();
         v_mapAcosToSelf.mapToSelf(new Acos());
         double[] result_mapAcosToSelf = {1.570796326794897e+00d,1.047197551196598e+00d, 0.0d};
-        assertClose("compare vectors" ,result_mapAcosToSelf,v_mapAcosToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAcosToSelf,v_mapAcosToSelf.toArray(),normTolerance);
 
         //octave =  asin(vat)
         RealVector v_mapAsin = vat.map(new Asin());
         double[] result_mapAsin = {0.0d,5.235987755982989e-01d,1.570796326794897e+00d};
-        assertClose("compare vectors" ,result_mapAsin,v_mapAsin.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAsin,v_mapAsin.toArray(),normTolerance);
 
         //octave =  asin(vat)
         RealVector v_mapAsinToSelf = vat.copy();
         v_mapAsinToSelf.mapToSelf(new Asin());
         double[] result_mapAsinToSelf = {0.0d,5.235987755982989e-01d,1.570796326794897e+00d};
-        assertClose("compare vectors" ,result_mapAsinToSelf,v_mapAsinToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAsinToSelf,v_mapAsinToSelf.toArray(),normTolerance);
 
         //octave =  atan(vat)
         RealVector v_mapAtan = vat.map(new Atan());
         double[] result_mapAtan = {0.0d,4.636476090008061e-01d,7.853981633974483e-01d};
-        assertClose("compare vectors" ,result_mapAtan,v_mapAtan.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAtan,v_mapAtan.toArray(),normTolerance);
 
         //octave =  atan(vat)
         RealVector v_mapAtanToSelf = vat.copy();
         v_mapAtanToSelf.mapToSelf(new Atan());
         double[] result_mapAtanToSelf = {0.0d,4.636476090008061e-01d,7.853981633974483e-01d};
-        assertClose("compare vectors" ,result_mapAtanToSelf,v_mapAtanToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAtanToSelf,v_mapAtanToSelf.toArray(),normTolerance);
 
         //octave =  v1 .^-1
         RealVector v_mapInv = v1.map(new Inverse());
         double[] result_mapInv = {1d,0.5d,3.333333333333333e-01d};
-        assertClose("compare vectors" ,result_mapInv,v_mapInv.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapInv,v_mapInv.toArray(),normTolerance);
 
         //octave =  v1 .^-1
         RealVector v_mapInvToSelf = v1.copy();
         v_mapInvToSelf.mapToSelf(new Inverse());
         double[] result_mapInvToSelf = {1d,0.5d,3.333333333333333e-01d};
-        assertClose("compare vectors" ,result_mapInvToSelf,v_mapInvToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapInvToSelf,v_mapInvToSelf.toArray(),normTolerance);
 
         double[] abs_a = {-1.0d, 0.0d, 1.0d};
         ArrayRealVector abs_v = new ArrayRealVector(abs_a);
@@ -793,24 +789,24 @@ public class ArrayRealVectorTest {
         //octave =  abs(abs_v)
         RealVector v_mapAbs = abs_v.map(new Abs());
         double[] result_mapAbs = {1d,0d,1d};
-        assertClose("compare vectors" ,result_mapAbs,v_mapAbs.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAbs,v_mapAbs.toArray(),normTolerance);
 
         //octave = abs(abs_v)
         RealVector v_mapAbsToSelf = abs_v.copy();
         v_mapAbsToSelf.mapToSelf(new Abs());
         double[] result_mapAbsToSelf = {1d,0d,1d};
-        assertClose("compare vectors" ,result_mapAbsToSelf,v_mapAbsToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAbsToSelf,v_mapAbsToSelf.toArray(),normTolerance);
 
         //octave =   sqrt(v1)
         RealVector v_mapSqrt = v1.map(new Sqrt());
         double[] result_mapSqrt = {1d,1.414213562373095e+00d,1.732050807568877e+00d};
-        assertClose("compare vectors" ,result_mapSqrt,v_mapSqrt.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSqrt,v_mapSqrt.toArray(),normTolerance);
 
         //octave =  sqrt(v1)
         RealVector v_mapSqrtToSelf = v1.copy();
         v_mapSqrtToSelf.mapToSelf(new Sqrt());
         double[] result_mapSqrtToSelf = {1d,1.414213562373095e+00d,1.732050807568877e+00d};
-        assertClose("compare vectors" ,result_mapSqrtToSelf,v_mapSqrtToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSqrtToSelf,v_mapSqrtToSelf.toArray(),normTolerance);
 
         double[] cbrt_a = {-2.0d, 0.0d, 2.0d};
         ArrayRealVector cbrt_v = new ArrayRealVector(cbrt_a);
@@ -818,13 +814,13 @@ public class ArrayRealVectorTest {
         //octave =  ???
         RealVector v_mapCbrt = cbrt_v.map(new Cbrt());
         double[] result_mapCbrt = {-1.2599210498948732d,0d,1.2599210498948732d};
-        assertClose("compare vectors" ,result_mapCbrt,v_mapCbrt.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCbrt,v_mapCbrt.toArray(),normTolerance);
 
         //octave = ???
         RealVector v_mapCbrtToSelf = cbrt_v.copy();
         v_mapCbrtToSelf.mapToSelf(new Cbrt());
         double[] result_mapCbrtToSelf =  {-1.2599210498948732d,0d,1.2599210498948732d};
-        assertClose("compare vectors" ,result_mapCbrtToSelf,v_mapCbrtToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCbrtToSelf,v_mapCbrtToSelf.toArray(),normTolerance);
 
         double[] ceil_a = {-1.1d, 0.9d, 1.1d};
         ArrayRealVector ceil_v = new ArrayRealVector(ceil_a);
@@ -832,59 +828,59 @@ public class ArrayRealVectorTest {
         //octave =  ceil(ceil_v)
         RealVector v_mapCeil = ceil_v.map(new Ceil());
         double[] result_mapCeil = {-1d,1d,2d};
-        assertClose("compare vectors" ,result_mapCeil,v_mapCeil.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCeil,v_mapCeil.toArray(),normTolerance);
 
         //octave = ceil(ceil_v)
         RealVector v_mapCeilToSelf = ceil_v.copy();
         v_mapCeilToSelf.mapToSelf(new Ceil());
         double[] result_mapCeilToSelf =  {-1d,1d,2d};
-        assertClose("compare vectors" ,result_mapCeilToSelf,v_mapCeilToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCeilToSelf,v_mapCeilToSelf.toArray(),normTolerance);
 
         //octave =  floor(ceil_v)
         RealVector v_mapFloor = ceil_v.map(new Floor());
         double[] result_mapFloor = {-2d,0d,1d};
-        assertClose("compare vectors" ,result_mapFloor,v_mapFloor.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapFloor,v_mapFloor.toArray(),normTolerance);
 
         //octave = floor(ceil_v)
         RealVector v_mapFloorToSelf = ceil_v.copy();
         v_mapFloorToSelf.mapToSelf(new Floor());
         double[] result_mapFloorToSelf =  {-2d,0d,1d};
-        assertClose("compare vectors" ,result_mapFloorToSelf,v_mapFloorToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapFloorToSelf,v_mapFloorToSelf.toArray(),normTolerance);
 
         //octave =  ???
         RealVector v_mapRint = ceil_v.map(new Rint());
         double[] result_mapRint = {-1d,1d,1d};
-        assertClose("compare vectors" ,result_mapRint,v_mapRint.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapRint,v_mapRint.toArray(),normTolerance);
 
         //octave = ???
         RealVector v_mapRintToSelf = ceil_v.copy();
         v_mapRintToSelf.mapToSelf(new Rint());
         double[] result_mapRintToSelf =  {-1d,1d,1d};
-        assertClose("compare vectors" ,result_mapRintToSelf,v_mapRintToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapRintToSelf,v_mapRintToSelf.toArray(),normTolerance);
 
         //octave =  ???
         RealVector v_mapSignum = ceil_v.map(new Signum());
         double[] result_mapSignum = {-1d,1d,1d};
-        assertClose("compare vectors" ,result_mapSignum,v_mapSignum.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSignum,v_mapSignum.toArray(),normTolerance);
 
         //octave = ???
         RealVector v_mapSignumToSelf = ceil_v.copy();
         v_mapSignumToSelf.mapToSelf(new Signum());
         double[] result_mapSignumToSelf =  {-1d,1d,1d};
-        assertClose("compare vectors" ,result_mapSignumToSelf,v_mapSignumToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSignumToSelf,v_mapSignumToSelf.toArray(),normTolerance);
 
 
         // Is with the used resolutions of limited value as test
         //octave =  ???
         RealVector v_mapUlp = ceil_v.map(new Ulp());
         double[] result_mapUlp = {2.220446049250313E-16d,1.1102230246251565E-16d,2.220446049250313E-16d};
-        assertClose("compare vectors" ,result_mapUlp,v_mapUlp.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapUlp,v_mapUlp.toArray(),normTolerance);
 
         //octave = ???
         RealVector v_mapUlpToSelf = ceil_v.copy();
         v_mapUlpToSelf.mapToSelf(new Ulp());
         double[] result_mapUlpToSelf = {2.220446049250313E-16d,1.1102230246251565E-16d,2.220446049250313E-16d};
-        assertClose("compare vectors" ,result_mapUlpToSelf,v_mapUlpToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapUlpToSelf,v_mapUlpToSelf.toArray(),normTolerance);
     }
 
     @Test
@@ -944,47 +940,47 @@ public class ArrayRealVectorTest {
         //octave =  v1 + v2
         ArrayRealVector v_add = v1.add(v2);
         double[] result_add = {5d, 7d, 9d};
-        assertClose("compare vect" ,v_add.getData(), result_add, normTolerance);
+        assertClose("compare vect" ,v_add.toArray(), result_add, normTolerance);
 
         RealVectorTestImpl vt2 = new RealVectorTestImpl(vec2);
         RealVector v_add_i = v1.add(vt2);
         double[] result_add_i = {5d, 7d, 9d};
-        assertClose("compare vect" ,v_add_i.getData(),result_add_i,normTolerance);
+        assertClose("compare vect" ,v_add_i.toArray(),result_add_i,normTolerance);
 
         //octave =  v1 - v2
         ArrayRealVector v_subtract = v1.subtract(v2);
         double[] result_subtract = {-3d, -3d, -3d};
-        assertClose("compare vect" ,v_subtract.getData(),result_subtract,normTolerance);
+        assertClose("compare vect" ,v_subtract.toArray(),result_subtract,normTolerance);
 
         RealVector v_subtract_i = v1.subtract(vt2);
         double[] result_subtract_i = {-3d, -3d, -3d};
-        assertClose("compare vect" ,v_subtract_i.getData(),result_subtract_i,normTolerance);
+        assertClose("compare vect" ,v_subtract_i.toArray(),result_subtract_i,normTolerance);
 
         // octave v1 .* v2
         ArrayRealVector  v_ebeMultiply = v1.ebeMultiply(v2);
         double[] result_ebeMultiply = {4d, 10d, 18d};
-        assertClose("compare vect" ,v_ebeMultiply.getData(),result_ebeMultiply,normTolerance);
+        assertClose("compare vect" ,v_ebeMultiply.toArray(),result_ebeMultiply,normTolerance);
 
         RealVector  v_ebeMultiply_2 = v1.ebeMultiply(v2_t);
         double[] result_ebeMultiply_2 = {4d, 10d, 18d};
-        assertClose("compare vect" ,v_ebeMultiply_2.getData(),result_ebeMultiply_2,normTolerance);
+        assertClose("compare vect" ,v_ebeMultiply_2.toArray(),result_ebeMultiply_2,normTolerance);
 
         RealVector  v_ebeMultiply_3 = v1.ebeMultiply((RealVector) v2);
         double[] result_ebeMultiply_3 = {4d, 10d, 18d};
-        assertClose("compare vect" ,v_ebeMultiply_3.getData(),result_ebeMultiply_3,normTolerance);
+        assertClose("compare vect" ,v_ebeMultiply_3.toArray(),result_ebeMultiply_3,normTolerance);
 
         // octave v1 ./ 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);
+        assertClose("compare vect" ,v_ebeDivide.toArray(),result_ebeDivide,normTolerance);
 
         RealVector  v_ebeDivide_2 = v1.ebeDivide(v2_t);
         double[] result_ebeDivide_2 = {0.25d, 0.4d, 0.5d};
-        assertClose("compare vect" ,v_ebeDivide_2.getData(),result_ebeDivide_2,normTolerance);
+        assertClose("compare vect" ,v_ebeDivide_2.toArray(),result_ebeDivide_2,normTolerance);
 
         RealVector  v_ebeDivide_3 = v1.ebeDivide((RealVector) v2);
         double[] result_ebeDivide_3 = {0.25d, 0.4d, 0.5d};
-        assertClose("compare vect" ,v_ebeDivide_3.getData(),result_ebeDivide_3,normTolerance);
+        assertClose("compare vect" ,v_ebeDivide_3.toArray(),result_ebeDivide_3,normTolerance);
 
         // octave  dot(v1,v2)
         double dot =  v1.dotProduct(v2);
@@ -1005,7 +1001,7 @@ public class ArrayRealVectorTest {
 
         RealVector v_unitVector = v1.unitVector();
         RealVector v_unitVector_2 = v1.mapDivide(v1.getNorm());
-        assertClose("compare vect" ,v_unitVector.getData(),v_unitVector_2.getData(),normTolerance);
+        assertClose("compare vect" ,v_unitVector.toArray(),v_unitVector_2.toArray(),normTolerance);
 
         try {
             v_null.unitVector();
@@ -1016,7 +1012,7 @@ public class ArrayRealVectorTest {
 
         ArrayRealVector v_unitize = v1.copy();
         v_unitize.unitize();
-        assertClose("compare vect" ,v_unitVector_2.getData(),v_unitize.getData(),normTolerance);
+        assertClose("compare vect" ,v_unitVector_2.toArray(),v_unitize.toArray(),normTolerance);
         try {
             v_null.unitize();
             Assert.fail("Expecting MathArithmeticException");
@@ -1026,11 +1022,11 @@ public class ArrayRealVectorTest {
 
         RealVector v_projection = v1.projection(v2);
         double[] result_projection = {1.662337662337662, 2.0779220779220777, 2.493506493506493};
-        assertClose("compare vect", v_projection.getData(), result_projection, normTolerance);
+        assertClose("compare vect", v_projection.toArray(), result_projection, normTolerance);
 
         RealVector v_projection_2 = v1.projection(v2_t);
         double[] result_projection_2 = {1.662337662337662, 2.0779220779220777, 2.493506493506493};
-        assertClose("compare vect", v_projection_2.getData(), result_projection_2, normTolerance);
+        assertClose("compare vect", v_projection_2.toArray(), result_projection_2, normTolerance);
     }
 
     @Test
@@ -1226,7 +1222,7 @@ public class ArrayRealVectorTest {
             y.setEntry(i, yi);
             expected[i] = a * xi + b * yi;
         }
-        final double[] actual = x.combine(a, b, y).getData();
+        final double[] actual = x.combine(a, b, y).toArray();
         for (int i = 0; i < dim; i++) {
             final double delta;
             if (expected[i] == 0d) {
@@ -1268,7 +1264,7 @@ public class ArrayRealVectorTest {
             y.setEntry(i, yi);
             expected[i] = a * xi + b * yi;
         }
-        final double[] actual = x.combine(a, b, y).getData();
+        final double[] actual = x.combine(a, b, y).toArray();
         for (int i = 0; i < dim; i++) {
             final double delta;
             if (expected[i] == 0d) {
@@ -1311,7 +1307,7 @@ public class ArrayRealVectorTest {
             expected[i] = a * xi + b * yi;
         }
         Assert.assertSame(x, x.combineToSelf(a, b, y));
-        final double[] actual = x.getData();
+        final double[] actual = x.toArray();
         for (int i = 0; i < dim; i++) {
             final double delta;
             if (expected[i] == 0d) {
@@ -1354,7 +1350,7 @@ public class ArrayRealVectorTest {
             expected[i] = a * xi + b * yi;
         }
         Assert.assertSame(x, x.combineToSelf(a, b, y));
-        final double[] actual = x.getData();
+        final double[] actual = x.toArray();
         for (int i = 0; i < dim; i++) {
             final double delta;
             if (expected[i] == 0d) {

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockRealMatrixTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockRealMatrixTest.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockRealMatrixTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/BlockRealMatrixTest.java Thu Sep  8 11:15:02 2011
@@ -328,7 +328,7 @@ public final class BlockRealMatrixTest {
     public void testOperate() {
         RealMatrix m = new BlockRealMatrix(id);
         assertClose(testVector, m.operate(testVector), entryTolerance);
-        assertClose(testVector, m.operate(new ArrayRealVector(testVector)).getData(), entryTolerance);
+        assertClose(testVector, m.operate(new ArrayRealVector(testVector)).toArray(), entryTolerance);
         m = new BlockRealMatrix(bigSingular);
         try {
             m.operate(testVector);
@@ -396,7 +396,7 @@ public final class BlockRealMatrixTest {
     public void testPremultiplyVector() {
         RealMatrix m = new BlockRealMatrix(testData);
         assertClose(m.preMultiply(testVector), preMultTest, normTolerance);
-        assertClose(m.preMultiply(new ArrayRealVector(testVector).getData()),
+        assertClose(m.preMultiply(new ArrayRealVector(testVector).toArray()),
                     preMultTest, normTolerance);
         m = new BlockRealMatrix(bigSingular);
         try {

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/MatrixUtilsTest.java Thu Sep  8 11:15:02 2011
@@ -309,7 +309,7 @@ public final class MatrixUtilsTest {
                        false);
         RealVector b = new ArrayRealVector(new double[] { 2,3,4,8 }, false);
         MatrixUtils.solveLowerTriangularSystem(rm, b);
-        TestUtils.assertEquals( new double[]{1,2,-1.66666666666667, 1.0}  , b.getData() , 1.0e-12);
+        TestUtils.assertEquals( new double[]{1,2,-1.66666666666667, 1.0}  , b.toArray() , 1.0e-12);
     }
     
      
@@ -323,7 +323,7 @@ public final class MatrixUtilsTest {
                        false);
         RealVector b = new ArrayRealVector(new double[] { 8,4,2 }, false);
         MatrixUtils.solveUpperTriangularSystem(rm, b);
-        TestUtils.assertEquals( new double[]{-1,3,1}  , b.getData() , 1.0e-12);
+        TestUtils.assertEquals( new double[]{-1,3,1}  , b.toArray() , 1.0e-12);
     }
 }
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealMatrixTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealMatrixTest.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealMatrixTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealMatrixTest.java Thu Sep  8 11:15:02 2011
@@ -257,7 +257,7 @@ public final class SparseRealMatrixTest 
         assertClose("identity operate", testVector, m.operate(testVector),
                 entryTolerance);
         assertClose("identity operate", testVector, m.operate(
-                new ArrayRealVector(testVector)).getData(), entryTolerance);
+                new ArrayRealVector(testVector)).toArray(), entryTolerance);
         m = createSparseMatrix(bigSingular);
         try {
             m.operate(testVector);
@@ -298,7 +298,7 @@ public final class SparseRealMatrixTest 
         assertClose("premultiply", m.preMultiply(testVector), preMultTest,
             normTolerance);
         assertClose("premultiply", m.preMultiply(
-            new ArrayRealVector(testVector).getData()), preMultTest, normTolerance);
+            new ArrayRealVector(testVector).toArray()), preMultTest, normTolerance);
         m = createSparseMatrix(bigSingular);
         try {
             m.preMultiply(testVector);

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/linear/SparseRealVectorTest.java Thu Sep  8 11:15:02 2011
@@ -174,11 +174,6 @@ public class SparseRealVectorTest {
         }
 
         @Override
-        public double[] getData() {
-            return data.clone();
-        }
-
-        @Override
         public double dotProduct(RealVector v) {
             double dot = 0;
             for (int i = 0; i < data.length; i++) {
@@ -272,7 +267,7 @@ public class SparseRealVectorTest {
 
         @Override
         public double[] toArray() {
-            throw unsupported();
+            return data.clone();
         }
 
         public boolean isNaN() {
@@ -416,179 +411,179 @@ public class SparseRealVectorTest {
         //octave =  v1 .+ 2.0
         RealVector v_mapAdd = v1.mapAdd(2.0d);
         double[] result_mapAdd = {3d, 4d, 5d};
-        assertClose("compare vectors" ,result_mapAdd,v_mapAdd.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAdd,v_mapAdd.toArray(),normTolerance);
 
         //octave =  v1 .+ 2.0
         RealVector v_mapAddToSelf = v1.copy();
         v_mapAddToSelf.mapAddToSelf(2.0d);
         double[] result_mapAddToSelf = {3d, 4d, 5d};
-        assertClose("compare vectors" ,result_mapAddToSelf,v_mapAddToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAddToSelf,v_mapAddToSelf.toArray(),normTolerance);
 
         //octave =  v1 .- 2.0
         RealVector v_mapSubtract = v1.mapSubtract(2.0d);
         double[] result_mapSubtract = {-1d, 0d, 1d};
-        assertClose("compare vectors" ,result_mapSubtract,v_mapSubtract.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSubtract,v_mapSubtract.toArray(),normTolerance);
 
         //octave =  v1 .- 2.0
         RealVector v_mapSubtractToSelf = v1.copy();
         v_mapSubtractToSelf.mapSubtractToSelf(2.0d);
         double[] result_mapSubtractToSelf = {-1d, 0d, 1d};
-        assertClose("compare vectors" ,result_mapSubtractToSelf,v_mapSubtractToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSubtractToSelf,v_mapSubtractToSelf.toArray(),normTolerance);
 
         //octave =  v1 .* 2.0
         RealVector v_mapMultiply = v1.mapMultiply(2.0d);
         double[] result_mapMultiply = {2d, 4d, 6d};
-        assertClose("compare vectors" ,result_mapMultiply,v_mapMultiply.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapMultiply,v_mapMultiply.toArray(),normTolerance);
 
         //octave =  v1 .* 2.0
         RealVector v_mapMultiplyToSelf = v1.copy();
         v_mapMultiplyToSelf.mapMultiplyToSelf(2.0d);
         double[] result_mapMultiplyToSelf = {2d, 4d, 6d};
-        assertClose("compare vectors" ,result_mapMultiplyToSelf,v_mapMultiplyToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapMultiplyToSelf,v_mapMultiplyToSelf.toArray(),normTolerance);
 
         //octave =  v1 ./ 2.0
         RealVector v_mapDivide = v1.mapDivide(2.0d);
         double[] result_mapDivide = {.5d, 1d, 1.5d};
-        assertClose("compare vectors" ,result_mapDivide,v_mapDivide.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapDivide,v_mapDivide.toArray(),normTolerance);
 
         //octave =  v1 ./ 2.0
         RealVector v_mapDivideToSelf = v1.copy();
         v_mapDivideToSelf.mapDivideToSelf(2.0d);
         double[] result_mapDivideToSelf = {.5d, 1d, 1.5d};
-        assertClose("compare vectors" ,result_mapDivideToSelf,v_mapDivideToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapDivideToSelf,v_mapDivideToSelf.toArray(),normTolerance);
 
         //octave =  v1 .^ 2.0
         RealVector v_mapPow = v1.map(new Power(2));
         double[] result_mapPow = {1d, 4d, 9d};
-        assertClose("compare vectors" ,result_mapPow,v_mapPow.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapPow,v_mapPow.toArray(),normTolerance);
 
         //octave =  v1 .^ 2.0
         RealVector v_mapPowToSelf = v1.copy();
         v_mapPowToSelf.mapToSelf(new Power(2));
         double[] result_mapPowToSelf = {1d, 4d, 9d};
-        assertClose("compare vectors" ,result_mapPowToSelf,v_mapPowToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapPowToSelf,v_mapPowToSelf.toArray(),normTolerance);
 
         //octave =  exp(v1)
         RealVector v_mapExp = v1.map(new Exp());
         double[] result_mapExp = {2.718281828459045e+00d,7.389056098930650e+00d, 2.008553692318767e+01d};
-        assertClose("compare vectors" ,result_mapExp,v_mapExp.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapExp,v_mapExp.toArray(),normTolerance);
 
         //octave =  exp(v1)
         RealVector v_mapExpToSelf = v1.copy();
         v_mapExpToSelf.mapToSelf(new Exp());
         double[] result_mapExpToSelf = {2.718281828459045e+00d,7.389056098930650e+00d, 2.008553692318767e+01d};
-        assertClose("compare vectors" ,result_mapExpToSelf,v_mapExpToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapExpToSelf,v_mapExpToSelf.toArray(),normTolerance);
 
 
         //octave =  ???
         RealVector v_mapExpm1 = v1.map(new Expm1());
         double[] result_mapExpm1 = {1.718281828459045d,6.38905609893065d, 19.085536923187668d};
-        assertClose("compare vectors" ,result_mapExpm1,v_mapExpm1.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapExpm1,v_mapExpm1.toArray(),normTolerance);
 
         //octave =  ???
         RealVector v_mapExpm1ToSelf = v1.copy();
         v_mapExpm1ToSelf.mapToSelf(new Expm1());
         double[] result_mapExpm1ToSelf = {1.718281828459045d,6.38905609893065d, 19.085536923187668d};
-        assertClose("compare vectors" ,result_mapExpm1ToSelf,v_mapExpm1ToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapExpm1ToSelf,v_mapExpm1ToSelf.toArray(),normTolerance);
 
         //octave =  log(v1)
         RealVector v_mapLog = v1.map(new Log());
         double[] result_mapLog = {0d,6.931471805599453e-01d, 1.098612288668110e+00d};
-        assertClose("compare vectors" ,result_mapLog,v_mapLog.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLog,v_mapLog.toArray(),normTolerance);
 
         //octave =  log(v1)
         RealVector v_mapLogToSelf = v1.copy();
         v_mapLogToSelf.mapToSelf(new Log());
         double[] result_mapLogToSelf = {0d,6.931471805599453e-01d, 1.098612288668110e+00d};
-        assertClose("compare vectors" ,result_mapLogToSelf,v_mapLogToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLogToSelf,v_mapLogToSelf.toArray(),normTolerance);
 
         //octave =  log10(v1)
         RealVector v_mapLog10 = v1.map(new Log10());
         double[] result_mapLog10 = {0d,3.010299956639812e-01d, 4.771212547196624e-01d};
-        assertClose("compare vectors" ,result_mapLog10,v_mapLog10.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLog10,v_mapLog10.toArray(),normTolerance);
 
         //octave =  log(v1)
         RealVector v_mapLog10ToSelf = v1.copy();
         v_mapLog10ToSelf.mapToSelf(new Log10());
         double[] result_mapLog10ToSelf = {0d,3.010299956639812e-01d, 4.771212547196624e-01d};
-        assertClose("compare vectors" ,result_mapLog10ToSelf,v_mapLog10ToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLog10ToSelf,v_mapLog10ToSelf.toArray(),normTolerance);
 
         //octave =  ???
         RealVector v_mapLog1p = v1.map(new Log1p());
         double[] result_mapLog1p = {0.6931471805599453d,1.0986122886681096d,1.3862943611198906d};
-        assertClose("compare vectors" ,result_mapLog1p,v_mapLog1p.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLog1p,v_mapLog1p.toArray(),normTolerance);
 
         //octave =  ???
         RealVector v_mapLog1pToSelf = v1.copy();
         v_mapLog1pToSelf.mapToSelf(new Log1p());
         double[] result_mapLog1pToSelf = {0.6931471805599453d,1.0986122886681096d,1.3862943611198906d};
-        assertClose("compare vectors" ,result_mapLog1pToSelf,v_mapLog1pToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapLog1pToSelf,v_mapLog1pToSelf.toArray(),normTolerance);
 
         //octave =  cosh(v1)
         RealVector v_mapCosh = v1.map(new Cosh());
         double[] result_mapCosh = {1.543080634815244e+00d,3.762195691083631e+00d, 1.006766199577777e+01d};
-        assertClose("compare vectors" ,result_mapCosh,v_mapCosh.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCosh,v_mapCosh.toArray(),normTolerance);
 
         //octave =  cosh(v1)
         RealVector v_mapCoshToSelf = v1.copy();
         v_mapCoshToSelf.mapToSelf(new Cosh());
         double[] result_mapCoshToSelf = {1.543080634815244e+00d,3.762195691083631e+00d, 1.006766199577777e+01d};
-        assertClose("compare vectors" ,result_mapCoshToSelf,v_mapCoshToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCoshToSelf,v_mapCoshToSelf.toArray(),normTolerance);
 
         //octave =  sinh(v1)
         RealVector v_mapSinh = v1.map(new Sinh());
         double[] result_mapSinh = {1.175201193643801e+00d,3.626860407847019e+00d, 1.001787492740990e+01d};
-        assertClose("compare vectors" ,result_mapSinh,v_mapSinh.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSinh,v_mapSinh.toArray(),normTolerance);
 
         //octave =  sinh(v1)
         RealVector v_mapSinhToSelf = v1.copy();
         v_mapSinhToSelf.mapToSelf(new Sinh());
         double[] result_mapSinhToSelf = {1.175201193643801e+00d,3.626860407847019e+00d, 1.001787492740990e+01d};
-        assertClose("compare vectors" ,result_mapSinhToSelf,v_mapSinhToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSinhToSelf,v_mapSinhToSelf.toArray(),normTolerance);
 
         //octave =  tanh(v1)
         RealVector v_mapTanh = v1.map(new Tanh());
         double[] result_mapTanh = {7.615941559557649e-01d,9.640275800758169e-01d,9.950547536867305e-01d};
-        assertClose("compare vectors" ,result_mapTanh,v_mapTanh.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapTanh,v_mapTanh.toArray(),normTolerance);
 
         //octave =  tanh(v1)
         RealVector v_mapTanhToSelf = v1.copy();
         v_mapTanhToSelf.mapToSelf(new Tanh());
         double[] result_mapTanhToSelf = {7.615941559557649e-01d,9.640275800758169e-01d,9.950547536867305e-01d};
-        assertClose("compare vectors" ,result_mapTanhToSelf,v_mapTanhToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapTanhToSelf,v_mapTanhToSelf.toArray(),normTolerance);
 
         //octave =  cos(v1)
         RealVector v_mapCos = v1.map(new Cos());
         double[] result_mapCos = {5.403023058681398e-01d,-4.161468365471424e-01d, -9.899924966004454e-01d};
-        assertClose("compare vectors" ,result_mapCos,v_mapCos.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCos,v_mapCos.toArray(),normTolerance);
 
         //octave =  cos(v1)
         RealVector v_mapCosToSelf = v1.copy();
         v_mapCosToSelf.mapToSelf(new Cos());
         double[] result_mapCosToSelf = {5.403023058681398e-01d,-4.161468365471424e-01d, -9.899924966004454e-01d};
-        assertClose("compare vectors" ,result_mapCosToSelf,v_mapCosToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCosToSelf,v_mapCosToSelf.toArray(),normTolerance);
 
         //octave =  sin(v1)
         RealVector v_mapSin = v1.map(new Sin());
         double[] result_mapSin = {8.414709848078965e-01d,9.092974268256817e-01d,1.411200080598672e-01d};
-        assertClose("compare vectors" ,result_mapSin,v_mapSin.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSin,v_mapSin.toArray(),normTolerance);
 
         //octave =  sin(v1)
         RealVector v_mapSinToSelf = v1.copy();
         v_mapSinToSelf.mapToSelf(new Sin());
         double[] result_mapSinToSelf = {8.414709848078965e-01d,9.092974268256817e-01d,1.411200080598672e-01d};
-        assertClose("compare vectors" ,result_mapSinToSelf,v_mapSinToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSinToSelf,v_mapSinToSelf.toArray(),normTolerance);
 
         //octave =  tan(v1)
         RealVector v_mapTan = v1.map(new Tan());
         double[] result_mapTan = {1.557407724654902e+00d,-2.185039863261519e+00d,-1.425465430742778e-01d};
-        assertClose("compare vectors" ,result_mapTan,v_mapTan.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapTan,v_mapTan.toArray(),normTolerance);
 
         //octave =  tan(v1)
         RealVector v_mapTanToSelf = v1.copy();
         v_mapTanToSelf.mapToSelf(new Tan());
         double[] result_mapTanToSelf = {1.557407724654902e+00d,-2.185039863261519e+00d,-1.425465430742778e-01d};
-        assertClose("compare vectors" ,result_mapTanToSelf,v_mapTanToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapTanToSelf,v_mapTanToSelf.toArray(),normTolerance);
 
         double[] vat_a = {0d, 0.5d, 1.0d};
         OpenMapRealVector vat = new OpenMapRealVector(vat_a);
@@ -596,46 +591,46 @@ public class SparseRealVectorTest {
         //octave =  acos(vat)
         RealVector v_mapAcos = vat.map(new Acos());
         double[] result_mapAcos = {1.570796326794897e+00d,1.047197551196598e+00d, 0.0d};
-        assertClose("compare vectors" ,result_mapAcos,v_mapAcos.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAcos,v_mapAcos.toArray(),normTolerance);
 
         //octave =  acos(vat)
         RealVector v_mapAcosToSelf = vat.copy();
         v_mapAcosToSelf.mapToSelf(new Acos());
         double[] result_mapAcosToSelf = {1.570796326794897e+00d,1.047197551196598e+00d, 0.0d};
-        assertClose("compare vectors" ,result_mapAcosToSelf,v_mapAcosToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAcosToSelf,v_mapAcosToSelf.toArray(),normTolerance);
 
         //octave =  asin(vat)
         RealVector v_mapAsin = vat.map(new Asin());
         double[] result_mapAsin = {0.0d,5.235987755982989e-01d,1.570796326794897e+00d};
-        assertClose("compare vectors" ,result_mapAsin,v_mapAsin.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAsin,v_mapAsin.toArray(),normTolerance);
 
         //octave =  asin(vat)
         RealVector v_mapAsinToSelf = vat.copy();
         v_mapAsinToSelf.mapToSelf(new Asin());
         double[] result_mapAsinToSelf = {0.0d,5.235987755982989e-01d,1.570796326794897e+00d};
-        assertClose("compare vectors" ,result_mapAsinToSelf,v_mapAsinToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAsinToSelf,v_mapAsinToSelf.toArray(),normTolerance);
 
         //octave =  atan(vat)
         RealVector v_mapAtan = vat.map(new Atan());
         double[] result_mapAtan = {0.0d,4.636476090008061e-01d,7.853981633974483e-01d};
-        assertClose("compare vectors" ,result_mapAtan,v_mapAtan.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAtan,v_mapAtan.toArray(),normTolerance);
 
         //octave =  atan(vat)
         RealVector v_mapAtanToSelf = vat.copy();
         v_mapAtanToSelf.mapToSelf(new Atan());
         double[] result_mapAtanToSelf = {0.0d,4.636476090008061e-01d,7.853981633974483e-01d};
-        assertClose("compare vectors" ,result_mapAtanToSelf,v_mapAtanToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAtanToSelf,v_mapAtanToSelf.toArray(),normTolerance);
 
         //octave =  v1 .^-1
         RealVector v_mapInv = v1.map(new Inverse());
         double[] result_mapInv = {1d,0.5d,3.333333333333333e-01d};
-        assertClose("compare vectors" ,result_mapInv,v_mapInv.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapInv,v_mapInv.toArray(),normTolerance);
 
         //octave =  v1 .^-1
         RealVector v_mapInvToSelf = v1.copy();
         v_mapInvToSelf.mapToSelf(new Inverse());
         double[] result_mapInvToSelf = {1d,0.5d,3.333333333333333e-01d};
-        assertClose("compare vectors" ,result_mapInvToSelf,v_mapInvToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapInvToSelf,v_mapInvToSelf.toArray(),normTolerance);
 
         double[] abs_a = {-1.0d, 0.0d, 1.0d};
         OpenMapRealVector abs_v = new OpenMapRealVector(abs_a);
@@ -643,24 +638,24 @@ public class SparseRealVectorTest {
         //octave =  abs(abs_v)
         RealVector v_mapAbs = abs_v.map(new Abs());
         double[] result_mapAbs = {1d,0d,1d};
-        assertClose("compare vectors" ,result_mapAbs,v_mapAbs.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAbs,v_mapAbs.toArray(),normTolerance);
 
         //octave = abs(abs_v)
         RealVector v_mapAbsToSelf = abs_v.copy();
         v_mapAbsToSelf.mapToSelf(new Abs());
         double[] result_mapAbsToSelf = {1d,0d,1d};
-        assertClose("compare vectors" ,result_mapAbsToSelf,v_mapAbsToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapAbsToSelf,v_mapAbsToSelf.toArray(),normTolerance);
 
         //octave =   sqrt(v1)
         RealVector v_mapSqrt = v1.map(new Sqrt());
         double[] result_mapSqrt = {1d,1.414213562373095e+00d,1.732050807568877e+00d};
-        assertClose("compare vectors" ,result_mapSqrt,v_mapSqrt.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSqrt,v_mapSqrt.toArray(),normTolerance);
 
         //octave =  sqrt(v1)
         RealVector v_mapSqrtToSelf = v1.copy();
         v_mapSqrtToSelf.mapToSelf(new Sqrt());
         double[] result_mapSqrtToSelf = {1d,1.414213562373095e+00d,1.732050807568877e+00d};
-        assertClose("compare vectors" ,result_mapSqrtToSelf,v_mapSqrtToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSqrtToSelf,v_mapSqrtToSelf.toArray(),normTolerance);
 
         double[] cbrt_a = {-2.0d, 0.0d, 2.0d};
         OpenMapRealVector cbrt_v = new OpenMapRealVector(cbrt_a);
@@ -668,13 +663,13 @@ public class SparseRealVectorTest {
         //octave =  ???
         RealVector v_mapCbrt = cbrt_v.map(new Cbrt());
         double[] result_mapCbrt = {-1.2599210498948732d,0d,1.2599210498948732d};
-        assertClose("compare vectors" ,result_mapCbrt,v_mapCbrt.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCbrt,v_mapCbrt.toArray(),normTolerance);
 
         //octave = ???
         RealVector v_mapCbrtToSelf = cbrt_v.copy();
         v_mapCbrtToSelf.mapToSelf(new Cbrt());
         double[] result_mapCbrtToSelf =  {-1.2599210498948732d,0d,1.2599210498948732d};
-        assertClose("compare vectors" ,result_mapCbrtToSelf,v_mapCbrtToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCbrtToSelf,v_mapCbrtToSelf.toArray(),normTolerance);
 
         double[] ceil_a = {-1.1d, 0.9d, 1.1d};
         OpenMapRealVector ceil_v = new OpenMapRealVector(ceil_a);
@@ -682,59 +677,59 @@ public class SparseRealVectorTest {
         //octave =  ceil(ceil_v)
         RealVector v_mapCeil = ceil_v.map(new Ceil());
         double[] result_mapCeil = {-1d,1d,2d};
-        assertClose("compare vectors" ,result_mapCeil,v_mapCeil.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCeil,v_mapCeil.toArray(),normTolerance);
 
         //octave = ceil(ceil_v)
         RealVector v_mapCeilToSelf = ceil_v.copy();
         v_mapCeilToSelf.mapToSelf(new Ceil());
         double[] result_mapCeilToSelf =  {-1d,1d,2d};
-        assertClose("compare vectors" ,result_mapCeilToSelf,v_mapCeilToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapCeilToSelf,v_mapCeilToSelf.toArray(),normTolerance);
 
         //octave =  floor(ceil_v)
         RealVector v_mapFloor = ceil_v.map(new Floor());
         double[] result_mapFloor = {-2d,0d,1d};
-        assertClose("compare vectors" ,result_mapFloor,v_mapFloor.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapFloor,v_mapFloor.toArray(),normTolerance);
 
         //octave = floor(ceil_v)
         RealVector v_mapFloorToSelf = ceil_v.copy();
         v_mapFloorToSelf.mapToSelf(new Floor());
         double[] result_mapFloorToSelf =  {-2d,0d,1d};
-        assertClose("compare vectors" ,result_mapFloorToSelf,v_mapFloorToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapFloorToSelf,v_mapFloorToSelf.toArray(),normTolerance);
 
         //octave =  ???
         RealVector v_mapRint = ceil_v.map(new Rint());
         double[] result_mapRint = {-1d,1d,1d};
-        assertClose("compare vectors" ,result_mapRint,v_mapRint.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapRint,v_mapRint.toArray(),normTolerance);
 
         //octave = ???
         RealVector v_mapRintToSelf = ceil_v.copy();
         v_mapRintToSelf.mapToSelf(new Rint());
         double[] result_mapRintToSelf =  {-1d,1d,1d};
-        assertClose("compare vectors" ,result_mapRintToSelf,v_mapRintToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapRintToSelf,v_mapRintToSelf.toArray(),normTolerance);
 
         //octave =  ???
         RealVector v_mapSignum = ceil_v.map(new Signum());
         double[] result_mapSignum = {-1d,1d,1d};
-        assertClose("compare vectors" ,result_mapSignum,v_mapSignum.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSignum,v_mapSignum.toArray(),normTolerance);
 
         //octave = ???
         RealVector v_mapSignumToSelf = ceil_v.copy();
         v_mapSignumToSelf.mapToSelf(new Signum());
         double[] result_mapSignumToSelf =  {-1d,1d,1d};
-        assertClose("compare vectors" ,result_mapSignumToSelf,v_mapSignumToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapSignumToSelf,v_mapSignumToSelf.toArray(),normTolerance);
 
 
         // Is with the used resolutions of limited value as test
         //octave =  ???
         RealVector v_mapUlp = ceil_v.map(new Ulp());
         double[] result_mapUlp = {2.220446049250313E-16d,1.1102230246251565E-16d,2.220446049250313E-16d};
-        assertClose("compare vectors" ,result_mapUlp,v_mapUlp.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapUlp,v_mapUlp.toArray(),normTolerance);
 
         //octave = ???
         RealVector v_mapUlpToSelf = ceil_v.copy();
         v_mapUlpToSelf.mapToSelf(new Ulp());
         double[] result_mapUlpToSelf = {2.220446049250313E-16d,1.1102230246251565E-16d,2.220446049250313E-16d};
-        assertClose("compare vectors" ,result_mapUlpToSelf,v_mapUlpToSelf.getData(),normTolerance);
+        assertClose("compare vectors" ,result_mapUlpToSelf,v_mapUlpToSelf.toArray(),normTolerance);
     }
 
     @Test
@@ -783,39 +778,39 @@ public class SparseRealVectorTest {
         //octave =  v1 + v2
         OpenMapRealVector v_add = v1.add(v2);
         double[] result_add = {5d, 7d, 9d};
-        assertClose("compare vect" ,v_add.getData(),result_add,normTolerance);
+        assertClose("compare vect" ,v_add.toArray(),result_add,normTolerance);
 
         SparseRealVectorTestImpl vt2 = new SparseRealVectorTestImpl(vec2);
         RealVector v_add_i = v1.add(vt2);
         double[] result_add_i = {5d, 7d, 9d};
-        assertClose("compare vect" ,v_add_i.getData(),result_add_i,normTolerance);
+        assertClose("compare vect" ,v_add_i.toArray(),result_add_i,normTolerance);
 
         //octave =  v1 - v2
         OpenMapRealVector v_subtract = v1.subtract(v2);
         double[] result_subtract = {-3d, -3d, -3d};
-        assertClose("compare vect" ,v_subtract.getData(),result_subtract,normTolerance);
+        assertClose("compare vect" ,v_subtract.toArray(),result_subtract,normTolerance);
 
         RealVector v_subtract_i = v1.subtract(vt2);
         double[] result_subtract_i = {-3d, -3d, -3d};
-        assertClose("compare vect" ,v_subtract_i.getData(),result_subtract_i,normTolerance);
+        assertClose("compare vect" ,v_subtract_i.toArray(),result_subtract_i,normTolerance);
 
         // octave v1 .* v2
         RealVector  v_ebeMultiply = v1.ebeMultiply(v2);
         double[] result_ebeMultiply = {4d, 10d, 18d};
-        assertClose("compare vect" ,v_ebeMultiply.getData(),result_ebeMultiply,normTolerance);
+        assertClose("compare vect" ,v_ebeMultiply.toArray(),result_ebeMultiply,normTolerance);
 
         RealVector  v_ebeMultiply_2 = v1.ebeMultiply(v2_t);
         double[] result_ebeMultiply_2 = {4d, 10d, 18d};
-        assertClose("compare vect" ,v_ebeMultiply_2.getData(),result_ebeMultiply_2,normTolerance);
+        assertClose("compare vect" ,v_ebeMultiply_2.toArray(),result_ebeMultiply_2,normTolerance);
 
         // octave v1 ./ v2
         RealVector  v_ebeDivide = v1.ebeDivide(v2);
         double[] result_ebeDivide = {0.25d, 0.4d, 0.5d};
-        assertClose("compare vect" ,v_ebeDivide.getData(),result_ebeDivide,normTolerance);
+        assertClose("compare vect" ,v_ebeDivide.toArray(),result_ebeDivide,normTolerance);
 
         RealVector  v_ebeDivide_2 = v1.ebeDivide(v2_t);
         double[] result_ebeDivide_2 = {0.25d, 0.4d, 0.5d};
-        assertClose("compare vect" ,v_ebeDivide_2.getData(),result_ebeDivide_2,normTolerance);
+        assertClose("compare vect" ,v_ebeDivide_2.toArray(),result_ebeDivide_2,normTolerance);
 
         // octave  dot(v1,v2)
         double dot =  v1.dotProduct(v2);
@@ -833,7 +828,7 @@ public class SparseRealVectorTest {
 
         RealVector v_unitVector = v1.unitVector();
         RealVector v_unitVector_2 = v1.mapDivide(v1.getNorm());
-        assertClose("compare vect" ,v_unitVector.getData(),v_unitVector_2.getData(),normTolerance);
+        assertClose("compare vect" ,v_unitVector.toArray(),v_unitVector_2.toArray(),normTolerance);
 
         try {
             v_null.unitVector();
@@ -844,7 +839,7 @@ public class SparseRealVectorTest {
 
         OpenMapRealVector v_unitize = v1.copy();
         v_unitize.unitize();
-        assertClose("compare vect" ,v_unitVector_2.getData(),v_unitize.getData(),normTolerance);
+        assertClose("compare vect" ,v_unitVector_2.toArray(),v_unitize.toArray(),normTolerance);
         try {
             v_null.unitize();
             Assert.fail("Expecting MathArithmeticException");
@@ -854,11 +849,11 @@ public class SparseRealVectorTest {
 
         RealVector v_projection = v1.projection(v2);
         double[] result_projection = {1.662337662337662, 2.0779220779220777, 2.493506493506493};
-        assertClose("compare vect", v_projection.getData(), result_projection, normTolerance);
+        assertClose("compare vect", v_projection.toArray(), result_projection, normTolerance);
 
         RealVector v_projection_2 = v1.projection(v2_t);
         double[] result_projection_2 = {1.662337662337662, 2.0779220779220777, 2.493506493506493};
-        assertClose("compare vect", v_projection_2.getData(), result_projection_2, normTolerance);
+        assertClose("compare vect", v_projection_2.toArray(), result_projection_2, normTolerance);
 
     }
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/GLSMultipleLinearRegressionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/GLSMultipleLinearRegressionTest.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/GLSMultipleLinearRegressionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/GLSMultipleLinearRegressionTest.java Thu Sep  8 11:15:02 2011
@@ -200,8 +200,8 @@ public class GLSMultipleLinearRegression
         glsModel.newSampleData(longley, 16, 6);
         olsModel.newSampleData(longley, 16, 6);
         glsModel.newCovarianceData(identityCov.getData());
-        double[] olsBeta = olsModel.calculateBeta().getData();
-        double[] glsBeta = glsModel.calculateBeta().getData();
+        double[] olsBeta = olsModel.calculateBeta().toArray();
+        double[] glsBeta = glsModel.calculateBeta().toArray();
         // TODO:  Should have assertRelativelyEquals(double[], double[], eps) in TestUtils
         //        Should also add RealVector and RealMatrix versions
         for (int i = 0; i < olsBeta.length; i++) {
@@ -271,7 +271,7 @@ public class GLSMultipleLinearRegression
             
             // Generate y = xb + u with u cov
             RealVector u = MatrixUtils.createRealVector(gen.nextVector());
-            double[] y = u.add(x.operate(b)).getData();
+            double[] y = u.add(x.operate(b)).toArray();
             
             // Estimate OLS parameters
             ols.newYSampleData(y);

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java?rev=1166629&r1=1166628&r2=1166629&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java Thu Sep  8 11:15:02 2011
@@ -434,7 +434,7 @@ public class OLSMultipleLinearRegression
          */
         double[] residuals = model.estimateResiduals();
         RealMatrix I = MatrixUtils.createRealIdentityMatrix(10);
-        double[] hatResiduals = I.subtract(hat).operate(model.Y).getData();
+        double[] hatResiduals = I.subtract(hat).operate(model.Y).toArray();
         TestUtils.assertEquals(residuals, hatResiduals, 10e-12);
     }
 
@@ -457,13 +457,13 @@ public class OLSMultipleLinearRegression
      */
     protected void checkVarianceConsistency(OLSMultipleLinearRegression model) throws Exception {
         // Check Y variance consistency
-        TestUtils.assertEquals(StatUtils.variance(model.Y.getData()), model.calculateYVariance(), 0);
+        TestUtils.assertEquals(StatUtils.variance(model.Y.toArray()), model.calculateYVariance(), 0);
         
         // Check residual variance consistency
-        double[] residuals = model.calculateResiduals().getData();
+        double[] residuals = model.calculateResiduals().toArray();
         RealMatrix X = model.X;
         TestUtils.assertEquals(
-                StatUtils.variance(model.calculateResiduals().getData()) * (residuals.length - 1),
+                StatUtils.variance(model.calculateResiduals().toArray()) * (residuals.length - 1),
                 model.calculateErrorVariance() * (X.getRowDimension() - X.getColumnDimension()), 1E-20);
         
     }



Mime
View raw message