Skip to content

Commit d3769b1

Browse files
authored
Merge pull request #6277 from mvieth/noalias
Use noalias() where possible
2 parents 0dec791 + eee7805 commit d3769b1

File tree

24 files changed

+50
-50
lines changed

24 files changed

+50
-50
lines changed

common/include/pcl/common/impl/centroid.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ computeCentroidAndOBB (const pcl::PointCloud<PointT> &cloud,
696696
//[0 , 1 ]
697697
Eigen::Matrix<Scalar, 4, 4> transform = Eigen::Matrix<Scalar, 4, 4>::Identity();
698698
transform.template topLeftCorner<3, 3>() = obb_rotational_matrix.transpose();
699-
transform.template topRightCorner<3, 1>() =-transform.template topLeftCorner<3, 3>()*centroid;
699+
transform.template topRightCorner<3, 1>().noalias() =-transform.template topLeftCorner<3, 3>()*centroid;
700700

701701
//when Scalar==double on a Windows 10 machine and MSVS:
702702
//if you substitute the following Scalars with floats you get a 20% worse processing time, if with 2 PointT 55% worse
@@ -786,7 +786,7 @@ computeCentroidAndOBB (const pcl::PointCloud<PointT> &cloud,
786786
obb_dimensions(1) = obb_max_pointy - obb_min_pointy;
787787
obb_dimensions(2) = obb_max_pointz - obb_min_pointz;
788788

789-
obb_center = centroid + obb_rotational_matrix * shift;//position of the OBB center in the same reference Oxyz of the point cloud
789+
obb_center.noalias() = centroid + obb_rotational_matrix * shift;//position of the OBB center in the same reference Oxyz of the point cloud
790790

791791
return (point_count);
792792
}
@@ -830,7 +830,7 @@ computeCentroidAndOBB (const pcl::PointCloud<PointT> &cloud,
830830
//[0 , 1 ]
831831
Eigen::Matrix<Scalar, 4, 4> transform = Eigen::Matrix<Scalar, 4, 4>::Identity();
832832
transform.template topLeftCorner<3, 3>() = obb_rotational_matrix.transpose();
833-
transform.template topRightCorner<3, 1>() =-transform.template topLeftCorner<3, 3>()*centroid;
833+
transform.template topRightCorner<3, 1>().noalias() =-transform.template topLeftCorner<3, 3>()*centroid;
834834

835835
//when Scalar==double on a Windows 10 machine and MSVS:
836836
//if you substitute the following Scalars with floats you get a 20% worse processing time, if with 2 PointT 55% worse
@@ -922,7 +922,7 @@ computeCentroidAndOBB (const pcl::PointCloud<PointT> &cloud,
922922
obb_dimensions(1) = obb_max_pointy - obb_min_pointy;
923923
obb_dimensions(2) = obb_max_pointz - obb_min_pointz;
924924

925-
obb_center = centroid + obb_rotational_matrix * shift;//position of the OBB center in the same reference Oxyz of the point cloud
925+
obb_center.noalias() = centroid + obb_rotational_matrix * shift;//position of the OBB center in the same reference Oxyz of the point cloud
926926

927927
return (point_count);
928928
}

common/include/pcl/common/impl/eigen.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,8 @@ transformBetween2CoordinateSystems (const Eigen::Matrix<Scalar, Eigen::Dynamic,
912912
// Identity matrix = transform to CS2 to CS3
913913
// Note: if CS1 == CS2 --> transformation = T3
914914
transformation = Eigen::Transform<Scalar, 3, Eigen::Affine>::Identity ();
915-
transformation.linear () = T3.linear () * T2.linear ().inverse ();
916-
transformation.translation () = to0 - (transformation.linear () * fr0);
915+
transformation.linear ().noalias () = T3.linear () * T2.linear ().inverse ();
916+
transformation.translation ().noalias () = to0 - (transformation.linear () * fr0);
917917
return (true);
918918
}
919919

common/include/pcl/common/impl/pca.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ PCA<PointT>::initCompute ()
8686
eigenvectors_.col(2) = eigenvectors_.col(0).cross(eigenvectors_.col(1));
8787
// If not basis only then compute the coefficients
8888
if (!basis_only_)
89-
coefficients_ = eigenvectors_.transpose() * cloud_demean.topRows<3> ();
89+
coefficients_.noalias() = eigenvectors_.transpose() * cloud_demean.topRows<3> ();
9090
compute_done_ = true;
9191
return (true);
9292
}
@@ -171,7 +171,7 @@ PCA<PointT>::project (const PointT& input, PointT& projection)
171171
PCL_THROW_EXCEPTION (InitFailedException, "[pcl::PCA::project] PCA initCompute failed");
172172

173173
Eigen::Vector3f demean_input = input.getVector3fMap () - mean_.head<3> ();
174-
projection.getVector3fMap () = eigenvectors_.transpose() * demean_input;
174+
projection.getVector3fMap ().noalias () = eigenvectors_.transpose() * demean_input;
175175
}
176176

177177

common/include/pcl/common/impl/polynomial_calculations.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ PolynomialCalculationsT<real>::bivariatePolynomialApproximation (
482482
//std::cout << "Cholesky took "<< (choleskyStartTime+get_time ())*1000<<"ms.\n";
483483

484484
//double invStartTime=-get_time ();
485-
parameters = A.inverse () * b;
485+
parameters.noalias() = A.inverse () * b;
486486
//std::cout << "Inverse took "<< (invStartTime+get_time ())*1000<<"ms.\n";
487487

488488
//std::cout << PVARC (A)<<PVARC (b)<<PVARN (parameters);

features/include/pcl/features/impl/intensity_gradient.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pcl::IntensityGradientEstimation <PointInT, PointNT, PointOutT, IntensitySelecto
136136
// std::cout << A << "\n*\n" << bb << "\n=\n" << x << "\nvs.\n" << x2 << "\n\n";
137137
// std::cout << A * x << "\nvs.\n" << A * x2 << "\n\n------\n";
138138
// Project the gradient vector, x, onto the tangent plane
139-
gradient = (Eigen::Matrix3f::Identity () - normal*normal.transpose ()) * x;
139+
gradient.noalias() = (Eigen::Matrix3f::Identity () - normal*normal.transpose ()) * x;
140140
}
141141

142142
//////////////////////////////////////////////////////////////////////////////////////////////

features/include/pcl/features/impl/moment_of_inertia_estimation.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ pcl::MomentOfInertiaEstimation<PointT>::computeOBB ()
266266
obb_max_point_.y -= shift (1);
267267
obb_max_point_.z -= shift (2);
268268

269-
obb_position_ = mean_value_ + obb_rotational_matrix_ * shift;
269+
obb_position_.noalias() = mean_value_ + obb_rotational_matrix_ * shift;
270270
}
271271

272272
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -366,7 +366,7 @@ pcl::MomentOfInertiaEstimation<PointT>::computeCovarianceMatrix (Eigen::Matrix <
366366
current_point (1) = (*input_)[(*indices_)[i_point]].y - mean_value_ (1);
367367
current_point (2) = (*input_)[(*indices_)[i_point]].z - mean_value_ (2);
368368

369-
covariance_matrix += current_point * current_point.transpose ();
369+
covariance_matrix.noalias() += current_point * current_point.transpose ();
370370
}
371371

372372
covariance_matrix *= factor;
@@ -387,7 +387,7 @@ pcl::MomentOfInertiaEstimation<PointT>::computeCovarianceMatrix (PointCloudConst
387387
current_point (1) = (*cloud)[i_point].y - mean_value_ (1);
388388
current_point (2) = (*cloud)[i_point].z - mean_value_ (2);
389389

390-
covariance_matrix += current_point * current_point.transpose ();
390+
covariance_matrix.noalias() += current_point * current_point.transpose ();
391391
}
392392

393393
covariance_matrix *= factor;

features/include/pcl/features/impl/principal_curvatures.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pcl::PrincipalCurvaturesEstimation<PointInT, PointNT, PointOutT>::computePointPr
7878
for (std::size_t idx = 0; idx < indices.size(); ++idx)
7979
{
8080
const auto normal = normals[indices[idx]].getNormalVector3fMap();
81-
projected_normals[idx] = M * normal;
81+
projected_normals[idx].noalias() = M * normal;
8282
xyz_centroid += projected_normals[idx];
8383
}
8484

features/include/pcl/features/impl/rops_estimation.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ pcl::ROPSEstimation <PointInT, PointOutT>::computeLRF (const PointInT& point, co
275275
for (const auto &i_pt : pt)
276276
{
277277
Eigen::Vector3f vec = i_pt - feature_point;
278-
curr_scatter_matrix += vec * (vec.transpose ());
278+
curr_scatter_matrix.noalias() += vec * (vec.transpose ());
279279
for (const auto &j_pt : pt)
280-
curr_scatter_matrix += vec * ((j_pt - feature_point).transpose ());
280+
curr_scatter_matrix.noalias() += vec * ((j_pt - feature_point).transpose ());
281281
}
282282
scatter_matrices.emplace_back (coeff * curr_scatter_matrix);
283283
}

features/include/pcl/features/impl/shot_lrf.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pcl::SHOTLocalReferenceFrameEstimation<PointInT, PointOutT>::getLocalRF (const i
7777
distance = search_parameter_ - sqrt (n_sqr_distances[i_idx]);
7878

7979
// Multiply vij * vij'
80-
cov_m += distance * (vij.row (valid_nn_points).head<3> ().transpose () * vij.row (valid_nn_points).head<3> ());
80+
cov_m.noalias() += distance * (vij.row (valid_nn_points).head<3> ().transpose () * vij.row (valid_nn_points).head<3> ());
8181

8282
sum += distance;
8383
valid_nn_points++;

features/include/pcl/features/our_cvfh.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ namespace pcl
114114
homMatrix = transformPC.matrix ();
115115

116116
Eigen::Matrix4f trans_copy = trans.inverse ();
117-
trans = trans_copy * center_mat * homMatrix;
117+
trans.noalias() = trans_copy * center_mat * homMatrix;
118118
return trans;
119119
}
120120

filters/include/pcl/filters/conditional_removal.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ namespace pcl
401401
inline void
402402
transformComparison (const Eigen::Matrix4f &transform)
403403
{
404-
tf_comp_matr_ = transform.transpose () * comp_matr_ * transform;
405-
tf_comp_vect_ = comp_vect_.transpose () * transform;
404+
tf_comp_matr_.noalias() = transform.transpose () * comp_matr_ * transform;
405+
tf_comp_vect_.noalias() = comp_vect_.transpose () * transform;
406406
}
407407

408408
/** \brief transform the coordinate system of the comparison. If you think of

filters/include/pcl/filters/impl/covariance_sampling.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pcl::CovarianceSampling<PointT, PointNT>::computeCovarianceMatrix (Eigen::Matrix
122122
}
123123

124124
// Compute the covariance matrix C and its 6 eigenvectors (initially complex, move them to a double matrix)
125-
covariance_matrix = f_mat * f_mat.transpose ();
125+
covariance_matrix.noalias() = f_mat * f_mat.transpose ();
126126
return true;
127127
}
128128

filters/include/pcl/filters/impl/voxel_grid_covariance.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pcl::VoxelGridCovariance<PointT>::applyFilter (PointCloud &output)
175175
// Accumulate point sum for centroid calculation
176176
leaf.mean_ += pt3d;
177177
// Accumulate x*xT for single pass covariance calculation
178-
leaf.cov_ += pt3d * pt3d.transpose ();
178+
leaf.cov_.noalias() += pt3d * pt3d.transpose ();
179179

180180
// Do we need to process all the fields?
181181
if (!downsample_all_data_)
@@ -231,7 +231,7 @@ pcl::VoxelGridCovariance<PointT>::applyFilter (PointCloud &output)
231231
// Accumulate point sum for centroid calculation
232232
leaf.mean_ += pt3d;
233233
// Accumulate x*xT for single pass covariance calculation
234-
leaf.cov_ += pt3d * pt3d.transpose ();
234+
leaf.cov_.noalias() += pt3d * pt3d.transpose ();
235235

236236
// Do we need to process all the fields?
237237
if (!downsample_all_data_)
@@ -349,7 +349,7 @@ pcl::VoxelGridCovariance<PointT>::applyFilter (PointCloud &output)
349349
eigen_val (1, 1) = min_covar_eigvalue;
350350
}
351351

352-
leaf.cov_ = leaf.evecs_ * eigen_val * leaf.evecs_.inverse ();
352+
leaf.cov_.noalias() = leaf.evecs_ * eigen_val * leaf.evecs_.inverse ();
353353
}
354354
leaf.evals_ = eigen_val.diagonal ();
355355

@@ -475,7 +475,7 @@ pcl::VoxelGridCovariance<PointT>::getDisplayCloud (pcl::PointCloud<PointXYZ>& ce
475475
for (int i = 0; i < pnt_per_cell; i++)
476476
{
477477
rand_point = Eigen::Vector3d (var_nor (), var_nor (), var_nor ());
478-
dist_point = cell_mean + cholesky_decomp * rand_point;
478+
dist_point.noalias() = cell_mean + cholesky_decomp * rand_point;
479479
cell_cloud.push_back (PointXYZ (static_cast<float> (dist_point (0)), static_cast<float> (dist_point (1)), static_cast<float> (dist_point (2))));
480480
}
481481
}

people/include/pcl/people/impl/ground_based_people_detection_app.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ pcl::people::GroundBasedPeopleDetectionApp<PointT>::applyTransformationGround ()
274274
{
275275
Eigen::Transform<float, 3, Eigen::Affine> transform;
276276
transform = transformation_;
277-
ground_coeffs_transformed_ = transform.matrix() * ground_coeffs_;
277+
ground_coeffs_transformed_.noalias() = transform.matrix() * ground_coeffs_;
278278
}
279279
else
280280
{
@@ -287,7 +287,7 @@ pcl::people::GroundBasedPeopleDetectionApp<PointT>::applyTransformationIntrinsic
287287
{
288288
if (transformation_set_ && intrinsics_matrix_set_)
289289
{
290-
intrinsics_matrix_transformed_ = intrinsics_matrix_ * transformation_.transpose();
290+
intrinsics_matrix_transformed_.noalias() = intrinsics_matrix_ * transformation_.transpose();
291291
}
292292
else
293293
{

recognition/include/pcl/recognition/impl/implicit_shape_model.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ pcl::ism::ImplicitShapeModelEstimation<FeatureSize, PointT, NormalT>::alignYCoor
11851185
B, A, 0.0f,
11861186
0.0f, 0.0f, 1.0f;
11871187

1188-
result = rotation_matrix_X * rotation_matrix_Z;
1188+
result.noalias() = rotation_matrix_X * rotation_matrix_Z;
11891189

11901190
return (result);
11911191
}

registration/include/pcl/registration/impl/gicp.hpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::computeCovar
144144
double v = 1.; // biggest 2 singular values replaced by 1
145145
if (k == 2) // smallest singular value replaced by gicp_epsilon
146146
v = gicp_epsilon_;
147-
cov += v * col * col.transpose();
147+
cov.noalias() += v * col * col.transpose();
148148
}
149149
cloud_covariances[i] = cov;
150150
}
@@ -429,8 +429,8 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::
429429
else
430430
inverted_eigenvalues(i, i) = 1.0 / ev;
431431
}
432-
delta = eigensolver.eigenvectors() * inverted_eigenvalues *
433-
eigensolver.eigenvectors().transpose() * gradient;
432+
delta.noalias() = eigensolver.eigenvectors() * inverted_eigenvalues *
433+
eigensolver.eigenvectors().transpose() * gradient;
434434

435435
// simple line search to guarantee a decrease in the function value
436436
double alpha = 1.0;
@@ -542,9 +542,9 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::
542542
// closes)
543543
g.head<3>() += Md;
544544
// Increment rotation gradient
545-
p_trans_src = gicp_->base_transformation_.template cast<float>() * p_src;
545+
p_trans_src.noalias() = gicp_->base_transformation_.template cast<float>() * p_src;
546546
Eigen::Vector3d p_base_src(p_trans_src[0], p_trans_src[1], p_trans_src[2]);
547-
dCost_dR_T += p_base_src * Md.transpose();
547+
dCost_dR_T.noalias() += p_base_src * Md.transpose();
548548
}
549549
g.head<3>() *= 2.0 / m;
550550
dCost_dR_T *= 2.0 / m;
@@ -584,10 +584,10 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::
584584
// g.head<3> ()+= 2*M*d/num_matches (we postpone 2/num_matches after the loop
585585
// closes)
586586
g.head<3>() += Md;
587-
p_trans_src = gicp_->base_transformation_.template cast<float>() * p_src;
587+
p_trans_src.noalias() = gicp_->base_transformation_.template cast<float>() * p_src;
588588
Eigen::Vector3d p_base_src(p_trans_src[0], p_trans_src[1], p_trans_src[2]);
589589
// Increment rotation gradient
590-
dCost_dR_T += p_base_src * Md.transpose();
590+
dCost_dR_T.noalias() += p_base_src * Md.transpose();
591591
}
592592
f /= static_cast<double>(m);
593593
g.head<3>() *= (2.0 / m);
@@ -661,7 +661,7 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::
661661
const Eigen::Vector3d Md(M * d); // Md = M*d
662662
gradient.head<3>() += Md; // translation gradient
663663
hessian.topLeftCorner<3, 3>() += M; // translation-translation hessian
664-
p_trans_src = base_transformation_float * p_src;
664+
p_trans_src.noalias() = base_transformation_float * p_src;
665665
const Eigen::Vector3d p_base_src(p_trans_src[0], p_trans_src[1], p_trans_src[2]);
666666
dCost_dR_T.noalias() += p_base_src * Md.transpose();
667667
dCost_dR_T1b += p_base_src[0] * M;
@@ -895,7 +895,7 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::
895895
PCL_DEBUG("[pcl::%s::computeTransformation] Convergence failed\n",
896896
getClassName().c_str());
897897
}
898-
final_transformation_ = previous_transformation_ * guess;
898+
final_transformation_.noalias() = previous_transformation_ * guess;
899899

900900
PCL_DEBUG("Transformation "
901901
"is:\n\t%5f\t%5f\t%5f\t%5f\n\t%5f\t%5f\t%5f\t%5f\n\t%5f\t%5f\t%5f\t%5f\n\t%"

registration/include/pcl/registration/impl/icp.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ IterativeClosestPoint<PointSource, PointTarget, Scalar>::transformCloud(
7070
if (!std::isfinite(pt[0]) || !std::isfinite(pt[1]) || !std::isfinite(pt[2]))
7171
continue;
7272

73-
pt_t = tr * pt;
73+
pt_t.noalias() = tr * pt;
7474

7575
memcpy(data_out + x_idx_offset_, &pt_t[0], sizeof(float));
7676
memcpy(data_out + y_idx_offset_, &pt_t[1], sizeof(float));
@@ -83,7 +83,7 @@ IterativeClosestPoint<PointSource, PointTarget, Scalar>::transformCloud(
8383
if (!std::isfinite(nt[0]) || !std::isfinite(nt[1]) || !std::isfinite(nt[2]))
8484
continue;
8585

86-
nt_t = rot * nt;
86+
nt_t.noalias() = rot * nt;
8787

8888
memcpy(data_out + nx_idx_offset_, &nt_t[0], sizeof(float));
8989
memcpy(data_out + ny_idx_offset_, &nt_t[1], sizeof(float));
@@ -101,7 +101,7 @@ IterativeClosestPoint<PointSource, PointTarget, Scalar>::transformCloud(
101101
if (!std::isfinite(pt[0]) || !std::isfinite(pt[1]) || !std::isfinite(pt[2]))
102102
continue;
103103

104-
pt_t = tr * pt;
104+
pt_t.noalias() = tr * pt;
105105

106106
memcpy(data_out + x_idx_offset_, &pt_t[0], sizeof(float));
107107
memcpy(data_out + y_idx_offset_, &pt_t[1], sizeof(float));

registration/include/pcl/registration/impl/ndt_2d.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class NormalDist {
124124
for (const auto& pt_index : pt_indices_) {
125125
Eigen::Vector2d p(cloud[pt_index].x, cloud[pt_index].y);
126126
sx += p;
127-
sxx += p * p.transpose();
127+
sxx.noalias() += p * p.transpose();
128128
}
129129

130130
n_ = pt_indices_.size();
@@ -145,7 +145,7 @@ class NormalDist {
145145
Eigen::Matrix2d q = solver.eigenvectors();
146146
// set minimum smallest eigenvalue:
147147
l(0, 0) = l(1, 1) * min_covar_eigvalue_mult;
148-
covar = q * l * q.transpose();
148+
covar.noalias() = q * l * q.transpose();
149149
}
150150
covar_inv_ = covar.inverse();
151151
}

registration/include/pcl/registration/impl/transformation_estimation_3point.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ pcl::registration::TransformationEstimation3Point<PointSource, PointTarget, Scal
187187
transformation_matrix.template topLeftCorner<3, 3>() = R;
188188
// transformation_matrix.block<3, 1>(0, 3) = source_mean.head<3>() - R *
189189
// target_mean.head<3>();
190-
transformation_matrix.template block<3, 1>(0, 3) =
190+
transformation_matrix.template block<3, 1>(0, 3).noalias() =
191191
target_mean.template head<3>() - R * source_mean.template head<3>();
192192
}
193193

registration/src/gicp6d.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ GeneralizedIterativeClosestPoint6D::computeTransformation(PointCloudSource& outp
225225
PCL_DEBUG("[pcl::%s::computeTransformation] Convergence failed\n",
226226
getClassName().c_str());
227227
}
228-
final_transformation_.topLeftCorner<3, 3>() =
228+
final_transformation_.topLeftCorner<3, 3>().noalias() =
229229
previous_transformation_.topLeftCorner<3, 3>() * guess.topLeftCorner<3, 3>();
230230
final_transformation_(0, 3) = previous_transformation_(0, 3) + guess(0, 3);
231231
final_transformation_(1, 3) = previous_transformation_(1, 3) + guess(1, 3);

sample_consensus/include/pcl/sample_consensus/impl/sac_model_ellipse3d.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,12 @@ pcl::SampleConsensusModelEllipse3D<PointT>::computeModelCoefficients (const Indi
199199
Eigen::Vector3f p_ctr;
200200
float aux_par(0.0);
201201
if (par_a > par_b) {
202-
p_ctr = p0 + Rot * Eigen::Vector3f(par_h, par_k, 0.0);
202+
p_ctr.noalias() = p0 + Rot * Eigen::Vector3f(par_h, par_k, 0.0);
203203
} else {
204204
aux_par = par_a;
205205
par_a = par_b;
206206
par_b = aux_par;
207-
p_ctr = p0 + Rot * Eigen::Vector3f(par_k, par_h, 0.0);
207+
p_ctr.noalias() = p0 + Rot * Eigen::Vector3f(par_k, par_h, 0.0);
208208
}
209209

210210
// Center (x, y, z)

search/include/pcl/search/impl/organized.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ pcl::search::OrganizedNeighbor<PointT>::estimateProjectionMatrix ()
371371
KR_ = projection_matrix_.topLeftCorner <3, 3> ();
372372

373373
// precalculate KR * KR^T needed by calculations during nn-search
374-
KR_KRT_ = KR_ * KR_.transpose ();
374+
KR_KRT_.noalias() = KR_ * KR_.transpose ();
375375
return true;
376376
}
377377

surface/include/pcl/surface/impl/mls.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,8 @@ pcl::MLSResult::computeMLSSurface (const pcl::PointCloud<PointT> &cloud,
796796

797797
// Computing coefficients
798798
const Eigen::MatrixXd P_weight = P * weight_vec.asDiagonal(); // size will be (nr_coeff_, nn_indices.size ());
799-
P_weight_Pt = P_weight * P.transpose ();
800-
c_vec = P_weight * f_vec;
799+
P_weight_Pt.noalias() = P_weight * P.transpose ();
800+
c_vec.noalias() = P_weight * f_vec;
801801
P_weight_Pt.llt ().solveInPlace (c_vec);
802802
}
803803
}

0 commit comments

Comments
 (0)