Skip to content

Commit

Permalink
Merge pull request #9 from andreasnoack/an/big
Browse files Browse the repository at this point in the history
Initialize gradient in HessianResult to avoid undef errors when
  • Loading branch information
andreasnoack authored Dec 3, 2019
2 parents 8d12336 + e4ed5ab commit a6bd31b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DiffResults.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Note that `HessianResult` allocates its own storage; `x` is only used for type a
shape information. If you want to allocate storage yourself, use the `DiffResult`
constructor instead.
"""
HessianResult(x::AbstractArray) = DiffResult(first(x), similar(x), similar(x, length(x), length(x)))
HessianResult(x::AbstractArray) = DiffResult(first(x), zeros(length(x)), similar(x, length(x), length(x)))
HessianResult(x::StaticArray) = DiffResult(first(x), x, zeros(StaticArrays.similar_type(typeof(x), Size(length(x),length(x)))))

#############
Expand Down

0 comments on commit a6bd31b

Please sign in to comment.