Skip to content

Commit

Permalink
🤖 Format .jl files (#109)
Browse files Browse the repository at this point in the history
Co-authored-by: tmigot <tmigot@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and tmigot authored Jan 26, 2024
1 parent ccbff0f commit 8e130b7
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 21 deletions.
10 changes: 9 additions & 1 deletion src/SolveModel/SolveModelKARC.jl
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
10 changes: 9 additions & 1 deletion src/SolveModel/SolveModelNLSST_TR.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 9 additions & 1 deletion src/SolveModel/SolveModelST_TR.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 9 additions & 1 deletion src/SolveModel/SolveModelTRK.jl
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
24 changes: 7 additions & 17 deletions src/solvers.jl
Original file line number Diff line number Diff line change
@@ -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, ()),
Expand All @@ -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, ()),
)

0 comments on commit 8e130b7

Please sign in to comment.