@@ -144,7 +144,7 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::computeCovar
144
144
double v = 1 .; // biggest 2 singular values replaced by 1
145
145
if (k == 2 ) // smallest singular value replaced by gicp_epsilon
146
146
v = gicp_epsilon_;
147
- cov += v * col * col.transpose ();
147
+ cov. noalias () += v * col * col.transpose ();
148
148
}
149
149
cloud_covariances[i] = cov;
150
150
}
@@ -429,8 +429,8 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::
429
429
else
430
430
inverted_eigenvalues (i, i) = 1.0 / ev;
431
431
}
432
- delta = eigensolver.eigenvectors () * inverted_eigenvalues *
433
- eigensolver.eigenvectors ().transpose () * gradient;
432
+ delta. noalias () = eigensolver.eigenvectors () * inverted_eigenvalues *
433
+ eigensolver.eigenvectors ().transpose () * gradient;
434
434
435
435
// simple line search to guarantee a decrease in the function value
436
436
double alpha = 1.0 ;
@@ -542,9 +542,9 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::
542
542
// closes)
543
543
g.head <3 >() += Md;
544
544
// 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;
546
546
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 ();
548
548
}
549
549
g.head <3 >() *= 2.0 / m;
550
550
dCost_dR_T *= 2.0 / m;
@@ -584,10 +584,10 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::
584
584
// g.head<3> ()+= 2*M*d/num_matches (we postpone 2/num_matches after the loop
585
585
// closes)
586
586
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;
588
588
Eigen::Vector3d p_base_src (p_trans_src[0 ], p_trans_src[1 ], p_trans_src[2 ]);
589
589
// Increment rotation gradient
590
- dCost_dR_T += p_base_src * Md.transpose ();
590
+ dCost_dR_T. noalias () += p_base_src * Md.transpose ();
591
591
}
592
592
f /= static_cast <double >(m);
593
593
g.head <3 >() *= (2.0 / m);
@@ -661,7 +661,7 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::
661
661
const Eigen::Vector3d Md (M * d); // Md = M*d
662
662
gradient.head <3 >() += Md; // translation gradient
663
663
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;
665
665
const Eigen::Vector3d p_base_src (p_trans_src[0 ], p_trans_src[1 ], p_trans_src[2 ]);
666
666
dCost_dR_T.noalias () += p_base_src * Md.transpose ();
667
667
dCost_dR_T1b += p_base_src[0 ] * M;
@@ -895,7 +895,7 @@ GeneralizedIterativeClosestPoint<PointSource, PointTarget, Scalar>::
895
895
PCL_DEBUG (" [pcl::%s::computeTransformation] Convergence failed\n " ,
896
896
getClassName ().c_str ());
897
897
}
898
- final_transformation_ = previous_transformation_ * guess;
898
+ final_transformation_. noalias () = previous_transformation_ * guess;
899
899
900
900
PCL_DEBUG (" Transformation "
901
901
" 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 %"
0 commit comments