Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit 4e4fc7b

Browse files
Merge pull request #236 from vpuri3/patch-2
pass kwargs to functionoperator
2 parents 53755d8 + d8a07c6 commit 4e4fc7b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/differentiation/jaches_products.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ function (L::FwdModeAutoDiffVecProd)(dv, v, p, t)
223223
L.vecprod!(dv, L.f, L.u, v, L.cache...)
224224
end
225225

226-
function JacVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff())
226+
function JacVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff(),
227+
kwargs...)
227228

228229
cache, vecprod, vecprod! = if autodiff isa AutoFiniteDiff
229230
cache1 = similar(u)
@@ -254,10 +255,12 @@ function JacVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoFo
254255
FunctionOperator(L, u, u;
255256
isinplace = isinplace, outofplace = outofplace,
256257
p = p, t = t, islinear = true,
258+
kwargs...,
257259
)
258260
end
259261

260-
function HesVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff())
262+
function HesVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff(),
263+
kwargs...)
261264

262265
cache, vecprod, vecprod! = if autodiff isa AutoFiniteDiff
263266
cache1 = similar(u)
@@ -296,10 +299,12 @@ function HesVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoFo
296299
FunctionOperator(L, u, u;
297300
isinplace = isinplace, outofplace = outofplace,
298301
p = p, t = t, islinear = true,
302+
kwargs...,
299303
)
300304
end
301305

302-
function HesVecGrad(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff())
306+
function HesVecGrad(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff(),
307+
kwargs...)
303308

304309
cache, vecprod, vecprod! = if autodiff isa AutoFiniteDiff
305310
cache1 = similar(u)
@@ -329,6 +334,7 @@ function HesVecGrad(f, u::AbstractArray, p = nothing, t = nothing; autodiff = Au
329334
FunctionOperator(L, u, u;
330335
isinplace = isinplace, outofplace = outofplace,
331336
p = p, t = t, islinear = true,
337+
kwargs...,
332338
)
333339
end
334340
#

src/differentiation/vecjac_products.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function (L::RevModeAutoDiffVecProd{ad,true,false})(dv, v, p, t) where{ad}
8888
end
8989

9090
function VecJac(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoFiniteDiff(),
91-
ishermitian = false, opnrom = true)
91+
kwargs...)
9292

9393
vecprod, vecprod! = if autodiff isa AutoFiniteDiff
9494
num_vecjac, num_vecjac!
@@ -113,7 +113,7 @@ function VecJac(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoFi
113113
FunctionOperator(L, u, u;
114114
isinplace = isinplace, outofplace = outofplace,
115115
p = p, t = t, islinear = true,
116-
ishermitian = ishermitian, opnorm = opnorm,
116+
kwargs...
117117
)
118118
end
119119
#

0 commit comments

Comments
 (0)