未验证 提交 db7eaf52 编写于 作者: S Sergey Alexandrov 提交者: GitHub

Merge pull request #3605 from kunaltyagi/prefix-increment

Using prefix ++/-- operators for non-primitive types
......@@ -284,7 +284,7 @@ namespace pcl
// select point from organized point cloud
x = x_pos + (*radiusSearchLookup_Iterator).x_diff_;
y = y_pos + (*radiusSearchLookup_Iterator).y_diff_;
radiusSearchLookup_Iterator++;
++radiusSearchLookup_Iterator;
if ((x >= 0) && (y >= 0) && (x < (int)input_->width) && (y < (int)input_->height))
{
......
......@@ -211,7 +211,7 @@ pcl::NormalSpaceSampling<PointT, NormalT>::applyFilter (std::vector<int> &indice
random_access[i].resize (normals_hg[i].size ());
std::size_t j = 0;
for (std::list<int>::iterator itr = normals_hg[i].begin (); itr != normals_hg[i].end (); itr++, j++)
for (std::list<int>::iterator itr = normals_hg[i].begin (); itr != normals_hg[i].end (); ++itr, ++j)
random_access[i][j] = itr;
}
std::vector<std::size_t> start_index (normals_hg.size ());
......
......@@ -46,7 +46,7 @@ pcl::ASCIIReader::setInputFields ()
// Remove empty fields and adjust offset
int offset =0;
for (std::vector<pcl::PCLPointField>::iterator field_iter = fields_.begin ();
field_iter != fields_.end (); field_iter++)
field_iter != fields_.end (); ++field_iter)
{
if (field_iter->name == "_")
field_iter = fields_.erase (field_iter);
......
......@@ -103,8 +103,8 @@ public:
}
size -= tail_size;
key_it++;
evict_count++;
++key_it;
++evict_count;
}
// Evict enough items to make room for the new item
......
......@@ -178,7 +178,7 @@ pcl::people::HeadBasedSubclustering<PointT>::mergeClustersCloseInFloorCoordinate
{
used_clusters[cluster] = true;
for(std::vector<int>::const_iterator points_iterator = input_clusters[cluster].getIndices().indices.begin();
points_iterator != input_clusters[cluster].getIndices().indices.end(); points_iterator++)
points_iterator != input_clusters[cluster].getIndices().indices.end(); ++points_iterator)
{
point_indices.indices.push_back(*points_iterator);
}
......@@ -214,7 +214,7 @@ pcl::people::HeadBasedSubclustering<PointT>::createSubClusters (pcl::people::Per
}
// Associate cluster points to one of the maximum:
for(std::vector<int>::const_iterator points_iterator = cluster.getIndices().indices.begin(); points_iterator != cluster.getIndices().indices.end(); points_iterator++)
for(std::vector<int>::const_iterator points_iterator = cluster.getIndices().indices.begin(); points_iterator != cluster.getIndices().indices.end(); ++points_iterator)
{
PointT* current_point = &cloud_->points[*points_iterator]; // current point cloud point
Eigen::Vector3f p_current_eigen(current_point->x, current_point->y, current_point->z); // conversion to eigen
......
......@@ -85,7 +85,7 @@ pcl::people::HeightMap2D<PointT>::compute (pcl::people::PersonCluster<PointT>& c
buckets_.resize(std::size_t((cluster.getMax()(1) - cluster.getMin()(1)) / bin_size_) + 1, 0);
buckets_cloud_indices_.resize(buckets_.size(), 0);
for(std::vector<int>::const_iterator pit = cluster.getIndices().indices.begin(); pit != cluster.getIndices().indices.end(); pit++)
for(std::vector<int>::const_iterator pit = cluster.getIndices().indices.begin(); pit != cluster.getIndices().indices.end(); ++pit)
{
PointT* p = &cloud_->points[*pit];
int index;
......
......@@ -216,7 +216,7 @@ pcl::people::PersonCluster<PointT>::init (
float min_z = c_z_;
float max_y = c_y_;
float max_z = c_z_;
for (std::vector<int>::const_iterator pit = points_indices_.indices.begin(); pit != points_indices_.indices.end(); pit++)
for (std::vector<int>::const_iterator pit = points_indices_.indices.begin(); pit != points_indices_.indices.end(); ++pit)
{
PointT* p = &input_cloud->points[*pit];
......
......@@ -442,20 +442,20 @@ pcl::registration::FPCSInitialAlignment <PointSource, PointTarget, NormalT, Scal
std::vector <int> temp (base_indices.begin (), base_indices.end ());
// loop over all combinations of base points
for (std::vector <int>::const_iterator i = copy.begin (), i_e = copy.end (); i != i_e; i++)
for (std::vector <int>::const_iterator j = copy.begin (), j_e = copy.end (); j != j_e; j++)
for (std::vector <int>::const_iterator i = copy.begin (), i_e = copy.end (); i != i_e; ++i)
for (std::vector <int>::const_iterator j = copy.begin (), j_e = copy.end (); j != j_e; ++j)
{
if (i == j)
continue;
for (std::vector <int>::const_iterator k = copy.begin (), k_e = copy.end (); k != k_e; k++)
for (std::vector <int>::const_iterator k = copy.begin (), k_e = copy.end (); k != k_e; ++k)
{
if (k == j || k == i)
continue;
std::vector <int>::const_iterator l = copy.begin ();
while (l == i || l == j || l == k)
l++;
++l;
temp[0] = *i;
temp[1] = *j;
......
......@@ -260,7 +260,7 @@ pcl::registration::KFPCSInitialAlignment <PointSource, PointTarget, NormalT, Sca
candidates.clear ();
// loop over all candidates starting from the best one
for (MatchingCandidates::iterator it_candidate = candidates_.begin (), it_e = candidates_.end (); it_candidate != it_e; it_candidate++)
for (MatchingCandidates::iterator it_candidate = candidates_.begin (), it_e = candidates_.end (); it_candidate != it_e; ++it_candidate)
{
// stop if current candidate has score below threshold
if (it_candidate->fitness_score > t)
......@@ -275,7 +275,7 @@ pcl::registration::KFPCSInitialAlignment <PointSource, PointTarget, NormalT, Sca
const float angle3d = Eigen::AngleAxisf (diff.block <3, 3> (0, 0)).angle ();
const float translation3d = diff.block <3, 1> (0, 3).norm ();
unique = angle3d > min_angle3d && translation3d > min_translation3d;
it++;
++it;
}
// add candidate to best candidates
......
......@@ -421,7 +421,7 @@ pcl::NormalDistributionsTransform<PointSource, PointTarget>::computeHessian (Eig
std::vector<float> distances;
target_cells_.radiusSearch (x_trans_pt, resolution_, neighborhood, distances);
for (typename std::vector<TargetGridLeafConstPtr>::iterator neighborhood_it = neighborhood.begin (); neighborhood_it != neighborhood.end (); neighborhood_it++)
for (typename std::vector<TargetGridLeafConstPtr>::iterator neighborhood_it = neighborhood.begin (); neighborhood_it != neighborhood.end (); ++neighborhood_it)
{
cell = *neighborhood_it;
......
......@@ -276,13 +276,13 @@ pcl::RegionGrowing<PointT, NormalT>::extract (std::vector <pcl::PointIndices>& c
clusters.resize (clusters_.size ());
std::vector<pcl::PointIndices>::iterator cluster_iter_input = clusters.begin ();
for (std::vector<pcl::PointIndices>::const_iterator cluster_iter = clusters_.begin (); cluster_iter != clusters_.end (); cluster_iter++)
for (std::vector<pcl::PointIndices>::const_iterator cluster_iter = clusters_.begin (); cluster_iter != clusters_.end (); ++cluster_iter)
{
if ((static_cast<int> (cluster_iter->indices.size ()) >= min_pts_per_cluster_) &&
(static_cast<int> (cluster_iter->indices.size ()) <= max_pts_per_cluster_))
{
*cluster_iter_input = *cluster_iter;
cluster_iter_input++;
++cluster_iter_input;
}
}
......
......@@ -203,7 +203,7 @@ pcl::RegionGrowingRGB<PointT, NormalT>::extract (std::vector <pcl::PointIndices>
cluster_iter = clusters_.erase (cluster_iter);
}
else
cluster_iter++;
++cluster_iter;
}
clusters.reserve (clusters_.size ());
......@@ -595,9 +595,9 @@ pcl::RegionGrowingRGB<PointT, NormalT>::assembleRegions (std::vector<unsigned in
while (itr1 < itr2)
{
while (!(itr1->indices.empty ()) && itr1 < itr2)
itr1++;
++itr1;
while ( itr2->indices.empty () && itr1 < itr2)
itr2--;
--itr2;
if (itr1 != itr2)
itr1->indices.swap (itr2->indices);
......
......@@ -789,7 +789,7 @@ pcl::GreedyProjectionTriangulation<PointInT>::reconstructPolygons (std::vector<p
std::vector<int>::iterator first_gap_after = angleIdx.end ();
std::vector<int>::iterator last_gap_before = angleIdx.begin ();
int nr_gaps = 0;
for (std::vector<int>::iterator it = angleIdx.begin (); it != angleIdx.end () - 1; it++)
for (std::vector<int>::iterator it = angleIdx.begin (); it != angleIdx.end () - 1; ++it)
{
if (gaps[*it])
{
......@@ -845,13 +845,13 @@ pcl::GreedyProjectionTriangulation<PointInT>::reconstructPolygons (std::vector<p
{
std::vector<int>::iterator prev_it;
int erased_idx = static_cast<int> (to_erase.size ()) -1;
for (prev_it = it-1; (erased_idx != -1) && (it != angleIdx.begin()); it--)
for (prev_it = it-1; (erased_idx != -1) && (it != angleIdx.begin()); --it)
if (*it == to_erase[erased_idx])
erased_idx--;
else
break;
bool can_delete = true;
for (std::vector<int>::iterator curr_it = prev_it+1; curr_it != it+1; curr_it++)
for (std::vector<int>::iterator curr_it = prev_it+1; curr_it != it+1; ++curr_it)
{
tmp_ = coords_[angles_[*curr_it].index] - proj_qp_;
X[0] = tmp_.dot(u_);
......@@ -881,7 +881,7 @@ pcl::GreedyProjectionTriangulation<PointInT>::reconstructPolygons (std::vector<p
}
for (const int &it : to_erase)
{
for (std::vector<int>::iterator iter = angleIdx.begin(); iter != angleIdx.end(); iter++)
for (std::vector<int>::iterator iter = angleIdx.begin(); iter != angleIdx.end(); ++iter)
if (it == *iter)
{
angleIdx.erase(iter);
......@@ -894,7 +894,7 @@ pcl::GreedyProjectionTriangulation<PointInT>::reconstructPolygons (std::vector<p
changed_1st_fn_ = false;
changed_2nd_fn_ = false;
new2boundary_ = NONE;
for (std::vector<int>::iterator it = angleIdx.begin()+1; it != angleIdx.end()-1; it++)
for (std::vector<int>::iterator it = angleIdx.begin()+1; it != angleIdx.end()-1; ++it)
{
current_index_ = angles_[*it].index;
......
......@@ -78,7 +78,7 @@ pcl::tracking::ParticleFilterTracker<PointInT, StateT>::genAliasTable (std::vect
int k = *(H - 1);
a[j] = k;
q[k] += q[j] - 1;
L++;
++L;
if ( q[k] < 1.0 )
{
*L-- = k;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册