Replies: 1 comment
-
|
If your wrapped vector type support all the operations required by SimpleVector ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Is there a recommended way to calculate derivatives, while the AD Independent variables are owned by multiple numerical objects and not from just one AD vector?
Problem
Currently, the
CppAD::Independentaccepts onlyAD<>variables (hereinax), given that the internal use ofADTape<Base>::Independentaccesses directlyax[i].member_datawithout encapsulated methods. That restricts us from recording operations on vectors of reference_wrapper, smart pointers, etc.Example
I will try to demonstrate an example of 2 "numerical" objects
Object1andObject2instantiated in functionad_from_references.Ideally, I would expect
AD<>instances on the calculation objectsAD<>Independent variables in avector<reference_wrapper<AD<double>>> ax_ror similar memory management containerObject1andObject2using directly theAD<>dataADFunInstead, at the moment I achieve the that by
vector<AD<double>> axreference_wrapper<AD<double>>to the calculation objects via a sort of index tracking mechanismreference_wrapper.get()I may be missing something here, but the last 2 steps would imply that the consumer libraries need to create quite some infrastructure to fully adopt CppAD.
Beta Was this translation helpful? Give feedback.
All reactions