Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions deps/build.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ERROR: LoadError: IOError: could not spawn `julia install.jl`: no such file or directory (ENOENT)
Stacktrace:
[1] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at ./process.jl:401
[2] setup_stdios(::getfield(Base, Symbol("##526#527")){Cmd}, ::Array{Any,1}) at ./process.jl:414
[3] _spawn at ./process.jl:413 [inlined]
[4] #run#536(::Bool, ::typeof(run), ::Cmd) at ./process.jl:727
[5] run(::Cmd) at ./process.jl:726
[6] top-level scope at /home/dussault/.julia/dev/ARCTR/deps/build.jl:1
[7] include at ./boot.jl:328 [inlined]
[8] include_relative(::Module, ::String) at ./loading.jl:1094
[9] include(::Module, ::String) at ./Base.jl:31
[10] include(::String) at ./client.jl:431
[11] top-level scope at none:5
in expression starting at /home/dussault/.julia/dev/ARCTR/deps/build.jl:1
24 changes: 21 additions & 3 deletions src/PreProcess/PreProcessKARC.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
function preprocessKARC(Hop, g, params::Tparams, calls, max_calls)
function preprocessKARC(Hop, g, params::Tparams, calls, max_calls) #where T
τ = params.τ
ζ = params.ζ
nshifts = params.nshifts
shifts = params.shifts

n = length(g)
gNorm2 = BLAS.nrm2(n, g, 1)
precision = max(1e-12,min(0.5,(gNorm2^τ)))
precision = max(1e-12,min(0.5,(gNorm2^ζ)))

#ϵ = sqrt(eps(T)) # * 100.0
ϵ = 1e-12#sqrt(eps()) # * 100.0
cgtol = max(ϵ, min(0.09, 0.01 * norm(g)^(1.0 + ζ)))


(xShift, stats) = cg_lanczos_shift_seq(Hop,
-g,
shifts,
Expand All @@ -16,6 +23,17 @@ function preprocessKARC(Hop, g, params::Tparams, calls, max_calls)
verbose=false,
check_curvature=true)

# (xShift, stats) = cg_lanczos_shift_seq(Hop,
# -g,
# shifts,
# itmax=min(max_calls-sum(calls),2*n),
# #τ = τ,
# atol = cgtol,
# rtol = ϵ,
# verbose=false,
# check_curvature=true)


positives = collect(findfirst(!, stats.flagged):length(stats.flagged))

success = false
Expand All @@ -27,7 +45,7 @@ function preprocessKARC(Hop, g, params::Tparams, calls, max_calls)
Ndirs = map(norm, dirs);

d = g # bidon
return PDataK(d, -1.0, τ, 0 , positives, xShift, shifts, nshifts, Ndirs, true)
return PDataK(d, -1.0, ζ, τ, 0 , positives, xShift, shifts, nshifts, Ndirs, true)
end


Expand Down
7 changes: 4 additions & 3 deletions src/PreProcess/PreProcessKTR.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
export preprocessKTR, decreaseKTR
function preprocessKTR(Hop, g, params::Tparams, calls, max_calls)
τ = params.τ
ζ = params.ζ
#τ = params.τ
nshifts = params.nshifts
shifts = params.shifts

n = length(g)
gNorm2 = BLAS.nrm2(n, g, 1)
precision = max(1e-12,min(0.5,(gNorm2^τ)))
precision = max(1e-12,min(0.5,(gNorm2^ζ)))
(xShift, stats) = cg_lanczos_shift_seq(Hop,
-g,
shifts,
Expand All @@ -29,7 +30,7 @@ function preprocessKTR(Hop, g, params::Tparams, calls, max_calls)

d = g # bidon

return PDataK(d,-1.0,τ,0,positives,xShift,shifts,nshifts,Ndirs,true)
return PDataK(d,-1.0, ζ, 0.0, 0, positives,xShift,shifts,nshifts,Ndirs,true)
end

function decreaseKTR(X :: PDataK, α:: Float64, TR:: TrustRegion)
Expand Down
4 changes: 2 additions & 2 deletions src/PreProcess/PreProcessST_TR.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function preprocessST(H, g, params::TparamsST, n1, n2)
τ = params.τ
ζ = params.ζ

return PDataST(H, g, τ, true)
return PDataST(H, g, ζ, true)
end
9 changes: 5 additions & 4 deletions src/PreProcess/TParamsKARC.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
mutable struct TparamsKARC{T} <: Tparams{T} # specific parameters for this Krylov variant
ζ :: T
τ :: T
shifts :: Array{T, 1}
nshifts :: Int
function TparamsKARC{T}() where T
τ = 0.5
shifts = 10.0.^(collect(-15.0:1.0:15.0))
function TparamsKARC{T}(shifts; τin::T = 1.0, ζin ::T = 0.5) where T
τ = τin # temporary testing
ζ = ζin # inexact Newton
nshifts = size(shifts, 1)
return new{T}(τ, shifts, nshifts)
return new{T}(ζ, τ, shifts, nshifts)
end
end
8 changes: 4 additions & 4 deletions src/PreProcess/TParamsKTR.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export TparamsKTR

mutable struct TparamsKTR{T} <: Tparams{T} # specific parameters for this Krylov variant
τ :: T
ζ :: T
shifts :: Array{T, 1}
nshifts :: Int
function TparamsKTR{T}() where T
τ = 0.5
function TparamsKTR{T}(; ζin ::T = 0.5) where T
ζ = ζin
shifts = [0.0; 10.0.^(collect(-15.0:1.0:15.0))]
nshifts = size(shifts, 1)
return new{T}(τ, shifts, nshifts)
return new{T}(ζ, shifts, nshifts)
end
end
6 changes: 3 additions & 3 deletions src/PreProcess/TParamsST.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export TparamsST

mutable struct TparamsST{T} <: Tparams{T} # specific parameters for this Krylov variant
τ :: T
ζ :: T

function TparamsST{T}() where T
τ = 0.5
return new{T}(τ)
ζ = 0.5
return new{T}(ζ)
end
end
2 changes: 1 addition & 1 deletion src/SolveModel/SolveModelST_TR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function solve_modelST_TR(nlp_stop, X :: PDataST, δ:: T; cgtol :: T = 0.1) wher
# cas particulier Steihaug-Toint
ϵ = sqrt(eps(T)) # * 100.0
n = length(X.g)
cgtol = max(ϵ, min(cgtol, 9 * cgtol / 10, 0.01 * norm(X.g)^(1.0 + X.τ)))
cgtol = max(ϵ, min(cgtol, 9 * cgtol / 10, 0.01 * norm(X.g)^(1.0 + X.ζ)))

(d, cg_stats) = cg(X.H, -X.g, atol = cgtol, rtol = ϵ,
radius = δ, itmax = max(2 * n, 50),
Expand Down
4 changes: 4 additions & 0 deletions src/Solvers/ARCqKOp1.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fname = :ARCqKOp1
shifts = 10.0.^(collect(-15.0:1.0:15.0))
c = Combi(hessian_operator,PDataK,solve_modelKARC,preprocessKARC,decreaseKARC,TparamsKARC(shifts))
include("Template.jl")
3 changes: 3 additions & 0 deletions src/Solvers/ARCqKOp1.jl~
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fname = :ARCqKOp
c = Combi(hessian_operator,PDataK,solve_modelKARC,preprocessKARC,decreaseKARC,TparamsKARC())
include("Template.jl")
1 change: 1 addition & 0 deletions src/Solvers/SolversStopping/ARCqKOp.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export ARCqKOp


function ARCqKOp(nlp :: AbstractNLPModel,
nlpstop :: NLPStopping;
kwargs...
Expand Down
17 changes: 17 additions & 0 deletions src/Solvers/SolversStopping/ARCqKOp0_5.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export ARCqKOp05


function ARCqKOp05(nlp :: AbstractNLPModel,
nlpstop :: NLPStopping;
kwargs...
)

shifts = 10.0.^(collect(-15.0:0.50:15.0))

return TRARC2(nlp,
nlpstop;
TR = TrustRegion(10.0),
c = Combi(hessian_operator, PDataK{eltype(nlp.meta.x0)}, solve_modelKARC, preprocessKARC, decreaseKARC, TparamsKARC{eltype(nlp.meta.x0)}(shifts)),
kwargs...
)
end
16 changes: 16 additions & 0 deletions src/Solvers/SolversStopping/ARCqKOp0_5.jl~
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export ARCqKOp2

shifts = 10.0.^(collect(-15.0:2.0:15.0))

function ARCqKOp2(nlp :: AbstractNLPModel,
nlpstop :: NLPStopping;
kwargs...
)

return TRARC2(nlp,
nlpstop;
TR = TrustRegion(10.0),
c = Combi(hessian_operator, PDataK{eltype(nlp.meta.x0)}, solve_modelKARC, preprocessKARC, decreaseKARC, TparamsKARC{eltype(nlp.meta.x0)}(shifts)),
kwargs...
)
end
19 changes: 19 additions & 0 deletions src/Solvers/SolversStopping/ARCqKOp1.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export ARCqKOp1


function ARCqKOp1(nlp :: AbstractNLPModel,
nlpstop :: NLPStopping;
ζ = 0.5,
τ = 1.0,
kwargs...
)

shifts = 10.0.^(collect(-15.0:1.0:15.0))

return TRARC2(nlp,
nlpstop;
TR = TrustRegion(10.0),
c = Combi(hessian_operator, PDataK{eltype(nlp.meta.x0)}, solve_modelKARC, preprocessKARC, decreaseKARC, TparamsKARC{eltype(nlp.meta.x0)}(shifts, ζin = ζ, τin = τ)),
kwargs...
)
end
16 changes: 16 additions & 0 deletions src/Solvers/SolversStopping/ARCqKOp1.jl~
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export ARCqKOp1

shifts = 10.0.^(collect(-15.0:1.0:15.0))

function ARCqKOp1(nlp :: AbstractNLPModel,
nlpstop :: NLPStopping;
kwargs...
)

return TRARC2(nlp,
nlpstop;
TR = TrustRegion(10.0),
c = Combi(hessian_operator, PDataK{eltype(nlp.meta.x0)}, solve_modelKARC, preprocessKARC, decreaseKARC, TparamsKARC{eltype(nlp.meta.x0)}(shifts)),
kwargs...
)
end
19 changes: 19 additions & 0 deletions src/Solvers/SolversStopping/ARCqKOp1b.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export ARCqKOp1b


function ARCqKOp1b(nlp :: AbstractNLPModel,
nlpstop :: NLPStopping;
ζ = 0.5,
τ = 0.5,
kwargs...
)

shifts = 10.0.^(collect(-15.0:1.0:15.0))

return TRARC2(nlp,
nlpstop;
TR = TrustRegion(10.0),
c = Combi(hessian_operator, PDataK{eltype(nlp.meta.x0)}, solve_modelKARC, preprocessKARC, decreaseKARC, TparamsKARC{eltype(nlp.meta.x0)}(shifts, ζin = ζ, τin = τ)),
kwargs...
)
end
19 changes: 19 additions & 0 deletions src/Solvers/SolversStopping/ARCqKOp1b.jl~
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export ARCqKOp1


function ARCqKOp1(nlp :: AbstractNLPModel,
nlpstop :: NLPStopping;
ζ = 0.5,
τ = 1.0,
kwargs...
)

shifts = 10.0.^(collect(-15.0:1.0:15.0))

return TRARC2(nlp,
nlpstop;
TR = TrustRegion(10.0),
c = Combi(hessian_operator, PDataK{eltype(nlp.meta.x0)}, solve_modelKARC, preprocessKARC, decreaseKARC, TparamsKARC{eltype(nlp.meta.x0)}(shifts, ζin = ζ, τin = τ)),
kwargs...
)
end
17 changes: 17 additions & 0 deletions src/Solvers/SolversStopping/ARCqKOp2.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export ARCqKOp2


function ARCqKOp2(nlp :: AbstractNLPModel,
nlpstop :: NLPStopping;
kwargs...
)

shifts = 10.0.^(collect(-15.0:2.0:15.0))

return TRARC2(nlp,
nlpstop;
TR = TrustRegion(10.0),
c = Combi(hessian_operator, PDataK{eltype(nlp.meta.x0)}, solve_modelKARC, preprocessKARC, decreaseKARC, TparamsKARC{eltype(nlp.meta.x0)}(shifts)),
kwargs...
)
end
16 changes: 16 additions & 0 deletions src/Solvers/SolversStopping/ARCqKOp2.jl~
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export ARCqKOp2

shifts = 10.0.^(collect(-15.0:2.0:15.0))

function ARCqKOp2(nlp :: AbstractNLPModel,
nlpstop :: NLPStopping;
kwargs...
)

return TRARC2(nlp,
nlpstop;
TR = TrustRegion(10.0),
c = Combi(hessian_operator, PDataK{eltype(nlp.meta.x0)}, solve_modelKARC, preprocessKARC, decreaseKARC, TparamsKARC{eltype(nlp.meta.x0)}(shifts)),
kwargs...
)
end
12 changes: 12 additions & 0 deletions src/Solvers/SolversStopping/solvers_stopping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ push!(ALL_solvers_stopping, TRLDLt_abs)
include("ARCqKOp.jl")
push!(ALL_solvers_stopping, ARCqKOp)

include("ARCqKOp1.jl")
push!(ALL_solvers_stopping, ARCqKOp1)

include("ARCqKOp1b.jl")
push!(ALL_solvers_stopping, ARCqKOp1b)

include("ARCqKOp2.jl")
push!(ALL_solvers_stopping, ARCqKOp2)

include("ARCqKOp0_5.jl")
push!(ALL_solvers_stopping, ARCqKOp05)

include("ARCqKSparse.jl")
push!(ALL_solvers_stopping, ARCqKsparse)

Expand Down
3 changes: 3 additions & 0 deletions src/Solvers/solvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ push!(ALL_solvers,eval(fname))
include("ARCqKOp.jl") #works in 0.7/1.1
push!(ALL_solvers,eval(fname))

include("ARCqKOp1.jl") #works in 0.7/1.1
push!(ALL_solvers,eval(fname))


include("ARCqKsparse.jl") #works in 0.7/1.1
push!(ALL_solvers,eval(fname))
Expand Down
Loading