Skip to content

Commit

Permalink
options: Always provide a valid value for tol
Browse files Browse the repository at this point in the history
  • Loading branch information
tmmsartor committed Jul 23, 2024
1 parent 14ba574 commit 3bcae13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MadNLP_C.jl
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ end
function set_option(s::Ptr{MadnlpCSolver}, name::String, value::Any)
s_jl::MadnlpCSolver = unsafe_pointer_to_objref(s)
if name == "tol"
if value < 0 value = 0.0 end
if value <= 1e-15 value = 1e-15 end
s_jl.tol = Float64(value)
elseif name == "print_level"
if value > 5 value = 5 end
Expand Down Expand Up @@ -317,7 +317,7 @@ Base.@ccallable function madnlp_c_create(nlp_interface::Ptr{MadnlpCInterface})::
# Create the solver object
solver = MadnlpCSolver()
solver.nlp_interface = unsafe_load(nlp_interface)
solver.tol = 0.0
solver.tol = 1e-8
solver.linear_solver = "mumps"
solver.linear_solver_c = Base.unsafe_convert(Ptr{Int8}, solver.linear_solver)
solver.max_iter = 3000
Expand Down

0 comments on commit 3bcae13

Please sign in to comment.