Skip to content

Commit

Permalink
Merge pull request #236 from vpuri3/patch-2
Browse files Browse the repository at this point in the history
pass kwargs to functionoperator
  • Loading branch information
ChrisRackauckas committed Mar 30, 2023
2 parents 53755d8 + d8a07c6 commit 4e4fc7b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/differentiation/jaches_products.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ function (L::FwdModeAutoDiffVecProd)(dv, v, p, t)
L.vecprod!(dv, L.f, L.u, v, L.cache...)
end

function JacVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff())
function JacVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff(),
kwargs...)

cache, vecprod, vecprod! = if autodiff isa AutoFiniteDiff
cache1 = similar(u)
Expand Down Expand Up @@ -254,10 +255,12 @@ function JacVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoFo
FunctionOperator(L, u, u;
isinplace = isinplace, outofplace = outofplace,
p = p, t = t, islinear = true,
kwargs...,
)
end

function HesVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff())
function HesVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff(),
kwargs...)

cache, vecprod, vecprod! = if autodiff isa AutoFiniteDiff
cache1 = similar(u)
Expand Down Expand Up @@ -296,10 +299,12 @@ function HesVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoFo
FunctionOperator(L, u, u;
isinplace = isinplace, outofplace = outofplace,
p = p, t = t, islinear = true,
kwargs...,
)
end

function HesVecGrad(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff())
function HesVecGrad(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff(),
kwargs...)

cache, vecprod, vecprod! = if autodiff isa AutoFiniteDiff
cache1 = similar(u)
Expand Down Expand Up @@ -329,6 +334,7 @@ function HesVecGrad(f, u::AbstractArray, p = nothing, t = nothing; autodiff = Au
FunctionOperator(L, u, u;
isinplace = isinplace, outofplace = outofplace,
p = p, t = t, islinear = true,
kwargs...,
)
end
#
4 changes: 2 additions & 2 deletions src/differentiation/vecjac_products.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function (L::RevModeAutoDiffVecProd{ad,true,false})(dv, v, p, t) where{ad}
end

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

vecprod, vecprod! = if autodiff isa AutoFiniteDiff
num_vecjac, num_vecjac!
Expand All @@ -113,7 +113,7 @@ function VecJac(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoFi
FunctionOperator(L, u, u;
isinplace = isinplace, outofplace = outofplace,
p = p, t = t, islinear = true,
ishermitian = ishermitian, opnorm = opnorm,
kwargs...
)
end
#

0 comments on commit 4e4fc7b

Please sign in to comment.