Skip to content

Commit

Permalink
first draft of forward AD
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Dec 12, 2023
1 parent eca69b0 commit 3ae2226
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions inst/include/etr_new/Derivs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ inline auto walk(T& v,
TimesDeriv, TimesDerivTrait, QuarternaryTrait> {
auto lDeriv = walk(v.l, varDerivs);
auto rDeriv = walk(v.r, varDerivs);
/*
Assume v.l and v.r are of type Buffer.
Than lDeriv and rDeriv are of type Vec<Buffer>.
Thus, l, r, lDeriv and rDeriv are objects which exists.
Here, it is possible to use pointers to them instead of copying.
Do I have to copy v.l if it is of type Operation?
*/
MatrixParameter mp; defineMatrix(v.l, v.r, mp);
return QuaternaryOperation<decltype(v.l), decltype(v.r),
decltype(lDeriv.d), decltype(rDeriv.d),
Expand Down

0 comments on commit 3ae2226

Please sign in to comment.