Skip to content
A Julia package for disciplined convex programming
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Update example (#278) Mar 22, 2019
examples updated struct and type parameter syntax to julia 0.6 (#221) Jan 15, 2018
src Allow calling `fix!` twice in a row (#299) Jun 15, 2019
test Allow calling `fix!` twice in a row (#299) Jun 15, 2019
.gitignore Add a Project file, remove vestigial Pkg uses (#269) Jan 18, 2019
.travis.yml Clean up .travis.yml May 8, 2019
CITATION.bib Create CITATION.bib (#283) May 5, 2019
LICENSE.md Change CVX->Convex.jl Sep 24, 2014
Project.toml
README.md add v0.6 badge Jun 21, 2017

README.md

Convex.jl

Build Status Coverage Status

Convex Convex Convex

Convex.jl is a Julia package for Disciplined Convex Programming. Convex.jl can solve linear programs, mixed-integer linear programs, and DCP-compliant convex programs using a variety of solvers, including Mosek, Gurobi, ECOS, SCS, and GLPK, through the MathProgBase interface. It also supports optimization with complex variables and coefficients.

Installation: julia> Pkg.add("Convex")

  • Detailed documentation and examples for Convex.jl (stable | latest).
  • If you're running into bugs or have feature requests, please use the Github Issue Tracker.
  • For usage questions, please contact us via Discourse.

Quick Example

To run this example, first install Convex and at least one solver, such as SCS:

Pkg.add("Convex")
Pkg.add("SCS")

Now let's solve a least-squares problem with inequality constraints.

# Let us first make the Convex.jl module available
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
# This can be done by: minimize(objective, constraints)
problem = minimize(sumsquares(A * x - b), [x >= 0])

# Solve the problem by calling solve!
solve!(problem)

# Check the status of the problem
problem.status # :Optimal, :Infeasible, :Unbounded etc.

# Get the optimal value
problem.optval

More Examples

A number of examples can be found here. The basic usage notebook gives a simple tutorial on problems that can be solved using Convex.jl. Many use cases of the package in complex-domain optimization can be found here.

Citing this package

If you use Convex.jl for published work, we encourage you to cite the software using the following BibTeX citation:

@article{convexjl,
 title = {Convex Optimization in {J}ulia},
 author ={Udell, Madeleine and Mohan, Karanveer and Zeng, David and Hong, Jenny and Diamond, Steven and Boyd, Stephen},
 year = {2014},
 journal = {SC14 Workshop on High Performance Technical Computing in Dynamic Languages},
 archivePrefix = "arXiv",
 eprint = {1410.4821},
 primaryClass = "math-oc",
}

Convex.jl was previously called CVX.jl.

You can’t perform that action at this time.