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


Java PhTree.create方法代码示例

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


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

示例1: RectanglePHC

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
/**
 * Setup of a native PH tree
 * @param ts test stats
 */
public RectanglePHC(TestStats ts) {
	this.N = ts.cfgNEntries;
	this.dims = ts.cfgNDims;
	this.phc = PhTree.create(2*dims);
	this.pre = new PreProcessorRangeF.IEEE(dims);
	//this.pre = new PreProcessorRangeF.IPP(dims, 10e9);
	//distFn = new PhDistanceSFCenterDist(pre, dims);
	distFn = new PhDistanceSFEdgeDist(pre, dims);
	this.buffer = new long[2*dims];
	this.bufLow = new long[2*dims];
	this.bufUpp = new long[2*dims];
	this.qMIN = new double[dims];
	Arrays.fill(qMIN, Double.NEGATIVE_INFINITY);
	this.qMAX = new double[dims];
	Arrays.fill(qMAX, Double.POSITIVE_INFINITY);
}
 
开发者ID:tzaeschke,项目名称:TinSpin,代码行数:21,代码来源:RectanglePHC.java

示例2: PointPHC

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
/**
	 * Setup of a native PH tree
	 * 
	 * @param ts TestStats
	 */
	public PointPHC(TestStats ts) {
//		phc = new PhTree8<Object>(ts.cfgNDims);
		phc = PhTree.create(ts.cfgNDims);
//		Node.AHC_LHC_BIAS = 1*1000*1000;
//		Node.NT_THRESHOLD = 2*1000*1000;
//		PhTree11.HCI_ENABLED = true;
//		TestRunner.USE_NEW_QUERIES = false;
		this.N = ts.cfgNEntries;
		this.dims = ts.cfgNDims;
		this.S = ts;
		qMin = new long[dims];
		qMax = new long[dims];
		knnCenter = new long[dims];
		query = phc.query(qMin, qMax);
		knnQuery = phc.nearestNeighbour(1, knnCenter);
	}
 
开发者ID:tzaeschke,项目名称:TinSpin,代码行数:22,代码来源:PointPHC.java

示例3: init

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
@Setup
public void init() throws FileNotFoundException {

    //create a tree containing random entries
    int nrEntries = 10000;
    tree = PhTree.create(dim);

    long[] key = new long[dim];
    Random random = new Random();

    for (int i = 0; i < nrEntries; i++) {
        for (int j = 0; j < dim; j++) {
            key[j] = random.nextInt();
        }
        tree.put(key, Arrays.toString(key));
    }

    //serialize the tree so that de-serialization benchmark works every time
    FullTreeSerializer serializer = new FullTreeSerializer();
    serializer.export(tree, FULL_TREE_FILE);

    IterativeSerializer<String> itSerializer = new IterativeSerializer<String>();
    itSerializer.export(tree, ITERATIVE_TREE_FILE);
}
 
开发者ID:tzaeschke,项目名称:distributed-phtree,代码行数:25,代码来源:SerializationBenchmark.java

示例4: exportPhTree

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
@Test
public void exportPhTree() throws FileNotFoundException {
    int dim = 6;
    int size = 100000;
    PhTree<String> tree = TestOperationsUtil.createRandomPhTree(size, dim);
    String filename = "tree.txt";
    IterativeSerializer<String> serializer = new IterativeSerializer<>();

    serializer.export(tree, filename);

    PhTree<String> outputTree = PhTree.create(dim);
    serializer.setTree(outputTree);

    PhTree<String> newTree = serializer.load(filename);

    assertEquals(tree.toStringPlain(), newTree.toStringPlain());
}
 
开发者ID:tzaeschke,项目名称:distributed-phtree,代码行数:18,代码来源:IterativeSerializerTest.java

示例5: createTree

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
private static <V> PhTree<V> createTree(IndexEntryList<long[], V> entries) {
	int dim = entries.get(0).getKey().length;
	PhTree<V> tree = PhTree.create(dim);
	for (IndexEntry<long[], V> entry : entries) {
		tree.put(entry.getKey(), entry.getValue());
	}
	return tree;
}
 
开发者ID:tzaeschke,项目名称:distributed-phtree,代码行数:9,代码来源:MultidimUtil.java

示例6: createRandomPhTree

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
public static PhTree<String> createRandomPhTree(int entries, int dim) {

        PhTree<String> tree = PhTree.create(dim);

        long[] key;
        for (int i = 0; i < entries; i++) {
            key = createRandomKey(dim);
            tree.put(key, Arrays.toString(key));
        }
        return tree;
    }
 
开发者ID:tzaeschke,项目名称:distributed-phtree,代码行数:12,代码来源:TestOperationsUtil.java

示例7: PhTreeC

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
private PhTreeC(int dims) {
	p = PhTree.create(dims);
}
 
开发者ID:tzaeschke,项目名称:distributed-phtree,代码行数:4,代码来源:PhTreeC.java

示例8: PhTreeVProxy

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
public PhTreeVProxy(int dim) {
	tree = PhTree.create(dim);
}
 
开发者ID:tzaeschke,项目名称:phtree,代码行数:4,代码来源:PhTreeVProxy.java

示例9: newTree

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
private <T> PhTree<T> newTree(int DIM) {
	return PhTree.create(DIM);
}
 
开发者ID:tzaeschke,项目名称:phtree,代码行数:4,代码来源:TestNearestNeighbourF.java

示例10: newTreeV

import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
@Override
public <T> PhTree<T> newTreeV(int dim, int depth) {
	return PhTree.create(dim);
}
 
开发者ID:tzaeschke,项目名称:phtree,代码行数:5,代码来源:TestUtilInMemory.java


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