Skip to content

Commit 45f0306

Browse files
authored
Fix only_fghv! and add some aliases. (#130)
1 parent 8affba4 commit 45f0306

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/objective_types/incomplete.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ struct InplaceObjective{DF, FDF, FGH, Hv, FGHv}
1414
fghv::FGHv
1515
end
1616
InplaceObjective(;df=nothing, fdf=nothing, fgh=nothing, hv=nothing, fghv=nothing) = InplaceObjective(df, fdf, fgh, hv, fghv)
17-
const InPlaceObjectiveFGH = InplaceObjective{<:Nothing, <:Nothing, <:Any, <:Any, <:Any}
17+
const InPlaceObjectiveFGH = InplaceObjective{<:Nothing, <:Nothing, <:Any, <:Nothing, <: Nothing}
18+
const InPlaceObjectiveFG_Hv = InplaceObjective{<:Nothing, <:Any, <:Nothing, <:Any, <:Nothing}
19+
const InPlaceObjectiveFGHv = InplaceObjective{<:Nothing, <:Nothing, <:Nothing, <:Any, <:Any}
1820
struct NotInplaceObjective{DF, FDF, FGH}
1921
df::DF
2022
fdf::FDF
@@ -42,13 +44,16 @@ fdf(t::Union{InplaceObjective, NotInplaceObjective}) = t.fdf
4244
make_f(t::InplaceObjective, x, F::Real) = x -> fdf(t)(F, nothing, x)
4345
make_f(t::InplaceObjective, x, F) = (F, x) -> fdf(t)(F, nothing, x)
4446
make_f(t::InPlaceObjectiveFGH, x, F::Real) = x -> t.fgh(F, nothing, nothing, x)
47+
make_f(t::InPlaceObjectiveFGHv, x, F::Real) = x -> t.fghv(F, nothing, nothing, x, nothing)
4548

4649

4750
make_df(t::InplaceObjective, x, F) = (DF, x) -> fdf(t)(nothing, DF, x)
4851
make_df(t::InPlaceObjectiveFGH, x, F) = (DF, x) -> t.fgh(nothing, DF, nothing, x)
52+
make_df(t::InPlaceObjectiveFGHv, x, F) = (DF, x) -> t.fghv(nothing, DF, nothing, x, nothing)
4953

5054
make_fdf(t::InplaceObjective, x, F::Real) = (G, x) -> fdf(t)(F, G, x)
5155
make_fdf(t::InPlaceObjectiveFGH, x, F::Real) = (G, x) -> t.fgh(F, G, nothing, x)
56+
make_fdf(t::InPlaceObjectiveFGHv, x, F::Real) = (G, x) -> t.fghv(F, G, nothing, x, nothing)
5257
make_fdf(t::InplaceObjective, x, F) = fdf(t)
5358

5459
# Non-mutating version

0 commit comments

Comments
 (0)