Skip to content

Commit

Permalink
Format objectives.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
pkofod committed Dec 4, 2024
1 parent 892e7ef commit a780fca
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/objectives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ struct ScalarObjective{Tf,Tg,Tfg,Tfgh,Th,Thv,Tbf,P}
param::P
end
ScalarObjective(;
f = nothing,
g = nothing,
fg = nothing,
fgh = nothing,
h = nothing,
hv = nothing,
batched_f = nothing,
param = nothing,
) = ScalarObjective(f, g, fg, fgh, h, hv, batched_f, param)
f = nothing,
g = nothing,
fg = nothing,
fgh = nothing,
h = nothing,
hv = nothing,
batched_f = nothing,
param = nothing,
) = ScalarObjective(f, g, fg, fgh, h, hv, batched_f, param)
has_param(so::ScalarObjective) = so.param === nothing ? false : true
function value(so::ScalarObjective, x)
if has_param(so)
Expand Down Expand Up @@ -118,7 +118,8 @@ struct VectorObjective{TF,TJ,TFJ,TJv}
FJ::TFJ
Jv::TJv
end
VectorObjective(; F=nothing, J=nothing, FJ=nothing, Jv=nothing) = VectorObjective(F, J, FJ, Jv)
VectorObjective(; F = nothing, J = nothing, FJ = nothing, Jv = nothing) =
VectorObjective(F, J, FJ, Jv)

## If prob is a NEqProblem, then we can just dispatch to least squares MeritObjective
# if fast JacVec exists then maybe even line searches that updates the gradient can be used???
Expand Down

0 comments on commit a780fca

Please sign in to comment.