本文整理匯總了Java中ch.ethz.globis.phtree.PhTree.PhKnnQuery.hasNext方法的典型用法代碼示例。如果您正苦於以下問題:Java PhKnnQuery.hasNext方法的具體用法?Java PhKnnQuery.hasNext怎麽用?Java PhKnnQuery.hasNext使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ch.ethz.globis.phtree.PhTree.PhKnnQuery
的用法示例。
在下文中一共展示了PhKnnQuery.hasNext方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: nearestNeighbours
import ch.ethz.globis.phtree.PhTree.PhKnnQuery; //導入方法依賴的package包/類
public static PhKnnQuery<long[]> nearestNeighbours(long[] q, int k, PhKnnQuery<long[]> points) {
if (!points.hasNext()) {
return new EmptyPhKnnQuery<>();
}
PhTree<long[]> tree = createTree(q.length, points);
return tree.nearestNeighbour(k, q);
}
示例2: knnToList
import ch.ethz.globis.phtree.PhTree.PhKnnQuery; //導入方法依賴的package包/類
public static <V> List<long[]> knnToList(PhKnnQuery<V> knn) {
ArrayList<long[]> ret = new ArrayList<>();
while (knn.hasNext()) {
ret.add(knn.nextKey());
}
return ret;
}
示例3: createTree
import ch.ethz.globis.phtree.PhTree.PhKnnQuery; //導入方法依賴的package包/類
private static <V> PhTree<long[]> createTree(int dim, PhKnnQuery<V> entries) {
PhTree<long[]> tree = PhTree.create(dim);
while (entries.hasNext()) {
long[] key = entries.nextKey();
tree.put(key, key);
}
return tree;
}
示例4: createKeyList
import ch.ethz.globis.phtree.PhTree.PhKnnQuery; //導入方法依賴的package包/類
private IndexEntryList<long[], byte[]> createKeyList(PhKnnQuery<byte[]> keyList) {
IndexEntryList<long[], byte[]> results = new IndexEntryList<>();
while (keyList.hasNext()) {
results.add(keyList.nextKey(), null);
}
return results;
}
示例5: toList
import ch.ethz.globis.phtree.PhTree.PhKnnQuery; //導入方法依賴的package包/類
private List<long[]> toList(PhKnnQuery<?> q) {
ArrayList<long[]> ret = new ArrayList<>();
while (q.hasNext()) {
ret.add(q.nextKey());
}
return ret;
}