Skip to content

Commit

Permalink
With move
Browse files Browse the repository at this point in the history
  • Loading branch information
tizianoGuadagnino committed Jul 11, 2024
1 parent 3e7abb6 commit 07f97b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cpp/kiss_icp/core/Preprocessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <Eigen/Core>
#include <algorithm>
#include <cmath>
#include <iterator>
#include <sophus/se3.hpp>
#include <vector>

Expand All @@ -43,8 +44,10 @@ std::vector<Eigen::Vector3d> VoxelDownsample(const std::vector<Eigen::Vector3d>
if (!grid.contains(voxel)) grid.insert({voxel, point});
});
std::vector<Eigen::Vector3d> frame_dowsampled(grid.size());
std::transform(grid.begin(), grid.end(), frame_dowsampled.begin(),
[](const auto &voxel_and_point) { return voxel_and_point.second; });
std::transform(std::make_move_iterator(grid.begin()), //
std::make_move_iterator(grid.end()), //
frame_dowsampled.begin(),
[](auto &&voxel_and_point) { return voxel_and_point.second; });
return frame_dowsampled;
}

Expand Down

0 comments on commit 07f97b1

Please sign in to comment.