MCPcopy Create free account
hub / github.com/PDAL/PDAL / filter

Method filter

filters/CovarianceFeaturesFilter.cpp:175–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175void CovarianceFeaturesFilter::filter(PointView& view)
176{
177 KD3Index& kdi = view.build3dIndex();
178
179 point_count_t npoints = view.size();
180 point_count_t chunk_size = npoints / m_threads;
181 if (npoints % m_threads) chunk_size++;
182 std::vector<std::thread> threadList(m_threads);
183
184 log()->get(LogLevel::Debug) << "Processing " << npoints << " points in "
185 << m_threads << " threads.\n";
186
187 for(int t = 0; t < m_threads; t++)
188 {
189 threadList[t] = std::thread(
190 [&](const PointId start, const PointId end)
191 {
192 for(PointId i = start; i < end; i++)
193 setDimensionality(view, i, kdi);
194 },
195 t * chunk_size,
196 (t + 1) == m_threads ? npoints : (t + 1) * chunk_size
197 );
198 }
199
200 for (auto &t: threadList)
201 t.join();
202}
203
204void CovarianceFeaturesFilter::setDimensionality(PointView &view, const PointId &id, const KD3Index &kdi)
205{

Callers

nothing calls this directly

Calls 3

logFunction · 0.50
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected