Skip to content

Commit

Permalink
Support precompilation of callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
lassepe committed Apr 16, 2024
1 parent d3c2e97 commit 8794e95
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/parametric_problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function ParametricMCP(
lower_bounds::Vector,
upper_bounds::Vector;
compute_sensitivities = true,
compile_callbacks = true,
) where {T<:Union{FD.Node,Symbolics.Num}}
problem_size = Internals.check_dimensions(f_symbolic, z_symbolic, lower_bounds, upper_bounds)

Expand Down Expand Up @@ -118,7 +119,7 @@ function ParametricMCP(
end

parameter_dimension = length(θ_symbolic)
ParametricMCP(
mcp = ParametricMCP(
f!,
jacobian_z!,
jacobian_θ!,
Expand All @@ -127,6 +128,12 @@ function ParametricMCP(
parameter_dimension,
problem_size,
)

if compile_callbacks
compile_callbacks(mcp)
end

mcp
end

"""
Expand Down

0 comments on commit 8794e95

Please sign in to comment.