MCPcopy Create free account
hub / github.com/davisking/dlib / remove_long_edges

Function remove_long_edges

dlib/graph_utils/edge_list_graphs.h:411–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409 typename vector_type
410 >
411 void remove_long_edges (
412 vector_type& pairs,
413 double distance_threshold
414 )
415 {
416 vector_type temp;
417 temp.reserve(pairs.size());
418
419 // add all the pairs shorter than the given threshold into temp
420 for (unsigned long i = 0; i < pairs.size(); ++i)
421 {
422 if (pairs[i].distance() <= distance_threshold)
423 temp.push_back(pairs[i]);
424 }
425
426 // move temp into the output vector
427 temp.swap(pairs);
428 }
429
430// ----------------------------------------------------------------------------------------
431

Callers

nothing calls this directly

Calls 5

reserveMethod · 0.80
sizeMethod · 0.45
distanceMethod · 0.45
push_backMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected