diff --git a/src/SolveModel/SolveModelKARC.jl b/src/SolveModel/SolveModelKARC.jl index ce29759..6c29351 100644 --- a/src/SolveModel/SolveModelKARC.jl +++ b/src/SolveModel/SolveModelKARC.jl @@ -1,4 +1,12 @@ -function solve_model!(X::PDataKARC{S, T, Fatol, Frtol}, H, g, gNorm2, calls, max_calls, α::T) where {S, T, Fatol, Frtol} +function solve_model!( + X::PDataKARC{S, T, Fatol, Frtol}, + H, + g, + gNorm2, + calls, + max_calls, + α::T, +) where {S, T, Fatol, Frtol} # target value should be close to satisfy αλ=||d|| start = findfirst(X.positives) if isnothing(start) diff --git a/src/SolveModel/SolveModelNLSST_TR.jl b/src/SolveModel/SolveModelNLSST_TR.jl index a416cbd..d3dc62f 100644 --- a/src/SolveModel/SolveModelNLSST_TR.jl +++ b/src/SolveModel/SolveModelNLSST_TR.jl @@ -1,4 +1,12 @@ -function solve_model!(PData::PDataNLSST{S, T, Fatol, Frtol}, Jx, Fx, norm_∇f, calls, max_calls, δ::T) where {S, T, Fatol, Frtol} +function solve_model!( + PData::PDataNLSST{S, T, Fatol, Frtol}, + Jx, + Fx, + norm_∇f, + calls, + max_calls, + δ::T, +) where {S, T, Fatol, Frtol} # cas particulier Steihaug-Toint # ϵ = sqrt(eps(T)) # * 100.0 # old # cgtol = max(ϵ, min(cgtol, 9 * cgtol / 10, 0.01 * norm(g)^(1.0 + PData.ζ))) # old diff --git a/src/SolveModel/SolveModelST_TR.jl b/src/SolveModel/SolveModelST_TR.jl index 7b89bb2..eeef858 100644 --- a/src/SolveModel/SolveModelST_TR.jl +++ b/src/SolveModel/SolveModelST_TR.jl @@ -1,4 +1,12 @@ -function solve_model!(PData::PDataST{S, T, Fatol, Frtol}, H, g, gNorm2, calls, max_calls, δ::T) where {S, T, Fatol, Frtol} +function solve_model!( + PData::PDataST{S, T, Fatol, Frtol}, + H, + g, + gNorm2, + calls, + max_calls, + δ::T, +) where {S, T, Fatol, Frtol} # cas particulier Steihaug-Toint # ϵ = sqrt(eps(T)) # * 100.0 # old # cgtol = max(ϵ, min(cgtol, 9 * cgtol / 10, 0.01 * norm(g)^(1.0 + PData.ζ))) # old diff --git a/src/SolveModel/SolveModelTRK.jl b/src/SolveModel/SolveModelTRK.jl index 4d6906d..c469e1d 100644 --- a/src/SolveModel/SolveModelTRK.jl +++ b/src/SolveModel/SolveModelTRK.jl @@ -1,4 +1,12 @@ -function solve_model!(X::PDataTRK{S, T, Fatol, Frtol}, H, g, gNorm2, calls, max_calls, α::T) where {S, T, Fatol, Frtol} +function solve_model!( + X::PDataTRK{S, T, Fatol, Frtol}, + H, + g, + gNorm2, + calls, + max_calls, + α::T, +) where {S, T, Fatol, Frtol} # target value should be close to satisfy α=||d|| start = findfirst(X.positives) if isnothing(start) diff --git a/src/solvers.jl b/src/solvers.jl index e2c1afa..794c1f8 100644 --- a/src/solvers.jl +++ b/src/solvers.jl @@ -1,12 +1,8 @@ const solvers_const = Dict( - :ARCqKdense => - (HessDense, PDataKARC, [(:shifts => 10.0 .^ (collect(-20.0:1.0:20.0)))]), - :ARCqKOp => - (HessOp, PDataKARC, [:shifts => 10.0 .^ (collect(-20.0:1.0:20.0))]), - :ARCqKsparse => - (HessSparse, PDataKARC, [:shifts => 10.0 .^ (collect(-20.0:1.0:20.0))]), - :ARCqKCOO => - (HessSparseCOO, PDataKARC, [:shifts => 10.0 .^ (collect(-20.0:1.0:20.0))]), + :ARCqKdense => (HessDense, PDataKARC, [(:shifts => 10.0 .^ (collect(-20.0:1.0:20.0)))]), + :ARCqKOp => (HessOp, PDataKARC, [:shifts => 10.0 .^ (collect(-20.0:1.0:20.0))]), + :ARCqKsparse => (HessSparse, PDataKARC, [:shifts => 10.0 .^ (collect(-20.0:1.0:20.0))]), + :ARCqKCOO => (HessSparseCOO, PDataKARC, [:shifts => 10.0 .^ (collect(-20.0:1.0:20.0))]), :ST_TRdense => (HessDense, PDataST, ()), :ST_TROp => (HessOp, PDataST, ()), :ST_TRsparse => (HessSparse, PDataST, ()), @@ -16,15 +12,9 @@ const solvers_const = Dict( ) const solvers_nls_const = Dict( - :ARCqKOpGN => ( - HessGaussNewtonOp, - PDataKARC, - [:shifts => 10.0 .^ (collect(-10.0:0.5:20.0))], - ), + :ARCqKOpGN => (HessGaussNewtonOp, PDataKARC, [:shifts => 10.0 .^ (collect(-10.0:0.5:20.0))]), :ST_TROpGN => (HessGaussNewtonOp, PDataST, ()), - :ST_TROpGNLSCgls => - (HessGaussNewtonOp, PDataNLSST, [:solver_method => :cgls]), - :ST_TROpGNLSLsqr => - (HessGaussNewtonOp, PDataNLSST, [:solver_method => :lsqr]), + :ST_TROpGNLSCgls => (HessGaussNewtonOp, PDataNLSST, [:solver_method => :cgls]), + :ST_TROpGNLSLsqr => (HessGaussNewtonOp, PDataNLSST, [:solver_method => :lsqr]), :ST_TROpLS => (HessOp, PDataNLSST, ()), )