Skip to content

Commit

Permalink
tuning richardson tol (MadNLP#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
sshin23 authored Jan 8, 2025
1 parent b748bed commit 9917706
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/LinearSolvers/backsolve.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@kwdef mutable struct RichardsonOptions <: AbstractOptions
richardson_max_iter::Int = 10
richardson_tol::Float64 = 1e-10
richardson_acceptable_tol::Float64 = 1e-5
richardson_tol::Float64
richardson_acceptable_tol::Float64
end

struct RichardsonIterator{T, KKT <: AbstractKKTSystem{T}} <: AbstractIterator{T}
Expand All @@ -22,7 +22,7 @@ function RichardsonIterator(
)
end

default_options(::Type{RichardsonIterator}) = RichardsonOptions()
default_options(::Type{RichardsonIterator}, tol) = RichardsonOptions(richardson_tol=tol^(5/4), richardson_acceptable_tol=tol^(5/8))

function solve_refine!(
x::VT,
Expand Down
2 changes: 1 addition & 1 deletion src/options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function load_options(nlp; options...)
opt_linear_solver = default_options(opt_ipm.linear_solver)
iterator_options = set_options!(opt_linear_solver, linear_solver_options)
# Initiate iterator options
opt_iterator = default_options(opt_ipm.iterator)
opt_iterator = default_options(opt_ipm.iterator, opt_ipm.tol)
remaining_options = set_options!(opt_iterator, iterator_options)

# Initiate logger
Expand Down

0 comments on commit 9917706

Please sign in to comment.