-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[math] remove implicit conversions to/from KahanSum #11941
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
[math] remove implicit conversions to/from KahanSum #11941
Conversation
|
Starting build on |
|
Very nice, thanks a lot! This always annoyed me too |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Ah, I know what the problem is there (I commented that line out in my local build, that's why it didn't fail for me). I'll fix the commit up later. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
ad15050 to
441bee5
Compare
|
Starting build on |
|
Rebased on #11940 branch (it was more convenient to leave it based on that after all, I tried taking the commit out, but it needed too many changes) and fixed the build error. |
guitargeek
left a comment
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.
Thanks again for doing this!
|
Build failed on ROOT-ubuntu18.04/nortcxxmod. Errors:
Warnings:
And 73 more |
441bee5 to
abf72d6
Compare
|
Starting build on |
|
Together with @guitargeek, we found and fixed (in commit abf72d6) a bug in RooNLLVarNew, accidentally proving the usefulness of this PR 😄 |
abf72d6 to
5111af4
Compare
|
Starting build on |
|
The last rebase doesn't change any contents, just made it consistent with the branch in #11940. Still need to wait for CI. |
|
Build failed on ROOT-ubuntu18.04/nortcxxmod. Errors:
Warnings:
And 281 more |
|
Build failed on ROOT-debian10-i386/soversion. Errors:
Warnings:
And 175 more |
|
Ok, roottest has some failures too. I'll see whether I can fix those too. |
|
Build failed on mac12/noimt. Errors:
Warnings:
And 210 more |
|
Build failed on mac11/cxx14. Errors:
Warnings:
And 125 more |
|
Build failed on ROOT-ubuntu2004/python3. Errors:
Warnings:
And 286 more |
KahanSum objects will no longer be implicitly converted to their underlying type after root-project/root#11941. This commit explicitly converts them.
|
I fixed roottest, see root-project/roottest#928. I think after that this can be merged. |
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Errors:
Warnings:
And 269 more |
The auto-conversion to type T and implicit type T constructor in KahanSum make it hard to debug KahanSum, because it is easy to overlook implicit conversions in code, especially in lines where the type of the return value is `auto`. This commit removes them and where they were necessary replaces them with an explicit construction or explicit conversion to double via Sum().
The boolean flag accidentally got replaced in a previous commit.
5111af4 to
e975104
Compare
|
Starting build on |
KahanSum objects will no longer be implicitly converted to their underlying type after root-project/root#11941. This commit explicitly converts them.
KahanSum objects will no longer be implicitly converted to their underlying type after root-project/root#11941. This commit explicitly converts them.
|
@phsft-bot build |
|
Starting build on |
|
The roottest fixes were merged, so now CI should pass here. Also rebased on master, so the previous KahanSum PR commits are now gone from this PR. After CI passes, this can be merged. |
|
Build failed on ROOT-ubuntu18.04/nortcxxmod. Warnings:
And 298 more Failing tests:
|
|
Build failed on mac12/noimt. Warnings:
And 53 more Failing tests:
|
|
Build failed on mac11/cxx14. Errors:
Warnings:
And 54 more Failing tests:
And 8 more |
|
Build failed on ROOT-ubuntu2004/python3. Warnings:
And 54 more Failing tests:
|
|
Build failed on windows10/cxx14. Failing tests: |
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Errors:
Warnings:
And 130 more Failing tests:
And 10 more |
This Pull request:
Follow-up on #11940;
please merge that one before this oneit has been merged, so this one can also be merged.Changes or fixes:
The auto-conversion to type
Tand implicit typeTconstructor inKahanSummake it hard to debugKahanSum, because it is easy to overlook implicit conversions in code, especially in lines where the type of the return value isauto. The second commit in this PR (the first commit is the same as that in #11940) removes them and where they were necessary replaces them with an explicit construction or explicit conversion to double viaSum()Checklist: