I’m using COSMO.jl as a solver from Convex.jl. I’m solving tseveral ‘related problems’ over and over again, which correspond to more precise versions of each others.
I’d like to use the COSMO.jl warm starting features (see there):
Convex so far only supports warmstarting primal variables, unfortunately. Try passing warmstart=true to solve!. The values are set automatically after the previous solve, or you can set them by hand with set_value!. I have not tried with COSMO, let us know how it goes
using Convex, COSMO
function solve_from_(y0=nothing)
y = Variable(3)
x = [1,2,3]
if !isnothing(y0)
set_value!(y,y0)
end
p = minimize(Convex.norm(y - x,2) + Convex.norm(y,1))
solve!(p, () -> COSMO.Optimizer(verbose=true),warmstart=true)
return vec(Convex.evaluate(y))
end
y0 = solve_from_()
solve_from_(y0)
I setted the verbose parameter so we see that COSMO started from the same point both times.