All Downloads are FREE. Search and download functionalities are using the official Maven repository.

slow.it.unimi.dsi.sux4j.mph.LcpMonotoneMinimalPerfectHashFunctionSlowTest Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 5.4.1
Show newest version
package it.unimi.dsi.sux4j.mph;

import static org.junit.Assert.assertEquals;
import it.unimi.dsi.bits.TransformationStrategies;

import java.io.IOException;
import java.util.Iterator;

import org.junit.Test;

public class LcpMonotoneMinimalPerfectHashFunctionSlowTest {

	@Test
	public void testBig() throws IOException {
		Iterable p = LargeLongCollection.getInstance();
		final LcpMonotoneMinimalPerfectHashFunction f = new LcpMonotoneMinimalPerfectHashFunction.Builder().keys(p).transform(TransformationStrategies.fixedLong()).build();

		long j = 0;
		for(Iterator i = p.iterator(); i.hasNext();) {
			Long s = i.next();
			assertEquals(j++, f.getLong(s));
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy