-
Notifications
You must be signed in to change notification settings - Fork 189
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
Remove zeros after LtsCoefficients arithmetic #6308
Conversation
{ | ||
auto write = a.begin(); | ||
for (const auto& entry : a) { | ||
if (get<2>(entry) != 0.0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to think that these numbers might be approximately zero to the level we don't care about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, these aren't exact. This should have a roundoff check of some sort.
fixup LGTM. Please squash. I should've said you can squash directly on this :) |
Avoids multiplying large objects by zero later.
Already worked, but not obviously from the implementation.
I almost did, but decided since the change I made was nowhere near the PR comment it was better to make it obvious. |
Proposed changes
Remove zeros after LtsCoefficients arithmetic. These are the coefficients in a linear combination of Variables objects, so avoiding terms with zero coefficients is a worthwhile minor optimization.
Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments