Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved uninitialized value warning in PixelTrackFitting #33881

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ namespace riemannFit {
// scale
const double tempQ = mc.squaredNorm();
const double tempS = sqrt(n * 1. / tempQ); // scaling factor
p3D *= tempS;
p3D.block(0, 0, 2, n) *= tempS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was the older code running, BTW?
If I understood the warning correctly, was there supposed to be a crash here before this fix?

Copy link
Contributor Author

@ericcano ericcano May 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Older code was running fine.
It was not supposed to crash. We simply scaled uninitialized values in place in the last row of the matrix just to overwrite them on the next statement. It was totally harmless (besides wasting n multiplications, and being the last compilation warning to clear).


// project on paraboloid
p3D.row(2) = p3D.block(0, 0, 2, n).colwise().squaredNorm();
Expand Down