本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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());
}
示例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;
}
示例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;
}
示例7: PhTreeC
import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
private PhTreeC(int dims) {
p = PhTree.create(dims);
}
示例8: PhTreeVProxy
import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
public PhTreeVProxy(int dim) {
tree = PhTree.create(dim);
}
示例9: newTree
import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
private <T> PhTree<T> newTree(int DIM) {
return PhTree.create(DIM);
}
示例10: newTreeV
import ch.ethz.globis.phtree.PhTree; //导入方法依赖的package包/类
@Override
public <T> PhTree<T> newTreeV(int dim, int depth) {
return PhTree.create(dim);
}