Skip to content

Commit

Permalink
update_coeffs(L::ADVecProd,...) will recursively call update_coeffs(L…
Browse files Browse the repository at this point in the history
….f,...)
  • Loading branch information
vpuri3 committed Mar 27, 2023
1 parent f191085 commit 07b238f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/differentiation/jaches_products.jl
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,12 @@ struct FwdModeAutoDiffVecProd{F,U,C,V,V!} <: AbstractAutoDiffVecProd
end

function update_coefficients(L::FwdModeAutoDiffVecProd, u, p, t)
FwdModeAutoDiffVecProd(L.f, u, L.vecprod, L.vecprod!, L.cache)
f = update_coefficients(L.f, u, p, t)
FwdModeAutoDiffVecProd(f, u, L.vecprod, L.vecprod!, L.cache)
end

function update_coefficients!(L::FwdModeAutoDiffVecProd, u, p, t)
update_coefficients!(L.f, u, p, t)
copy!(L.u, u)
L
end
Expand Down
4 changes: 3 additions & 1 deletion src/differentiation/vecjac_products.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ struct RevModeAutoDiffVecProd{ad,iip,oop,F,U,C,V,V!} <: AbstractAutoDiffVecProd
end

function update_coefficients(L::RevModeAutoDiffVecProd, u, p, t)
RevModeAutoDiffVecProd(L.f, u, L.vecprod, L.vecprod!, L.cache)
f = update_coefficients(L.f, u, p, t)
RevModeAutoDiffVecProd(f, u, L.vecprod, L.vecprod!, L.cache)
end

function update_coefficients!(L::RevModeAutoDiffVecProd, u, p, t)
update_coefficients!(L.f, u, p, t)
copy!(L.u, u)
L
end
Expand Down

0 comments on commit 07b238f

Please sign in to comment.