This commit is contained in:
Gilles 2016-05-31 15:24:25 +02:00
parent 0cc22651bb
commit 52f219398c
2 changed files with 3 additions and 3 deletions

View File

@ -145,8 +145,8 @@ public class EnumeratedDistribution<T> implements Serializable {
* @return the value of the probability mass function at {@code x}
*/
double probability(final T x) {
final Double p = massPoints.get(x);
return p == null ? 0 : p.doubleValue();
final Double p = massPoints.get(x);
return p == null ? 0 : p.doubleValue();
}
/**

View File

@ -47,7 +47,7 @@ public class EnumeratedDistributionTest {
@Test
public void testGetPmf() {
final String s = "bike";
final String s = "bike";
final List<Pair<String, Double>> pmf = Arrays.asList(
new Pair<String, Double>(s, 0.1),
new Pair<String, Double>(s, 0.3),