MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/CompactNSearch / z_sort

Method z_sort

src/CompactNSearch.cpp:59–74  ·  view source on GitHub ↗

Determines permutation table for point array.

Source from the content-addressed store, hash-verified

57
58// Determines permutation table for point array.
59void
60NeighborhoodSearch::z_sort()
61{
62 for (PointSet& d : m_point_sets)
63 {
64 d.m_sort_table.resize(d.n_points());
65 std::iota(d.m_sort_table.begin(), d.m_sort_table.end(), 0);
66
67 std::sort(d.m_sort_table.begin(), d.m_sort_table.end(),
68 [&](unsigned int a, unsigned int b)
69 {
70 return z_value(cell_index(d.point(a))) < z_value(cell_index(d.point(b)));
71 });
72 }
73 m_initialized = false;
74}
75
76
77// Build hash table and entry array from scratch.

Callers 1

mainFunction · 0.80

Calls 4

z_valueFunction · 0.85
resizeMethod · 0.80
n_pointsMethod · 0.80
pointMethod · 0.80

Tested by

no test coverage detected