use of org.ojalgo.array.Primitive64Array in project ojAlgo by optimatika.
the class SampleSetTest method testQuartileEx1.
@Test
public void testQuartileEx1() {
final Primitive64Array tmpSamples = Primitive64Array.wrap(new double[] { 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49 });
final SampleSet tmpSampleSet = SampleSet.wrap(tmpSamples);
TestUtils.assertEquals(20.25, tmpSampleSet.getQuartile1());
TestUtils.assertEquals(40.0, tmpSampleSet.getQuartile2());
TestUtils.assertEquals(42.75, tmpSampleSet.getQuartile3());
}
use of org.ojalgo.array.Primitive64Array in project ojAlgo by optimatika.
the class SampleSetTest method testQuartileSize6.
@Test
public void testQuartileSize6() {
final Primitive64Array tmpSamples = Primitive64Array.wrap(new double[] { 100.0, 200.0, 300.0, 400.0, 500.0, 600.0 });
final SampleSet tmpSampleSet = SampleSet.wrap(tmpSamples);
TestUtils.assertEquals(200.0, tmpSampleSet.getQuartile1());
TestUtils.assertEquals(350.0, tmpSampleSet.getQuartile2());
TestUtils.assertEquals(500.0, tmpSampleSet.getQuartile3());
}
use of org.ojalgo.array.Primitive64Array in project ojAlgo by optimatika.
the class SampleSetTest method testQuartileSize0.
@Test
public void testQuartileSize0() {
final Primitive64Array tmpSamples = Primitive64Array.wrap(new double[] {});
final SampleSet tmpSampleSet = SampleSet.wrap(tmpSamples);
TestUtils.assertEquals(0.0, tmpSampleSet.getQuartile1());
TestUtils.assertEquals(0.0, tmpSampleSet.getQuartile2());
TestUtils.assertEquals(0.0, tmpSampleSet.getQuartile3());
}
use of org.ojalgo.array.Primitive64Array in project ojAlgo by optimatika.
the class SampleSetTest method testQuartileSize4.
@Test
public void testQuartileSize4() {
final Primitive64Array tmpSamples = Primitive64Array.wrap(new double[] { 100.0, 200.0, 300.0, 400.0 });
final SampleSet tmpSampleSet = SampleSet.wrap(tmpSamples);
TestUtils.assertEquals(150.0, tmpSampleSet.getQuartile1());
TestUtils.assertEquals(250.0, tmpSampleSet.getQuartile2());
TestUtils.assertEquals(350.0, tmpSampleSet.getQuartile3());
}
use of org.ojalgo.array.Primitive64Array in project ojAlgo by optimatika.
the class SampleSetTest method testQuartileEx2.
@Test
public void testQuartileEx2() {
final Primitive64Array tmpSamples = Primitive64Array.wrap(new double[] { 7, 15, 36, 39, 40, 41 });
final SampleSet tmpSampleSet = SampleSet.wrap(tmpSamples);
TestUtils.assertEquals(15.0, tmpSampleSet.getQuartile1());
TestUtils.assertEquals(37.5, tmpSampleSet.getQuartile2());
TestUtils.assertEquals(40.0, tmpSampleSet.getQuartile3());
}
Aggregations