algorithmsbooks / optimization

Errata for Algorithms for Optimization book
67 stars 16 forks source link

Alg. 4.4: Convex.jl API change #15

Closed rbalexan closed 4 years ago

rbalexan commented 4 years ago

I am using Julia 1.4 with ] status for Convex.jl as [f65535da] Convex v0.13.3

I tried to code up and run Algorithm 4.4 as written in the second printing, but it throws an argument error for the solve! function. Apparently the Convex.jl API changed in a recent version. From ? solve!, both methods of solve! now require an optimizer:

# 2 methods for generic function "solve!":
  [1] solve!(problem::Problem{T}, optimizer::MathOptInterface.ModelLike; check_vexity, verbose, warmstart) where T in Convex at /Users/rba/.julia/packages/Convex/v9Ehz/src/solution.jl:204
  [2] solve!(problem::Problem{T}, optimizer; kwargs...) where T in Convex at /Users/rba/.julia/packages/Convex/v9Ehz/src/solution.jl:192

They have updated the syntax to solve!(p, solver) according to this commit. The suggested solver interface using SCS.jl is given in Convex.jl's news.

I changed the following in Algorithm 4.4 and everything seems to work as expected.

mykelk commented 4 years ago

Thanks! @tawheeler should we try to track this API change? It seems like it would be a good idea, but I'd like your input. We don't have too many dependencies, so it shouldn't be too hard.

tawheeler commented 4 years ago

We don't have that many dependencies and it is well worth keeping this up-to-date where we can.

tawheeler commented 4 years ago

FWIW I know this issue exists and will eventually address it

tawheeler commented 4 years ago

Fixed!