Remove deprecated contructors in UniformRealDistribution.

This commit is contained in:
Thomas Neidhart 2015-02-24 23:38:51 +01:00
parent 0d3545e5f6
commit 96ba5ec216
8 changed files with 7 additions and 58 deletions

View File

@ -32,11 +32,6 @@ import org.apache.commons.math4.random.Well19937c;
* @since 3.0 * @since 3.0
*/ */
public class UniformRealDistribution extends AbstractRealDistribution { public class UniformRealDistribution extends AbstractRealDistribution {
/** Default inverse cumulative probability accuracy.
* @deprecated as of 3.2 not used anymore, will be removed in 4.0
*/
@Deprecated
public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;
/** Serializable version identifier. */ /** Serializable version identifier. */
private static final long serialVersionUID = 20120109L; private static final long serialVersionUID = 20120109L;
/** Lower bound of this distribution (inclusive). */ /** Lower bound of this distribution (inclusive). */
@ -79,43 +74,6 @@ public class UniformRealDistribution extends AbstractRealDistribution {
this(new Well19937c(), lower, upper); this(new Well19937c(), lower, upper);
} }
/**
* Create a uniform distribution.
*
* @param lower Lower bound of this distribution (inclusive).
* @param upper Upper bound of this distribution (exclusive).
* @param inverseCumAccuracy Inverse cumulative probability accuracy.
* @throws NumberIsTooLargeException if {@code lower >= upper}.
* @deprecated as of 3.2, inverse CDF is now calculated analytically, use
* {@link #UniformRealDistribution(double, double)} instead.
*/
@Deprecated
public UniformRealDistribution(double lower, double upper, double inverseCumAccuracy)
throws NumberIsTooLargeException {
this(new Well19937c(), lower, upper);
}
/**
* Creates a uniform distribution.
*
* @param rng Random number generator.
* @param lower Lower bound of this distribution (inclusive).
* @param upper Upper bound of this distribution (exclusive).
* @param inverseCumAccuracy Inverse cumulative probability accuracy.
* @throws NumberIsTooLargeException if {@code lower >= upper}.
* @since 3.1
* @deprecated as of 3.2, inverse CDF is now calculated analytically, use
* {@link #UniformRealDistribution(RandomGenerator, double, double)}
* instead.
*/
@Deprecated
public UniformRealDistribution(RandomGenerator rng,
double lower,
double upper,
double inverseCumAccuracy){
this(rng, lower, upper);
}
/** /**
* Creates a uniform distribution. * Creates a uniform distribution.
* *

View File

@ -58,8 +58,7 @@ public class RandomCirclePointGenerator {
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY); NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
cY = new NormalDistribution(rng, y, ySigma, cY = new NormalDistribution(rng, y, ySigma,
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY); NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
tP = new UniformRealDistribution(rng, 0, MathUtils.TWO_PI, tP = new UniformRealDistribution(rng, 0, MathUtils.TWO_PI);
UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
} }
/** /**

View File

@ -66,8 +66,7 @@ public class RandomStraightLinePointGenerator {
intercept = b; intercept = b;
error = new NormalDistribution(rng, 0, sigma, error = new NormalDistribution(rng, 0, sigma,
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY); NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
x = new UniformRealDistribution(rng, lo, hi, x = new UniformRealDistribution(rng, lo, hi);
UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
} }
/** /**

View File

@ -59,8 +59,7 @@ public class RandomCirclePointGenerator {
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY); NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
cY = new NormalDistribution(rng, y, ySigma, cY = new NormalDistribution(rng, y, ySigma,
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY); NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
tP = new UniformRealDistribution(rng, 0, MathUtils.TWO_PI, tP = new UniformRealDistribution(rng, 0, MathUtils.TWO_PI);
UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
} }
/** /**

View File

@ -67,8 +67,7 @@ public class RandomStraightLinePointGenerator {
intercept = b; intercept = b;
error = new NormalDistribution(rng, 0, sigma, error = new NormalDistribution(rng, 0, sigma,
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY); NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
x = new UniformRealDistribution(rng, lo, hi, x = new UniformRealDistribution(rng, lo, hi);
UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
} }
/** /**

View File

@ -60,8 +60,7 @@ public class RandomCirclePointGenerator {
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY); NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
cY = new NormalDistribution(rng, y, ySigma, cY = new NormalDistribution(rng, y, ySigma,
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY); NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
tP = new UniformRealDistribution(rng, 0, MathUtils.TWO_PI, tP = new UniformRealDistribution(rng, 0, MathUtils.TWO_PI);
UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
} }
/** /**

View File

@ -67,8 +67,7 @@ public class RandomStraightLinePointGenerator {
intercept = b; intercept = b;
error = new NormalDistribution(rng, 0, sigma, error = new NormalDistribution(rng, 0, sigma,
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY); NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
x = new UniformRealDistribution(rng, lo, hi, x = new UniformRealDistribution(rng, lo, hi);
UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
} }
/** /**

View File

@ -44,9 +44,7 @@ import org.junit.Test;
/** /**
* Test cases for the EmpiricalDistribution class * Test cases for the EmpiricalDistribution class
*
*/ */
public final class EmpiricalDistributionTest extends RealDistributionAbstractTest { public final class EmpiricalDistributionTest extends RealDistributionAbstractTest {
protected EmpiricalDistribution empiricalDistribution = null; protected EmpiricalDistribution empiricalDistribution = null;
@ -542,8 +540,7 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes
} }
@Override @Override
protected RealDistribution getKernel(SummaryStatistics bStats) { protected RealDistribution getKernel(SummaryStatistics bStats) {
return new UniformRealDistribution(randomData.getRandomGenerator(), bStats.getMin(), bStats.getMax(), return new UniformRealDistribution(randomData.getRandomGenerator(), bStats.getMin(), bStats.getMax());
UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
} }
} }
} }