-
Notifications
You must be signed in to change notification settings - Fork 119
/
index.html
43 lines (37 loc) · 16.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html><HTML lang="en"><head><meta charset="UTF-8"/><meta content="width=device-width, initial-scale=1.0" name="viewport"/><title>Home · Convex.jl</title><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script data-main="assets/documenter.js" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" data-theme-name="documenter-dark" data-theme-primary-dark="" href="assets/themes/documenter-dark.css" rel="stylesheet" type="text/css"/><link class="docs-theme-link" data-theme-name="documenter-light" data-theme-primary="" href="assets/themes/documenter-light.css" rel="stylesheet" type="text/css"/><script src="assets/themeswap.js"></script><script data-outdated-warner="">function maybeAddWarning () {
const head = document.getElementsByTagName('head')[0];
// Add a noindex meta tag (unless one exists) so that search engines don't index this version of the docs.
if (document.body.querySelector('meta[name="robots"]') === null) {
const meta = document.createElement('meta');
meta.name = 'robots';
meta.content = 'noindex';
head.appendChild(meta);
};
// Add a stylesheet to avoid inline styling
const style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode('.outdated-warning-overlay { position: fixed; top: 0; left: 0; right: 0; box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); z-index: 999; background-color: #ffaba7; color: rgba(0, 0, 0, 0.7); border-bottom: 3px solid #da0b00; padding: 10px 35px; text-align: center; font-size: 15px; } .outdated-warning-overlay .outdated-warning-closer { position: absolute; top: calc(50% - 10px); right: 18px; cursor: pointer; width: 12px; } .outdated-warning-overlay a { color: #2e63b8; } .outdated-warning-overlay a:hover { color: #363636; }'));
head.appendChild(style);
const div = document.createElement('div');
div.classList.add('outdated-warning-overlay');
const closer = document.createElement('div');
closer.classList.add('outdated-warning-closer');
// Icon by font-awesome (license: https://fontawesome.com/license, link: https://fontawesome.com/icons/times?style=solid)
closer.innerHTML = '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="times" class="svg-inline--fa fa-times fa-w-11" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>';
closer.addEventListener('click', function () {
document.body.removeChild(div);
});
let href = '/stable';
if (window.documenterBaseURL) {
href = window.documenterBaseURL + '/../stable';
}
div.innerHTML = 'This documentation is not for the latest version. <br> <a href="' + href + '">Go to the latest documentation</a>.';
div.appendChild(closer);
document.body.appendChild(div);
};
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', maybeAddWarning);
} else {
maybeAddWarning();
};
</script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit">Convex.jl</span></div><form action="search/" class="docs-search"><input class="docs-search-query" id="documenter-search-query" name="q" placeholder="Search docs" type="text"/></form><ul class="docs-menu"><li class="is-active"><a class="tocitem" href="">Home</a><ul class="internal"><li><a class="tocitem" href="#Extended-formulations-and-the-DCP-ruleset"><span>Extended formulations and the DCP ruleset</span></a></li></ul></li><li><a class="tocitem" href="installation/">Installation</a></li><li><a class="tocitem" href="quick_tutorial/">Quick Tutorial</a></li><li><a class="tocitem" href="types/">Basic Types</a></li><li><a class="tocitem" href="operations/">Supported Operations</a></li><li><a class="tocitem" href="complex-domain_optimization/">Complex-domain Optimization</a></li><li><a class="tocitem" href="solvers/">Solvers</a></li><li><a class="tocitem" href="faq/">FAQ</a></li><li><a class="tocitem" href="advanced/">Advanced</a></li><li><a class="tocitem" href="problem_depot/">Problem Depot</a></li><li><a class="tocitem" href="contributing/">Contributing</a></li><li><a class="tocitem" href="credits/">Credits</a></li><li><a class="tocitem" href="reference/">Reference</a></li><li><span class="tocitem">Examples</span><ul><li><input class="collapse-toggle" id="menuitem-14-1" type="checkbox"/><label class="tocitem" for="menuitem-14-1"><span class="docs-label">General examples</span><i class="docs-chevron"></i></label><ul class="collapsed"><li><a class="tocitem" href="examples/general_examples/DCP_analysis/">DCP analysis</a></li><li><a class="tocitem" href="examples/general_examples/basic_usage/">Basic Usage</a></li><li><a class="tocitem" href="examples/general_examples/chebyshev_center/">Chebyshev center</a></li><li><a class="tocitem" href="examples/general_examples/control/">Control</a></li><li><a class="tocitem" href="examples/general_examples/huber_regression/">Huber regression</a></li><li><a class="tocitem" href="examples/general_examples/lasso_regression/">Lasso, Ridge and Elastic Net Regressions</a></li><li><a class="tocitem" href="examples/general_examples/logistic_regression/">Logistic regression</a></li><li><a class="tocitem" href="examples/general_examples/max_entropy/">Entropy Maximization</a></li><li><a class="tocitem" href="examples/general_examples/optimal_advertising/">Optimal advertising</a></li><li><a class="tocitem" href="examples/general_examples/robust_approx_fitting/">Robust approximate fitting</a></li><li><a class="tocitem" href="examples/general_examples/svm/">Support vector machine</a></li><li><a class="tocitem" href="examples/general_examples/svm_l1regularization/">SVM with L^1 regularization</a></li><li><a class="tocitem" href="examples/general_examples/trade_off_curves/">Trade-off curves</a></li><li><a class="tocitem" href="examples/general_examples/worst_case_analysis/">Worst case risk analysis</a></li></ul></li><li><input class="collapse-toggle" id="menuitem-14-2" type="checkbox"/><label class="tocitem" for="menuitem-14-2"><span class="docs-label">Mixed integer</span><i class="docs-chevron"></i></label><ul class="collapsed"><li><a class="tocitem" href="examples/mixed_integer/binary_knapsack/">Binary (or 0-1) knapsack problem</a></li><li><a class="tocitem" href="examples/mixed_integer/n_queens/">N queens</a></li><li><a class="tocitem" href="examples/mixed_integer/section_allocation/">Section Allocation</a></li></ul></li><li><input class="collapse-toggle" id="menuitem-14-3" type="checkbox"/><label class="tocitem" for="menuitem-14-3"><span class="docs-label">Optimization with complex variables</span><i class="docs-chevron"></i></label><ul class="collapsed"><li><a class="tocitem" href="examples/optimization_with_complex_variables/Fidelity in Quantum Information Theory/">Fidelity in quantum information theory</a></li><li><a class="tocitem" href="examples/optimization_with_complex_variables/phase_recovery_using_MaxCut/">Phase recovery using MaxCut</a></li><li><a class="tocitem" href="examples/optimization_with_complex_variables/povm_simulation/">POVM simulation</a></li><li><a class="tocitem" href="examples/optimization_with_complex_variables/power_flow_optimization/">Power flow optimization</a></li></ul></li><li><input class="collapse-toggle" id="menuitem-14-4" type="checkbox"/><label class="tocitem" for="menuitem-14-4"><span class="docs-label">Portfolio optimization</span><i class="docs-chevron"></i></label><ul class="collapsed"><li><a class="tocitem" href="examples/portfolio_optimization/portfolio_optimization/">Portfolio Optimization</a></li><li><a class="tocitem" href="examples/portfolio_optimization/portfolio_optimization2/">Portfolio Optimization - Markowitz Efficient Frontier</a></li></ul></li><li><input class="collapse-toggle" id="menuitem-14-5" type="checkbox"/><label class="tocitem" for="menuitem-14-5"><span class="docs-label">Supplemental material</span><i class="docs-chevron"></i></label><ul class="collapsed"><li><a class="tocitem" href="examples/supplemental_material/Convex.jl_intro_ISMP2015/">Convex Optimization in Julia</a></li><li><a class="tocitem" href="examples/supplemental_material/paper_examples/">Paper examples</a></li></ul></li><li><input class="collapse-toggle" id="menuitem-14-6" type="checkbox"/><label class="tocitem" for="menuitem-14-6"><span class="docs-label">Time series</span><i class="docs-chevron"></i></label><ul class="collapsed"><li><a class="tocitem" href="examples/time_series/time_series/">Time Series Analysis</a></li></ul></li><li><input class="collapse-toggle" id="menuitem-14-7" type="checkbox"/><label class="tocitem" for="menuitem-14-7"><span class="docs-label">Tomography</span><i class="docs-chevron"></i></label><ul class="collapsed"><li><a class="tocitem" href="examples/tomography/tomography/">Tomography</a></li></ul></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="">Home</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="">Home</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/jump-dev/Convex.jl/blob/master/docs/src/index.md#L" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" href="#" id="documenter-settings-button" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" href="#" id="documenter-sidebar-button"></a></div></header><article class="content" id="documenter-page"><h1 id="Convex.jl-Convex-Optimization-in-Julia"><a class="docs-heading-anchor" href="#Convex.jl-Convex-Optimization-in-Julia">Convex.jl - Convex Optimization in Julia</a><a id="Convex.jl-Convex-Optimization-in-Julia-1"></a><a class="docs-heading-anchor-permalink" href="#Convex.jl-Convex-Optimization-in-Julia" title="Permalink"></a></h1><p>Convex.jl is a Julia package for <a href="http://dcp.stanford.edu/">Disciplined Convex Programming</a> (DCP). Convex.jl makes it easy to describe optimization problems in a natural, mathematical syntax, and to solve those problems using a variety of different (commercial and open-source) solvers. Convex.jl can solve</p><ul><li>linear programs</li><li>mixed-integer linear programs and mixed-integer second-order cone programs</li><li>dcp-compliant convex programs including<ul><li>second-order cone programs (SOCP)</li><li>exponential cone programs</li><li>semidefinite programs (SDP)</li></ul></li></ul><p>Convex.jl supports many solvers, including <a href="https://github.com/oxfordcontrol/COSMO.jl">COSMO</a>, <a href="https://github.com/JuliaOpt/Mosek.jl">Mosek</a>, <a href="https://github.com/JuliaOpt/gurobi.jl">Gurobi</a>, <a href="https://github.com/JuliaOpt/ECOS.jl">ECOS</a>, <a href="https://github.com/karanveerm/SCS.jl">SCS</a> and <a href="https://github.com/JuliaOpt/GLPK.jl">GLPK</a>, through <a href="https://github.com/JuliaOpt/MathOptInterface.jl">MathOptInterface</a>.</p><p>Note that Convex.jl was previously called CVX.jl. This package is under active development; we welcome bug reports and feature requests. For usage questions, please contact us via the <a href="https://discourse.julialang.org/c/domain/opt">Julia Discourse</a>.</p><h2 id="Extended-formulations-and-the-DCP-ruleset"><a class="docs-heading-anchor" href="#Extended-formulations-and-the-DCP-ruleset">Extended formulations and the DCP ruleset</a><a id="Extended-formulations-and-the-DCP-ruleset-1"></a><a class="docs-heading-anchor-permalink" href="#Extended-formulations-and-the-DCP-ruleset" title="Permalink"></a></h2><p>Convex.jl works by transforming the problem—which possibly has nonsmooth, nonlinear constructions like the nuclear norm, the log determinant, and so forth—into a linear optimization problem subject to conic constraints. This reformulation often involves adding auxiliary variables, and is called an "extended formulation", since the original problem has been extended with additional variables. These formulations rely on the problem being modelled by combining Convex.jl's "atoms" or primitives according to certain rules which ensure convexity, called the <a href="http://cvxr.com/cvx/doc/dcp.html">disciplined convex programming (DCP) ruleset</a>. If these atoms are combined in a way that does not ensure convexity, the extended formulations are often invalid. As a simple example, consider the problem</p><pre><code class="language-julia">minimize( abs(x), x >= 1, x <= 2)</code></pre><p>Obviously, the optimum occurs at <code>x=1</code>, but let us imagine we want to solve this problem via Convex.jl using a linear programming (LP) solver. Since <code>abs</code> is a nonlinear function, we need to reformulate the problem to pass it to the LP solver. We do this by introducing an auxiliary variable <code>t</code> and instead solving</p><pre><code class="language-julia">minimize(t, x >= 1, x <= 2, t >= x, t >= -x)</code></pre><p>That is, we add the constraints <code>t >= x</code> and <code>t >= -x</code>, and replace <code>abs(x)</code> by <code>t</code>. Since we are minimizing over <code>t</code> and the smallest possible <code>t</code> satisfying these constraints is the absolute value of <code>x</code>, we get the right answer. That is, this reformulation worked because we were minimizing <code>abs(x)</code>, and that is a valid way to use the primitive <code>abs</code>.</p><p>If we were maximizing <code>abs</code>, Convex.jl would print</p><blockquote><p>Warning: Problem not DCP compliant: objective is not DCP</p></blockquote><p>Why? Well, let us consider the same reformulation for a maximization problem. The original problem is now</p><pre><code class="language-julia">maximize( abs(x), x >= 1, x <= 2)</code></pre><p>and trivially the optimum is 2, obtained at <code>x=2</code>. If we do the same replacements as above, however, we arrive at the problem</p><pre><code class="language-julia">maximize(t, x >= 1, x <= 2, t >= x, t >= -x)</code></pre><p>whose solution is infinity. In other words, we got the wrong answer by using the reformulation, since the extended formulation was only valid for a minimization problem. Convex.jl always performs these reformulations, but they are only guaranteed to be valid when the DCP ruleset is followed. Therefore, Convex.jl programatically checks the whether or not these rules were satisfied and warns if they were not. One should not take these DCP warnings lightly!</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="installation/">Installation »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label></p><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div><p></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Thursday 20 May 2021 14:47">Thursday 20 May 2021</span>. Using Julia version 1.0.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></HTML>