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

Method bruteForceSearch

test/gpu/octree/data_source.hpp:111–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109 }
110
111 void bruteForceSearch(bool log = false, float radius = -1.f)
112 {
113 if (log)
114 std::cout << "BruteForceSearch";
115
116 int value100 = std::min<int>(tests_num, 50);
117 int step = tests_num/value100;
118
119 bfresutls.resize(tests_num);
120 for(std::size_t i = 0; i < tests_num; ++i)
121 {
122 if (log && i % step == 0)
123 {
124 std::cout << ".";
125 std::cout.flush();
126 }
127
128 std::vector<int>& curr_res = bfresutls[i];
129 curr_res.clear();
130
131 float query_radius = radius > 0 ? radius : radiuses[i];
132 const PointType& query = queries[i];
133
134 for(std::size_t ind = 0; ind < points.size(); ++ind)
135 {
136 const PointType& point = points[ind];
137
138 float dx = query.x - point.x;
139 float dy = query.y - point.y;
140 float dz = query.z - point.z;
141
142 if (dx*dx + dy*dy + dz*dz < query_radius * query_radius)
143 curr_res.push_back(ind);
144 }
145
146 std::sort(curr_res.begin(), curr_res.end());
147 }
148 if (log)
149 std::cout << "Done" << std::endl;
150 }
151
152 void printParams() const
153 {

Callers 2

TESTFunction · 0.80
TESTFunction · 0.80

Calls 8

sortFunction · 0.85
resizeMethod · 0.45
flushMethod · 0.45
clearMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 2

TESTFunction · 0.64
TESTFunction · 0.64