vgvassilev / clad

clad -- automatic differentiation for C/C++
GNU Lesser General Public License v3.0
266 stars 113 forks source link

Add support for the logical not operator in for-loop `cond`s (forward mode) #920

Closed gojakuch closed 1 month ago

gojakuch commented 1 month ago

This commit adds support for logical negation operators with side-effects inside for-loop conditions in the forward mode.

Fixes: #911

github-actions[bot] commented 1 month ago

clang-tidy review says "All clean, LGTM! :+1:"

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.07%. Comparing base (9579ce4) to head (f9d0fdd).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/vgvassilev/clad/pull/920/graphs/tree.svg?width=650&height=150&src=pr&token=9f6Q4em8hE&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vassil+Vassilev)](https://app.codecov.io/gh/vgvassilev/clad/pull/920?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vassil+Vassilev) ```diff @@ Coverage Diff @@ ## master #920 +/- ## ======================================= Coverage 94.07% 94.07% ======================================= Files 53 53 Lines 7747 7751 +4 ======================================= + Hits 7288 7292 +4 Misses 459 459 ``` | [Files](https://app.codecov.io/gh/vgvassilev/clad/pull/920?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vassil+Vassilev) | Coverage Δ | | |---|---|---| | [lib/Differentiator/BaseForwardModeVisitor.cpp](https://app.codecov.io/gh/vgvassilev/clad/pull/920?src=pr&el=tree&filepath=lib%2FDifferentiator%2FBaseForwardModeVisitor.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vassil+Vassilev#diff-bGliL0RpZmZlcmVudGlhdG9yL0Jhc2VGb3J3YXJkTW9kZVZpc2l0b3IuY3Bw) | `98.93% <100.00%> (+<0.01%)` | :arrow_up: | | [Files](https://app.codecov.io/gh/vgvassilev/clad/pull/920?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vassil+Vassilev) | Coverage Δ | | |---|---|---| | [lib/Differentiator/BaseForwardModeVisitor.cpp](https://app.codecov.io/gh/vgvassilev/clad/pull/920?src=pr&el=tree&filepath=lib%2FDifferentiator%2FBaseForwardModeVisitor.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vassil+Vassilev#diff-bGliL0RpZmZlcmVudGlhdG9yL0Jhc2VGb3J3YXJkTW9kZVZpc2l0b3IuY3Bw) | `98.93% <100.00%> (+<0.01%)` | :arrow_up: |
gojakuch commented 1 month ago

if anything, this PR adds some changes that I first implemented in #905 and then reverted, since it was too far of a stretch for a single PR