Package krati.util

Examples of krati.util.LinearHashing.reinit()


        assertEquals((unitCapacity << 2) - 2 * unitCapacity, h.getSplit());
        assertEquals(2, h.getLevel());
        assertEquals(unitCapacity << 2, h.getLevelCapacity());
       
        capacity = (unitCapacity << 3) - unitCapacity;
        h.reinit(capacity);
        assertEquals((unitCapacity << 2) - 2 * unitCapacity, h.getSplit());
        assertEquals(2, h.getLevel());
        assertEquals(unitCapacity << 2, h.getLevelCapacity());
       
        capacity = Integer.MAX_VALUE;
View Full Code Here


        assertEquals((unitCapacity << 2) - 2 * unitCapacity, h.getSplit());
        assertEquals(2, h.getLevel());
        assertEquals(unitCapacity << 2, h.getLevelCapacity());
       
        capacity = Integer.MAX_VALUE;
        h.reinit(capacity);
        assertEquals((1 << 30) - (unitCapacity << 1), h.getSplit());
        assertEquals(14, h.getLevel());
        assertEquals(1 << 30, h.getLevelCapacity());
    }
   
View Full Code Here

    }
   
    public void testMaxLevel() {
        int unitCapacity = DynamicConstants.SUB_ARRAY_SIZE;
        LinearHashing h = new LinearHashing(unitCapacity);
        h.reinit(Integer.MAX_VALUE);
        assertEquals(14, h.getLevel());
        assertEquals(1 << 30, h.getLevelCapacity());
    }
}
View Full Code Here

     * @return the initial capacity of a dynamic store.
     */
    public static final int getDynamicStoreInitialCapacity(int initialLevel) {
        // Compute maxLevel
        LinearHashing h = new LinearHashing(DynamicConstants.SUB_ARRAY_SIZE);
        h.reinit(Integer.MAX_VALUE);
        int maxLevel = h.getLevel();
       
        // Compute initialCapacity
        int initialCapacity = DynamicConstants.SUB_ARRAY_SIZE;
        if(initialLevel > 0) {
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.