Skip to content

Commit

Permalink
error handling for missing jacobian
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Palafox committed Oct 13, 2023
1 parent b76df14 commit b59676d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/autodiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ function _solve_jacobian_θ(problem, solution, θ; active_tolerance = 1e-3)
(; jacobian_z!, jacobian_θ!, lower_bounds, upper_bounds) = problem
z_star = solution.z

!isnothing(jacobian_θ!) || throw(ArgumentError("Missing sensitivities. Set `compute_sensitivities = true` when constructing the ParametricMCP."))

inactive_indices = let
lower_inactive = z_star .>= (lower_bounds .+ active_tolerance)
upper_inactive = z_star .<= (upper_bounds .- active_tolerance)
Expand Down

0 comments on commit b59676d

Please sign in to comment.