Skip to content
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

Support multiple indices in clad::gradient calls #1029

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

PetroZarytskyi
Copy link
Collaborator

Currently, the user can provide a string as the second argument of clad::gradient to specify independent parameters as a list of comma-separated names. This PR allows users to specify indices alongside with names. e.g.

clad::gradient(fn, "0");
clad::gradient(fn, "1, z");
...

Previously, it was possible to provide a single index as an integer literal. e.g.

clad::gradient(fn, 0);

Fixes #46.

@PetroZarytskyi PetroZarytskyi force-pushed the issue-46 branch 3 times, most recently from 432e478 to 29b3883 Compare August 5, 2024 15:10
Copy link
Contributor

github-actions bot commented Aug 5, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.12%. Comparing base (7cec7c8) to head (0f4fae0).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1029      +/-   ##
==========================================
+ Coverage   94.10%   94.12%   +0.01%     
==========================================
  Files          55       55              
  Lines        8225     8234       +9     
==========================================
+ Hits         7740     7750      +10     
+ Misses        485      484       -1     
Files Coverage Δ
lib/Differentiator/DiffPlanner.cpp 98.74% <100.00%> (+0.02%) ⬆️

... and 1 file with indirect coverage changes

Files Coverage Δ
lib/Differentiator/DiffPlanner.cpp 98.74% <100.00%> (+0.02%) ⬆️

... and 1 file with indirect coverage changes

Currently, the user can provide a string as the second argument of ``clad::gradient`` to specify independent parameters as a list of comma-separated names. This commit allows users to specify indices alongside with names. e.g.
```
clad::gradient(fn, "0");
clad::gradient(fn, "1, z");
...
```
Previously, it was possible to provide a single index as an integer literal. e.g.
```
clad::gradient(fn, 0);
```
Fixes vgvassilev#46.
Copy link
Contributor

github-actions bot commented Aug 5, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Owner

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

LGTM!

@vgvassilev vgvassilev merged commit a907492 into vgvassilev:master Aug 5, 2024
89 checks passed
@PetroZarytskyi PetroZarytskyi deleted the issue-46 branch August 5, 2024 20:45
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.

Add an option to specify independent variables for gradients
2 participants