From 07b238fa1ccbf709ca299ca94bce86f74f85e432 Mon Sep 17 00:00:00 2001 From: Vedant Puri Date: Mon, 27 Mar 2023 14:38:18 -0400 Subject: [PATCH] update_coeffs(L::ADVecProd,...) will recursively call update_coeffs(L.f,...) --- src/differentiation/jaches_products.jl | 4 +++- src/differentiation/vecjac_products.jl | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/differentiation/jaches_products.jl b/src/differentiation/jaches_products.jl index eab3131d..d6c041f6 100644 --- a/src/differentiation/jaches_products.jl +++ b/src/differentiation/jaches_products.jl @@ -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 diff --git a/src/differentiation/vecjac_products.jl b/src/differentiation/vecjac_products.jl index 003e7671..a7921188 100644 --- a/src/differentiation/vecjac_products.jl +++ b/src/differentiation/vecjac_products.jl @@ -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