
slow.it.unimi.dsi.sux4j.bits.Rank9SelectSlowTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sux4j Show documentation
Show all versions of sux4j Show documentation
Sux4j is an implementation of succinct data structure in Java. It provides a number of related implementations covering ranking/selection over bit arrays, compressed lists and minimal perfect hashing.
package it.unimi.dsi.sux4j.bits;
import static org.junit.Assert.assertEquals;
import it.unimi.dsi.bits.LongArrayBitVector;
import org.junit.Test;
public class Rank9SelectSlowTest {
@Test
public void testVeryLarge() {
LongArrayBitVector v = LongArrayBitVector.getInstance(2200000000L);
for (int i = 0; i < 2200000000L / 64; i++)
v.append(0x5555555555555555L, 64);
Rank9 rank9;
Select9 select9 = new Select9(rank9 = new Rank9(v));
for (int i = 0; i < 1100000000; i++)
assertEquals(i * 2L, select9.select(i));
for (int i = 0; i < 1100000000; i++)
assertEquals(i, rank9.rank(i * 2L));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy