Package net.agkn.hll.util

Examples of net.agkn.hll.util.LongIterator


     */
    private static void assertElementsEqual(final HLL hllA, final HLL hllB) {
        final BitVector bitVectorA = (BitVector)getInternalState(hllA, "probabilisticStorage")/*for testing convenience*/;
        final BitVector bitVectorB = (BitVector)getInternalState(hllA, "probabilisticStorage")/*for testing convenience*/;

        final LongIterator iterA = bitVectorA.registerIterator();
        final LongIterator iterB = bitVectorB.registerIterator();

        for(;iterA.hasNext() && iterB.hasNext();) {
            assertEquals(iterA.next(), iterB.next());
        }
        assertFalse(iterA.hasNext());
        assertFalse(iterB.hasNext());
    }
View Full Code Here


        // compute the "indicator function" -- sum(2^(-M[j])) where M[j] is the
        // 'j'th register value
        double sum = 0;
        int numberOfZeroes = 0/*"V" in the paper*/;
        final LongIterator iterator = probabilisticStorage.registerIterator();
        while(iterator.hasNext()) {
            final long register = iterator.next();

            sum += 1.0 / (1L << register);
            if(register == 0L) numberOfZeroes++;
        }

View Full Code Here

TOP

Related Classes of net.agkn.hll.util.LongIterator

Copyright © 2018 www.massapicom. 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.