commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1520620 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/RandomDataGenerator.java
Date Fri, 06 Sep 2013 16:07:04 GMT
Author: erans
Date: Fri Sep  6 16:07:03 2013
New Revision: 1520620

URL: http://svn.apache.org/r1520620
Log:
Use method moved to "MathArrays".

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/RandomDataGenerator.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/RandomDataGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/RandomDataGenerator.java?rev=1520620&r1=1520619&r2=1520620&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/RandomDataGenerator.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/RandomDataGenerator.java
Fri Sep  6 16:07:03 2013
@@ -638,7 +638,7 @@ public class RandomDataGenerator impleme
                                                    k);
         }
 
-        int[] index = getNatural(n);
+        int[] index = MathArrays.natural(n);
         MathArrays.shuffle(index, getRandomGenerator());
 
         // Return a new array containing the first "k" entries of "index".
@@ -780,18 +780,4 @@ public class RandomDataGenerator impleme
         }
         return secRand;
     }
-
-    /**
-     * Returns an array representing n.
-     *
-     * @param n the natural number to represent
-     * @return array with entries = elements of n
-     */
-    private int[] getNatural(int n) {
-        int[] natural = new int[n];
-        for (int i = 0; i < n; i++) {
-            natural[i] = i;
-        }
-        return natural;
-    }
 }



Mime
View raw message