Skip to content

Commit

Permalink
fix scope of covarianceFiniteDiff Σ
Browse files Browse the repository at this point in the history
  • Loading branch information
Affie committed Oct 13, 2023
1 parent 752dc27 commit 2188482
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/parametric/services/ParametricManopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,13 @@ function covarianceFiniteDiff(M, jacF!::JacF_RLM!, p0)
H = FiniteDiff.finite_difference_hessian(costf, X0)

# inv(H)
try
Σ = Matrix(H) \ Matrix{eltype(H)}(I, size(H)...)
catch ex #TODO only catch correct exception and try with pinv as fallback in certain cases.
@warn "Hessian inverse failed" ex
# Σ = pinv(H)
Σ = nothing
end
Σ = try
Matrix(H) \ Matrix{eltype(H)}(I, size(H)...)
catch ex #TODO only catch correct exception and try with pinv as fallback in certain cases.
@warn "Hessian inverse failed" ex

Check warning on line 303 in src/parametric/services/ParametricManopt.jl

View check run for this annotation

Codecov / codecov/patch

src/parametric/services/ParametricManopt.jl#L303

Added line #L303 was not covered by tests
# Σ = pinv(H)
nothing
end
return Σ
end

Expand Down

0 comments on commit 2188482

Please sign in to comment.