MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / find3

Method find3

src/main/java/marc/math/Flann.java:167–182  ·  view source on GitHub ↗
(Vec3 p, int n)

Source from the content-addressed store, hash-verified

165 }
166
167 public List<Integer> find3(Vec3 p, int n) {
168 if (cache == null || cache.capacity() < n) {
169 cache = ByteBuffer.allocateDirect(8 * n).order(ByteOrder.nativeOrder()).asLongBuffer();
170 }
171
172 if (cloud == -1 || is2d) throw new IllegalArgumentException();
173
174
175 closestN3(cloud, (float) p.x, (float) p.y, (float) p.z, cache, n);
176
177 List<Integer> r = new ArrayList<Integer>(n);
178 for (int i = 0; i < n; i++) {
179 r.add((int) cache.get(i));
180 }
181 return r;
182 }
183
184 public int[] find3(Vec3 p, int n, int[] r) {
185 if (cache == null || cache.capacity() < n) {

Callers 2

showKnnMethod · 0.80
closestNMethod · 0.80

Calls 5

closestN3Method · 0.95
closest3Method · 0.95
getMethod · 0.65
orderMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected