Example usage for org.apache.commons.math3.distribution UniformRealDistribution getNumericalMean

List of usage examples for org.apache.commons.math3.distribution UniformRealDistribution getNumericalMean

Introduction

In this page you can find the example usage for org.apache.commons.math3.distribution UniformRealDistribution getNumericalMean.

Prototype

public double getNumericalMean() 

Source Link

Document

For lower bound lower and upper bound upper , the mean is 0.5 * (lower + upper) .

Usage

From source file:org.apache.solr.client.solrj.io.stream.eval.UniformDistributionEvaluatorTest.java

@Test
public void test() throws IOException {

    values.clear();/*from w  ww.j  a v a 2 s .  c  o  m*/
    values.put("l1", 3);
    values.put("l2", 7);

    UniformRealDistribution dist = new UniformRealDistribution(3, 7);
    Assert.assertEquals(dist.getNumericalMean(),
            ((UniformRealDistribution) factory.constructEvaluator("unif(l1,l2)").evaluate(new Tuple(values)))
                    .getNumericalMean());
}