From 6477b5a43cb2aa98ed2fdd9cfdecb498b2b6a3b5 Mon Sep 17 00:00:00 2001 From: Hyungtae Lim Date: Sat, 12 Oct 2024 15:32:03 -0400 Subject: [PATCH] (minor) Set 'const' and follow Seungjae's writing style --- cpp/patchworkpp/src/patchworkpp.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/patchworkpp/src/patchworkpp.cpp b/cpp/patchworkpp/src/patchworkpp.cpp index 319d543..92f2a46 100755 --- a/cpp/patchworkpp/src/patchworkpp.cpp +++ b/cpp/patchworkpp/src/patchworkpp.cpp @@ -5,8 +5,8 @@ using namespace patchwork; bool point_z_cmp(PointXYZ a, PointXYZ b) { return a.z < b.z; } -Eigen::MatrixX3f PatchWorkpp::toEigenCloud(vector cloud) -{ +Eigen::MatrixX3f PatchWorkpp::toEigenCloud(const vector &cloud) { + Eigen::MatrixX3f dst(cloud.size(), 3); int j=0; for (auto &p: cloud) { @@ -15,8 +15,8 @@ Eigen::MatrixX3f PatchWorkpp::toEigenCloud(vector cloud) return dst; } -Eigen::VectorXi PatchWorkpp::toIndices(vector cloud) -{ +Eigen::VectorXi PatchWorkpp::toIndices(const vector &cloud) { + Eigen::VectorXi dst(cloud.size()); int j = 0; for (auto &p: cloud) { @@ -25,8 +25,8 @@ Eigen::VectorXi PatchWorkpp::toIndices(vector cloud) return dst; } -void PatchWorkpp::addCloud(vector &cloud, vector &add) -{ +void PatchWorkpp::addCloud(vector &cloud, vector &add) { + cloud.insert(cloud.end(), add.begin(), add.end()); }