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

Add support for std::vector in function arguments #750

Open
vaithak opened this issue Feb 8, 2024 · 1 comment
Open

Add support for std::vector in function arguments #750

vaithak opened this issue Feb 8, 2024 · 1 comment

Comments

@vaithak
Copy link
Collaborator

vaithak commented Feb 8, 2024

Example program which fails currently:

#include "clad/Differentiator/Differentiator.h"
#include <vector>
#include <iostream>

double f (std::vector<double> arr) {
  return arr[0] * arr[1];
}

int main () {
  auto f_dx = clad::differentiate(f, "arr[0]");
  std::vector<double> arr {1,2,3};
  std::cout << f_dx.execute(arr) << std::endl;
  return 0;
}

And similarly for reverse mode.

@wymux
Copy link

wymux commented Feb 9, 2024

Where would be the starting point for adding support for vectors?

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

No branches or pull requests

2 participants