MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / get_data

Method get_data

ml/src/svm.cpp:214–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214int
215Cache::get_data(const int index, Qfloat** data, int len)
216{
217 head_t* h = &head[index];
218
219 if (h->len)
220 lru_delete(h);
221
222 int more = len - h->len;
223
224 if (more > 0) {
225 // free old space
226 while (size < more) {
227 head_t* old = lru_head.next;
228 lru_delete(old);
229 free(old->data);
230 size += old->len;
231 old->data = nullptr;
232 old->len = 0;
233 }
234
235 // allocate new space
236 h->data = static_cast<Qfloat*>(realloc(h->data, sizeof(Qfloat) * len));
237
238 size -= more;
239
240 swap(h->len, len);
241 }
242
243 lru_insert(h);
244
245 *data = h->data;
246 return len;
247}
248
249void
250Cache::swap_index(int i, int j)

Callers 5

getTextureColorMethod · 0.80
getTextureIntensityMethod · 0.80
get_QMethod · 0.80
get_QMethod · 0.80
get_QMethod · 0.80

Calls 1

swapFunction · 0.70

Tested by

no test coverage detected