vgvassilev / clad

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

A reverse block is never ended in RMV::VisitConditionalStatement #928

Closed PetroZarytskyi closed 3 months ago

PetroZarytskyi commented 3 months ago

This PR fixed a bug when a reverse block was never ended in RMV::VisitConditionalStatement. This is the root cause of the problem mentioned in #922. Fixes #922.

github-actions[bot] commented 3 months ago

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

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 94.08%. Comparing base (1e88e75) to head (9d88afa).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/vgvassilev/clad/pull/928/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/928?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 #928 +/- ## ========================================== - Coverage 94.08% 94.08% -0.01% ========================================== Files 53 53 Lines 7762 7761 -1 ========================================== - Hits 7303 7302 -1 Misses 459 459 ``` | [Files](https://app.codecov.io/gh/vgvassilev/clad/pull/928?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/ReverseModeVisitor.cpp](https://app.codecov.io/gh/vgvassilev/clad/pull/928?src=pr&el=tree&filepath=lib%2FDifferentiator%2FReverseModeVisitor.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vassil+Vassilev#diff-bGliL0RpZmZlcmVudGlhdG9yL1JldmVyc2VNb2RlVmlzaXRvci5jcHA=) | `97.16% <100.00%> (-0.01%)` | :arrow_down: | | [Files](https://app.codecov.io/gh/vgvassilev/clad/pull/928?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/ReverseModeVisitor.cpp](https://app.codecov.io/gh/vgvassilev/clad/pull/928?src=pr&el=tree&filepath=lib%2FDifferentiator%2FReverseModeVisitor.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Vassil+Vassilev#diff-bGliL0RpZmZlcmVudGlhdG9yL1JldmVyc2VNb2RlVmlzaXRvci5jcHA=) | `97.16% <100.00%> (-0.01%)` | :arrow_down: |
github-actions[bot] commented 3 months ago

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

github-actions[bot] commented 3 months ago

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

PetroZarytskyi commented 3 months ago

@vaithak I just ran the example and it works:

Clad diff:
1
1
0
Num diff:
1
1
0
github-actions[bot] commented 3 months ago

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