当前位置: 首页>>代码示例>>Java>>正文


Java PhTree.queryExtent方法代码示例

本文整理汇总了Java中ch.ethz.globis.phtree.PhTree.queryExtent方法的典型用法代码示例。如果您正苦于以下问题:Java PhTree.queryExtent方法的具体用法?Java PhTree.queryExtent怎么用?Java PhTree.queryExtent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ch.ethz.globis.phtree.PhTree的用法示例。


在下文中一共展示了PhTree.queryExtent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testNullValues

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
@Test
public void testNullValues() {
	PhTree<long[]> ind = create(2);
	ind.put(new long[]{0, 0}, null);
	ind.put(new long[]{1, 1}, new long[]{1, 1});
	ind.put(new long[]{2, 2}, null);

	//check empty result
	Iterator<long[]> it;

	//check full result
	//it = ind.query(0, 50, 0, 50, 0, 50, 0, 50, 0, 50);
	it = ind.query(new long[]{0, 0}, new long[]{50, 50});
	assertNull(it.next());
	assertNotNull(it.next());
	assertNull(it.next());
	assertFalse(it.hasNext());

	//check extent
	it = ind.queryExtent();
	assertNull(it.next());
	assertNotNull(it.next());
	assertNull(it.next());
	assertFalse(it.hasNext());
}
 
开发者ID:tzaeschke,项目名称:phtree,代码行数:26,代码来源:TestIndexQueries.java

示例2: export

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
@Override
public <T2> void export(PhTree<T2> tree, String filename) throws FileNotFoundException {
    try (Output output = createOutput(filename)) {
        Kryo kryo = kryos.get();
        PhIterator<T2> it = tree.queryExtent();
        while (it.hasNext()) {
            kryo.writeClassAndObject(output, it.nextEntry());
        }
        output.flush();
    }
}
 
开发者ID:tzaeschke,项目名称:distributed-phtree,代码行数:12,代码来源:IterativeSerializer.java

示例3: sort

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
public static <V> IndexEntryList<long[], V> sort(IndexEntryList<long[], V> entries) {
	if (entries.size() == 0) {
		return new IndexEntryList<>();
	}
	PhTree<V> tree = createTree(entries);
	IndexEntryList<long[], V> output = new IndexEntryList<>();
	PhIterator<V> it = tree.queryExtent();
	while (it.hasNext()) {
		PhEntry<V> entry = it.nextEntry();
		output.add(entry.getKey(), entry.getValue());
	}
	return output;
}
 
开发者ID:tzaeschke,项目名称:distributed-phtree,代码行数:14,代码来源:MultidimUtil.java

示例4: getAllEntries

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
private IndexEntryList<long[], byte[]> getAllEntries() {
    PhTree<byte[]> phTree = indexContext.getTree();

    IndexEntryList<long[], byte[]> entries = new IndexEntryList<>();

    PhIterator<byte[]> it = phTree.queryExtent();
    while (it.hasNext()) {
        PhEntry<byte[]> e = it.nextEntry();
        entries.add(e.getKey(), e.getValue());
    }

    return entries;
}
 
开发者ID:tzaeschke,项目名称:distributed-phtree,代码行数:14,代码来源:ZMappingBalancingStrategy.java

示例5: nearestNeighbor1

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
private long[] nearestNeighbor1(PhTree<?> tree, long[] q) {
	double d = Double.MAX_VALUE;
	long[] best = null;
	PhIterator<?> i = tree.queryExtent();
	while (i.hasNext()) {
		long[] cand = i.nextKey();
		double dNew = dist(q, cand);
		if (dNew < d) {
			d = dNew;
			best = cand;
		}
	}
	return best;
}
 
开发者ID:tzaeschke,项目名称:phtree,代码行数:15,代码来源:TestNearestNeighbourF.java

示例6: rangeQuery

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
private ArrayList<long[]> rangeQuery(PhTree<?> tree, double range, long[] q) {
	ArrayList<long[]> points = new ArrayList<>();
	PhIterator<?> i = tree.queryExtent();
	while (i.hasNext()) {
		long[] cand = i.nextKey();
		double dNew = dist(q, cand);
		if (dNew < range) {
			points.add(cand);
		}
	}
	return points;
}
 
开发者ID:tzaeschke,项目名称:phtree,代码行数:13,代码来源:TestRangeQuery.java


注:本文中的ch.ethz.globis.phtree.PhTree.queryExtent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。