Skip to content

[4-mom] Small improvements to 4-momenta calculation#141

Open
pdigiglio wants to merge 1 commit intoyap:masterfrom
pdigiglio:4-mom
Open

[4-mom] Small improvements to 4-momenta calculation#141
pdigiglio wants to merge 1 commit intoyap:masterfrom
pdigiglio:4-mom

Conversation

@pdigiglio
Copy link
Contributor

I slightly simplified the calculate_four_momenta() function. I think it's easier to read and (probably) faster now.

pp[i][j] = pow(initial_mass, 2) + (n_fsp - 2.) * m2_sum_1 - m2_sum_2;
for (unsigned i = 0; i < n_fsp; ++i) {
// Find element that are smaller than zero in the upper triangle of the matrix.
const auto it = std::find_if(std::begin(pp[i]) + i + 1, std::end(pp[i]),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually wrong. It will only assign to the first negative element for each value of i. Still, all the tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant