1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-14 14:15:28 +01:00

correctly overload solve

we indicate also that the use our own solve methods
This commit is contained in:
kalmarek 2018-09-06 22:48:14 +02:00
parent a1eccf8b73
commit edb4e70228
2 changed files with 5 additions and 5 deletions

View File

@ -68,7 +68,7 @@ function computeλandP(::Type{Naive}, Δ::GroupRingElem, sett::Settings, ws=noth
JuMP.setsolver(SDP_problem, sett.solver)
info(Base.repr(SDP_problem))
@time λ, P, ws = solve_logged(SDP_problem, varλ, varP, ws, solverlog=solverlog)
@time λ, P, ws = PropertyT.solve(solverlog, SDP_problem, varλ, varP, ws)
return λ, P, ws
end
@ -93,7 +93,7 @@ function computeλandP(::Type{Symmetrize}, Δ::GroupRingElem, sett::Settings, ws
JuMP.setsolver(SDP_problem, sett.solver)
info(Base.repr(SDP_problem))
@time λ, P, ws = solve_logged(SDP_problem, varλ, varP, ws, solverlog=solverlog)
@time λ, P, ws = PropertyT.solve(solverlog, SDP_problem, varλ, varP, ws)
fname = filename(fullpath(sett), :P)
save(joinpath(dirname(fname), "orig_"*basename(fname)), "origP", P)

View File

@ -146,7 +146,7 @@ end
###############################################################################
using MathProgBase
function solve(m::JuMP.Model, varλ::JuMP.Variable, varP; warmstart=nothing)
function solve(m::JuMP.Model, varλ::JuMP.Variable, varP, warmstart=nothing)
traits = JuMP.ProblemTraits(m, relaxation=false)
@ -172,11 +172,11 @@ function solve(m::JuMP.Model, varλ::JuMP.Variable, varP; warmstart=nothing)
return λ, P, warmstart
end
function solve_logged(model::JuMP.Model, varλ::JuMP.Variable, varP, warmstart=nothing; solverlog::String=tempname()*".log")
function solve(solverlog::String, model::JuMP.Model, varλ::JuMP.Variable, varP, warmstart=nothing)
function f()
Base.Libc.flush_cstdio()
λ, P, ws = PropertyT.solve(model, varλ, varP, warmstart=warmstart)
λ, P, ws = PropertyT.solve(model, varλ, varP, warmstart)
Base.Libc.flush_cstdio()
return λ, P, ws
end