Examples of FloatOperations


Examples of org.jboss.dna.common.math.FloatOperations

    }

    @Test
    public void shouldCorrectlyPlaceAnOddNumberOfFloatValuesIntoSameOddNumberOfBuckets() {
        Float[] values = {3.0f, 1.0f, 2.0f, 4.0f};
        Histogram<Float> gram = new Histogram<Float>(new FloatOperations(), values);
        gram.setBucketCount(3);
        // HistogramTest.writeHistogramToLog(this.logger, gram, 0,
        // "shouldCorrectlyPlaceAnOddNumberOfFloatValuesIntoSameOddNumberOfBuckets");
        assertBucketValueCount(gram, 1, 1, 2);
    }
View Full Code Here

Examples of org.jboss.dna.common.math.FloatOperations

    }

    @Test
    public void shouldCorrectlyPlaceAnEvenNumberOfFloatValuesIntoSameEvenNumberOfBuckets() {
        Float[] values = {3.0f, 1.0f, 2.0f, 4.0f};
        Histogram<Float> gram = new Histogram<Float>(new FloatOperations(), values);
        gram.setBucketCount(4);
        // HistogramTest.writeHistogramToLog(this.logger, gram, 0,
        // "shouldCorrectlyPlaceAnEvenNumberOfFloatValuesIntoSameEvenNumberOfBuckets");
        assertBucketValueCount(gram, 1, 1, 1, 1);
View Full Code Here

Examples of org.jboss.dna.common.math.FloatOperations

    }

    @Test
    public void shouldCorrectlyPlaceAnOddNumberOfFloatValuesIntoSmallerNumberOfBuckets() {
        Float[] values = {3.0f, 1.0f, 2.0f};
        Histogram<Float> gram = new Histogram<Float>(new FloatOperations(), values);
        gram.setBucketCount(2);
        // HistogramTest.writeHistogramToLog(this.logger, gram, 0,
        // "shouldCorrectlyPlaceAnEvenNumberOfFloatValuesIntoSameEvenNumberOfBuckets");
        assertBucketValueCount(gram, 1, 2);
    }
View Full Code Here

Examples of org.jboss.dna.common.math.FloatOperations

    }

    @Test
    public void shouldCorrectlyPlaceAnEvenNumberOfFloatValuesIntoSmallerNumberOfBuckets() {
        Float[] values = {3.0f, 1.0f, 2.0f, 4.0f};
        Histogram<Float> gram = new Histogram<Float>(new FloatOperations(), values);
        gram.setBucketCount(2);
        // HistogramTest.writeHistogramToLog(this.logger, gram, 0,
        // "shouldCorrectlyPlaceAnEvenNumberOfFloatValuesIntoSmallerNumberOfBuckets");
        assertBucketValueCount(gram, 2, 2);
    }
View Full Code Here

Examples of org.jboss.dna.common.math.FloatOperations

    }

    @Test
    public void shouldReturnListOfBuckets() {
        Float[] values = {3.0f, 1.0f, 2.0f, 4.0f};
        Histogram<Float> gram = new Histogram<Float>(new FloatOperations(), values);
        assertTrue(gram.getBuckets() instanceof LinkedList<?>);
    }
View Full Code Here

Examples of org.jboss.dna.common.math.FloatOperations

    }

    @Test
    public void shouldCorrectlyPlaceAnOddNumberOfFloatValuesIntoSmallerNumberOfBucketsWithMinimumAndMaximumRanges() {
        Float[] values = {3.0f, 1.0f, 2.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f};
        Histogram<Float> gram = new Histogram<Float>(new FloatOperations(), values);
        gram.setBucketCount(5);
        // HistogramTest.writeHistogramToLog(this.logger, gram, 0,
        // "shouldCorrectlyPlaceAnOddNumberOfFloatValuesIntoSmallerNumberOfBucketsWithMinimumAndMaximumRanges");
        assertBucketValueCount(gram, 2, 2, 2, 2, 2);
    }
View Full Code Here

Examples of org.jboss.dna.common.math.FloatOperations

    }

    @Test
    public void shouldCorrectlyPlaceAnOddNumberOfFloatValuesIntoSmallerNumberOfBucketsWithMinimumRanges() {
        Float[] values = {3.0f, 1.0f, 2.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 9.999f};
        Histogram<Float> gram = new Histogram<Float>(new FloatOperations(), values);
        gram.setBucketCount(5);
        // HistogramTest.writeHistogramToLog(this.logger, gram, 0,
        // "shouldCorrectlyPlaceAnOddNumberOfFloatValuesIntoSmallerNumberOfBucketsWithMinimumRanges");
        assertBucketValueCount(gram, 2, 2, 2, 2, 2);
    }
View Full Code Here

Examples of org.jboss.dna.common.math.FloatOperations

    public void shouldCorrectlyConstructHistogramWithStandardDeviation() {
        Float[] values = {3.0f, 1.0f, 2.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 9.999f, 3.1f, 3.2f, 3.3f, 3.21f, 3.22f, 3.33f};
        // RunningStatistics<Float> stats = new RunningStatistics<Float>(new FloatOperations());
        // for (Float value : values) stats.add(value);
        // System.out.println(stats);
        Histogram<Float> gram = new Histogram<Float>(new FloatOperations(), values);
        gram.setBucketCount(6);
        gram.setStrategy(3.315f, 2.52367f, 1);

        HistogramTest.writeHistogramToLog(this.logger, gram, 0, "shouldCorrectlyConstructHistogramWithStandardDeviation");
        assertBucketValueCount(gram, 1, 1, 7, 1, 1, 5);
View Full Code Here

Examples of org.jboss.dna.common.math.FloatOperations

        assertBucketValueCount(gram, 1, 1, 7, 1, 1, 5);
    }

    @Test
    public void shouldCorrectlyPlace1000RandomFloatValues() {
        Histogram<Float> gram = createRandomHistogram(10.0f, 100.0f, 1000, new FloatOperations());
        // gram.setDesiredRange(0.0f,100.0f);
        HistogramTest.writeHistogramToLog(this.logger, gram, 0, "Histogram of 1000 random float values in " + gram.getBucketCount() + " buckets: ");
    }
View Full Code Here

Examples of org.jboss.dna.common.math.FloatOperations

        HistogramTest.writeHistogramToLog(this.logger, gram, 0, "Histogram of 1000 random float values in " + gram.getBucketCount() + " buckets: ");
    }

    @Test
    public void shouldCorrectlyConstructBoundariesWithWindowSmallerThanActualFloats() {
        List<Float> boundaries = Histogram.getBucketBoundaries(new FloatOperations(), 10.0f, 20.0f, 5.0f, 25.0f, 12, 3);
        assertNotNull(boundaries);
        assertEquals(13, boundaries.size());
        Float[] expectedBoundaries = {5.0f, 10.0f, 11f, 12f, 13f, 14f, 15f, 16f, 17f, 18f, 19f, 20f, 25f};
        assertArrayEquals(expectedBoundaries, boundaries.toArray(new Float[boundaries.size()]));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.