Skip to content

Commit

Permalink
addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chambbj committed May 27, 2020
1 parent abe3fe3 commit 4edc977
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
11 changes: 5 additions & 6 deletions filters/LloydKMeansFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ static StaticPluginInfo const s_info{

CREATE_STATIC_STAGE(LloydKMeansFilter, s_info)

LloydKMeansFilter::LloydKMeansFilter() {}

std::string LloydKMeansFilter::getName() const
{
return s_info.name;
Expand Down Expand Up @@ -100,10 +102,7 @@ void LloydKMeansFilter::filter(PointView& view)
// additional dimensions as specified via filter options
PointTable table;
table.layout()->registerDims({Id::X, Id::Y, Id::Z});
for (auto const& dimid : m_dimIdList)
{
table.layout()->registerDim(dimid);
}
table.layout()->registerDims(m_dimIdList);

// create view of initial cluster centers
PointViewPtr centers(new PointView(table));
Expand Down Expand Up @@ -157,9 +156,9 @@ void LloydKMeansFilter::filter(PointView& view)
centers->setField(m_dimIdList[i], id, M1[i][id]);
}
}
centers->invalidateProducts();
centers->build3dIndex();
}
centers->invalidateProducts();
centers->build3dIndex();
}

} // namespace pdal
3 changes: 2 additions & 1 deletion filters/LloydKMeansFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class ProgramArgs;
class PDAL_DLL LloydKMeansFilter : public Filter
{
public:
LloydKMeansFilter() : Filter() {}
LloydKMeansFilter();

LloydKMeansFilter& operator=(const LloydKMeansFilter&) = delete;
LloydKMeansFilter(const LloydKMeansFilter&) = delete;

Expand Down
2 changes: 1 addition & 1 deletion filters/private/Segmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ PointIdList farthestPointSampling(PointView& view, point_count_t count)
// Record the PointId of the farthest point and add it to the output
// PointView.
PointId idx(it - min_dists.begin());
ids[i] = idx;
ids[i] = idx;

// Compute distances from idx to all other points.
kdi.knnSearch(idx, view.size(), &indices, &sqr_dists);
Expand Down

0 comments on commit 4edc977

Please sign in to comment.