Skip to content

Commit

Permalink
Fix bug in gradient initialization of HessianResult
Browse files Browse the repository at this point in the history
Use testsets
  • Loading branch information
andreasnoack committed Dec 5, 2019
1 parent b999272 commit 7f5e649
Show file tree
Hide file tree
Showing 2 changed files with 279 additions and 276 deletions.
2 changes: 1 addition & 1 deletion src/DiffResults.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,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), zeros(length(x)), similar(x, length(x), length(x)))
HessianResult(x::AbstractArray) = DiffResult(first(x), zeros(size(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
Loading

0 comments on commit 7f5e649

Please sign in to comment.