commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1420006 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random: EmpiricalDistribution.java ValueServer.java
Date Tue, 11 Dec 2012 06:10:09 GMT
Author: psteitz
Date: Tue Dec 11 06:10:08 2012
New Revision: 1420006

URL: http://svn.apache.org/viewvc?rev=1420006&view=rev
Log:
Fixed javadoc error, replaced depreacated class.

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

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/EmpiricalDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/EmpiricalDistribution.java?rev=1420006&r1=1420005&r2=1420006&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/EmpiricalDistribution.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/EmpiricalDistribution.java
Tue Dec 11 06:10:08 2012
@@ -84,7 +84,7 @@ import org.apache.commons.math3.util.Mat
  * be the bin containing x and let K be the within-bin kernel for B.  Let P(B-)
  * be the sum of the probabilities of the bins below B and let K(B) be the
  * mass of B under K (i.e., the integral of the kernel density over B).  Then
- * set P(X < x) = P(B-) + K(x) / K(B) where K(x) is the kernel distribution
+ * set P(X < x) = P(B-) + P(B) * K(x) / K(B) where K(x) is the kernel distribution
  * evaluated at x. This results in a cdf that matches the grouped frequency
  * distribution at the bin endpoints and interpolates within bins using
  * within-bin kernels.</p>
@@ -135,13 +135,13 @@ public class EmpiricalDistribution exten
     private double[] upperBounds = null;
 
     /** RandomDataImpl instance to use in repeated calls to getNext() */
-    private final RandomDataImpl randomData;
+    private final RandomDataGenerator randomData;
 
     /**
      * Creates a new EmpiricalDistribution with the default bin count.
      */
     public EmpiricalDistribution() {
-        this(DEFAULT_BIN_COUNT, new RandomDataImpl());
+        this(DEFAULT_BIN_COUNT, new RandomDataGenerator());
     }
 
     /**
@@ -150,7 +150,7 @@ public class EmpiricalDistribution exten
      * @param binCount number of bins
      */
     public EmpiricalDistribution(int binCount) {
-        this(binCount, new RandomDataImpl());
+        this(binCount, new RandomDataGenerator());
     }
 
     /**
@@ -162,9 +162,10 @@ public class EmpiricalDistribution exten
      * @since 3.0
      */
     public EmpiricalDistribution(int binCount, RandomGenerator generator) {
+        super(generator);
         this.binCount = binCount;
-        randomData = new RandomDataImpl(generator);
-        binStats = new ArrayList<SummaryStatistics>();
+        this.randomData = new RandomDataGenerator(generator);
+        this.binStats = new ArrayList<SummaryStatistics>();
     }
 
     /**
@@ -186,7 +187,8 @@ public class EmpiricalDistribution exten
      * @param randomData random data generator (may be null, resulting in default JDK generator)
      * @since 3.0
      */
-    public EmpiricalDistribution(int binCount, RandomDataImpl randomData) {
+    @SuppressWarnings("deprecation")  // Superclass argumentless constructor is deprecated
+    public EmpiricalDistribution(int binCount, RandomDataGenerator randomData) {
         this.binCount = binCount;
         this.randomData = randomData;
         binStats = new ArrayList<SummaryStatistics>();
@@ -199,7 +201,7 @@ public class EmpiricalDistribution exten
      * @param randomData random data generator (may be null, resulting in default JDK generator)
      * @since 3.0
      */
-    public EmpiricalDistribution(RandomDataImpl randomData) {
+    public EmpiricalDistribution(RandomDataGenerator randomData) {
         this(DEFAULT_BIN_COUNT, randomData);
     }
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/ValueServer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/ValueServer.java?rev=1420006&r1=1420005&r2=1420006&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/ValueServer.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/ValueServer.java
Tue Dec 11 06:10:08 2012
@@ -88,13 +88,13 @@ public class ValueServer {
     private BufferedReader filePointer = null;
 
     /** RandomDataImpl to use for random data generation. */
-    private final RandomDataImpl randomData;
+    private final RandomDataGenerator randomData;
 
     // Data generation modes ======================================
 
     /** Creates new ValueServer */
     public ValueServer() {
-        randomData = new RandomDataImpl();
+        randomData = new RandomDataGenerator();
     }
 
     /**
@@ -104,7 +104,7 @@ public class ValueServer {
      * @param randomData the RandomDataImpl instance used to source random data
      * @since 3.0
      */
-    public ValueServer(RandomDataImpl randomData) {
+    public ValueServer(RandomDataGenerator randomData) {
         this.randomData = randomData;
     }
 



Mime
View raw message