diff --git a/src/objective_types/twicedifferentiable.jl b/src/objective_types/twicedifferentiable.jl index bdd229d..67a20fe 100644 --- a/src/objective_types/twicedifferentiable.jl +++ b/src/objective_types/twicedifferentiable.jl @@ -16,7 +16,7 @@ mutable struct TwiceDifferentiable{T,TDF,TH,TX} <: AbstractObjective end iscomplex(obj::TwiceDifferentiable) = false # compatibility with old constructor -function TwiceDifferentiable(f, g!, fg!, h!, x::TX, F::T, G::TG = similar(x), H::TH = alloc_H(x)) where {T, TG, TH, TX} +function TwiceDifferentiable(f, g!, fg!, h!, x::TX, F::T = real(zero(eltype(x))), G::TG = similar(x), H::TH = alloc_H(x)) where {T, TG, TH, TX} x_f, x_df, x_h = x_of_nans(x), x_of_nans(x), x_of_nans(x) TwiceDifferentiable{T,TG, TH, TX}(f, g!, fg!, h!, copy(F), similar(G), copy(H), @@ -27,4 +27,4 @@ end function TwiceDifferentiable(f, g!, h!, x::AbstractVector, F = real(zero(eltype(x))), G = similar(x), H = alloc_H(x)) fg! = make_fdf(x, F, f, g!) return TwiceDifferentiable(f, g!, fg!, h!, x, F, G, H) -end +end \ No newline at end of file