This is so so cool, Madeleine. Thank you for sharing. I'm a huge fan of DCP, ever since I took a convex optimization course here at the UW (which of course featured cvx and Boyd's book) and seeing this in Julia makes me smile. -E
On Wed, Feb 4, 2015 at 5:53 PM, Madeleine Udell <[email protected]> wrote: > Convex.jl <https://github.com/JuliaOpt/Convex.jl> is a Julia library for > mathematical programming that makes it easy to formulate and fast to solve > nonlinear convex optimization problems. Convex.jl > <https://github.com/JuliaOpt/Convex.jl> is a member of the JuliaOpt > <https://github.com/JuliaOpt> umbrella group and can use (nearly) any > solver that complies with the MathProgBase interface, including Mosek > <https://github.com/JuliaOpt/Mosek.jl>, Gurobi > <https://github.com/JuliaOpt/gurobi.jl>, ECOS > <https://github.com/JuliaOpt/ECOS.jl>, SCS > <https://github.com/JuliaOpt/SCS.jl>, and GLPK > <https://github.com/JuliaOpt/GLPK.jl>. > > Here's a quick example of code that solves a non-negative least-squares > problem. > > using Convex > > # Generate random problem data > m = 4; n = 5 > A = randn(m, n); b = randn(m, 1) > > # Create a (column vector) variable of size n x 1. > x = Variable(n) > > # The problem is to minimize ||Ax - b||^2 subject to x >= 0 > problem = minimize(sum_squares(A * x + b), [x >= 0]) > > solve!(problem) > > We could instead solve a robust approximation problem by replacing > sum_squares(A > * x + b) by sum(norm(A * x + b, 1)) or sum(huber(A * x + b)); it's that > easy. > > Convex.jl <https://github.com/JuliaOpt/Convex.jl> is different from JuMP > <https://github.com/JuliaOpt/JuMP.jl> in that it allows (and prioritizes) > linear algebraic and functional constructions in objectives and constraints > (like max(x,y) < A*z). Under the hood, it converts problems to a standard > conic form, which requires (and certifies) that the problem is convex, and > guarantees global optimality of the resulting solution. >
