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

Method build128d

src/main/java/marc/math/Flann.java:128–146  ·  view source on GitHub ↗
(List<T> d, Function<T, float[]> t)

Source from the content-addressed store, hash-verified

126 }
127
128 public <T> void build128d(List<T> d, Function<T, float[]> t) {
129 free();
130
131 FloatBuffer f = (allocated == null || allocated.capacity() != d.size() * 128) ? ByteBuffer.allocateDirect(
132 4 * d.size() * 128)
133 .order(ByteOrder.nativeOrder())
134 .asFloatBuffer() : allocated;
135
136 for (T dd : d) {
137 float[] v = t.apply(dd);
138 if (v.length != 128)
139 throw new IllegalArgumentException(v.length + "!=128");
140 f.put(v);
141 }
142 f.rewind();
143 cloud = build128(f, d.size());
144 allocated = f;
145 is2d = false;
146 }
147
148 public <T> Flann build2d(List<T> d, Function<T, Vec2> t) {
149 free();

Callers

nothing calls this directly

Calls 6

freeMethod · 0.95
build128Method · 0.95
applyMethod · 0.65
sizeMethod · 0.45
orderMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected