Skip to content

Commit

Permalink
fix TwiceDifferentiablef, df, fdf, h, x) constructor (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkofod committed Jan 8, 2018
1 parent 0e9eb36 commit 16b3ab3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/objective_types/twicedifferentiable.jl
Expand Up @@ -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),
Expand All @@ -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

0 comments on commit 16b3ab3

Please sign in to comment.