@@ -171,7 +171,29 @@ function FunctionOperator(op,
171171 )
172172end
173173
174+ function update_coefficients (L, u, p, t)
175+ op = update_coefficients (L. op, u, p, t)
176+ op_adjoint = update_coefficients (L. op_adjoint, u, p, t)
177+ op_inverse = update_coefficients (L. op_inverse, u, p, t)
178+ op_adjoint_inverse = update_coefficients (L. op_adjoint_inverse, u, p, t)
179+
180+ FunctionOperator (op,
181+ op_adjoint,
182+ op_inverse,
183+ op_adjoint_inverse,
184+ L. traits,
185+ p,
186+ t,
187+ L. cache
188+ )
189+ end
190+
174191function update_coefficients! (L:: FunctionOperator , u, p, t)
192+ ops = getops (L)
193+ for op in ops
194+ update_coefficients! (op, u, p, t)
195+ end
196+
175197 L. p = p
176198 L. t = t
177199
@@ -273,7 +295,18 @@ LinearAlgebra.issymmetric(L::FunctionOperator) = L.traits.issymmetric
273295LinearAlgebra. ishermitian (L:: FunctionOperator ) = L. traits. ishermitian
274296LinearAlgebra. isposdef (L:: FunctionOperator ) = L. traits. isposdef
275297
276- getops (:: FunctionOperator ) = ()
298+ function getops (L:: FunctionOperator )
299+ ops = (L. op,)
300+
301+ ops = isa (L. op_adjoint, Nothing) ? ops : (ops... , L. op_adjoint)
302+ ops = isa (L. op_inverse, Nothing) ? ops : (ops... , L. op_inverse)
303+ ops = isa (L. op_adjoint_inverse, Nothing) ? ops : (ops... , L. op_adjoint_inverse)
304+
305+ ops
306+ end
307+
308+ # TODO - isconstant(L::FunctionOperator)
309+ iscached (:: FunctionOperator ) = true
277310islinear (L:: FunctionOperator ) = L. traits. islinear
278311has_adjoint (L:: FunctionOperator ) = ! (L. op_adjoint isa Nothing)
279312has_mul (L:: FunctionOperator{iip} ) where {iip} = true
0 commit comments