/
index.html
2 lines (2 loc) · 14.9 KB
/
index.html
1
2
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Utilities · Polyhedra</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><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/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link href="../assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><h1>Polyhedra</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" id="search-form" action="../search/"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li><a class="toctext" href="../">Index</a></li><li><a class="toctext" href="../installation/">Installation</a></li><li><a class="toctext" href="../representation/">Representation</a></li><li><a class="toctext" href="../polyhedron/">Polyhedron</a></li><li><a class="toctext" href="../plot/">Plot</a></li><li><a class="toctext" href="../redundancy/">Containment/Redundancy</a></li><li><a class="toctext" href="../projection/">Projection/Elimination</a></li><li><a class="toctext" href="../optimization/">Optimization</a></li><li class="current"><a class="toctext" href>Utilities</a><ul class="internal"><li><a class="toctext" href="#Operations-1">Operations</a></li><li><a class="toctext" href="#Volume-1">Volume</a></li><li><a class="toctext" href="#Chebyshev-center-1">Chebyshev center</a></li><li><a class="toctext" href="#Defining-new-representation-1">Defining new representation</a></li></ul></li></ul></nav><article id="docs"><header><nav><ul><li><a href>Utilities</a></li></ul><a class="edit-page" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/master/docs/src/utilities.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>Utilities</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="Utilities-1" href="#Utilities-1">Utilities</a></h1><h2><a class="nav-anchor" id="Operations-1" href="#Operations-1">Operations</a></h2><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Base.:*" href="#Base.:*"><code>Base.:*</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">*(p1::Rep, p2::Rep)</code></pre><p>Cartesian product between the polyhedra <code>p1</code> and <code>p2</code>.</p></div></div><div><div><pre><code class="language-none">*(P::Union{AbstractMatrix, UniformScaling}, p::VRep)</code></pre><p>Transform the polyhedron represented by <span>$p$</span> into <span>$P p$</span> by transforming each element of the V-representation (points, symmetric points, rays and lines) <code>x</code> into <span>$P x$</span>.</p></div></div><div><div><pre><code class="language-none">*(α::Number, p::Rep)</code></pre><p>Transform the polyhedron represented by <span>$p$</span> into <span>$\alpha p$</span> by transforming each element of the V-representation (points, symmetric points, rays and lines) <code>x</code> into <span>$\alpha x$</span>.</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Base.:\\" href="#Base.:\\"><code>Base.:\</code></a> — <span class="docstring-category">Function</span>.</div><div><div><p>(P::Union{AbstractMatrix, UniformScaling}, p::HRep)</p><p>Transform the polyhedron represented by <span>$p$</span> into <span>$P^{-1} p$</span> by transforming each halfspace <span>$\langle a, x \rangle \le \beta$</span> into <span>$\langle P^\top a, x \rangle \le \beta$</span> and each hyperplane <span>$\langle a, x \rangle = \beta$</span> into <span>$\langle P^\top a, x \rangle = \beta$</span>.</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Base.:/" href="#Base.:/"><code>Base.:/</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">/(p::HRep, P::Union{AbstractMatrix, UniformScaling})</code></pre><p>Transform the polyhedron represented by <span>$p$</span> into <span>$P^{-T} p$</span> by transforming each halfspace <span>$\langle a, x \rangle \le \beta$</span> into <span>$\langle P a, x \rangle \le \beta$</span> and each hyperplane <span>$\langle a, x \rangle = \beta$</span> into <span>$\langle P a, x \rangle = \beta$</span>.</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Base.intersect" href="#Base.intersect"><code>Base.intersect</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">intersect(P1::HRep, P2::HRep)</code></pre><p>Takes the intersection of <code>P1</code> and <code>P2</code> <span>$\{\, x : x \in P_1, x \in P_2 \,\}$</span>. It is very efficient between two H-representations or between two polyhedron for which the H-representation has already been computed. However, if <code>P1</code> (resp. <code>P2</code>) is a polyhedron for which the H-representation has not been computed yet, it will trigger a representation conversion which is costly. See the <a href="http://www.cs.mcgill.ca/~fukuda/soft/polyfaq/node25.html">Polyhedral Computation FAQ</a> for a discussion on this operation.</p><p>The type of the result will be chosen closer to the type of <code>P1</code>. For instance, if <code>P1</code> is a polyhedron (resp. H-representation) and <code>P2</code> is a H-representation (resp. polyhedron), <code>intersect(P1, P2)</code> will be a polyhedron (resp. H-representation). If <code>P1</code> and <code>P2</code> are both polyhedra (resp. H-representation), the resulting polyhedron type (resp. H-representation type) will be computed according to the type of <code>P1</code>. The coefficient type however, will be promoted as required taking both the coefficient type of <code>P1</code> and <code>P2</code> into account.</p></div></div><div><div><pre><code class="language-none">intersect(v::VRepresentation{T}, h::HRepElement)</code></pre><p>Compute the intersection of <code>v</code> with an halfspace or hyperplane <code>h</code>. The method used by default is to keep the V-representation element of <code>v</code> that are in <code>h</code> and add new ones generated as the intersection between the hyperplane defining <code>h</code> and the segment between two adjacent V-representation elements of <code>v</code> that are in either sides of the hyperplane. See Lemma 3 of [FP96] for more detail on the method.</p><p>[FP96] Fukuda, K. and Prodon, A. <strong>Double description method revisited</strong> <em>Combinatorics and computer science</em>, <em>Springer</em>, <strong>1996</strong>, 91-111</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Base.intersect!" href="#Base.intersect!"><code>Base.intersect!</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">intersect!(p::HRep, h::Union{HRepresentation, HRepElement})</code></pre><p>Same as <a href="#Base.intersect"><code>intersect</code></a> except that <code>p</code> is modified to be equal to the intersection.</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Polyhedra.convexhull" href="#Polyhedra.convexhull"><code>Polyhedra.convexhull</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">convexhull(P1::VRep, P2::VRep)</code></pre><p>Takes the convex hull of <code>P1</code> and <code>P2</code> <span>$\{\, \lambda x + (1-\lambda) y : x \in P_1, y \in P_2 \,\}$</span>. It is very efficient between two V-representations or between two polyhedron for which the V-representation has already been computed. However, if <code>P1</code> (resp. <code>P2</code>) is a polyhedron for which the V-representation has not been computed yet, it will trigger a representation conversion which is costly.</p><p>The type of the result will be chosen closer to the type of <code>P1</code>. For instance, if <code>P1</code> is a polyhedron (resp. V-representation) and <code>P2</code> is a V-representation (resp. polyhedron), <code>convexhull(P1, P2)</code> will be a polyhedron (resp. V-representation). If <code>P1</code> and <code>P2</code> are both polyhedra (resp. V-representation), the resulting polyhedron type (resp. V-representation type) will be computed according to the type of <code>P1</code>. The coefficient type however, will be promoted as required taking both the coefficient type of <code>P1</code> and <code>P2</code> into account.</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Polyhedra.convexhull!" href="#Polyhedra.convexhull!"><code>Polyhedra.convexhull!</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">convexhull!(p1::VRep, p2::VRep)</code></pre><p>Same as <a href="#Polyhedra.convexhull"><code>convexhull</code></a> except that <code>p1</code> is modified to be equal to the convex hull.</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Polyhedra.translate" href="#Polyhedra.translate"><code>Polyhedra.translate</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">translate(p::Polyhedra.Rep, v::AbstractVector)</code></pre><p>Computes translation of the polyhedron <code>p</code> with the vector <code>v</code>. That is, computes</p><div>\[\{\, x + v \mid x \in p \,\}.\]</div><p>By default, if the H-representation, it simply translates every hyperplanes and halfspace, otherwise, it translates every points of the V-representation. That is, this operation can be achieved both in the H-representation and V-representation hence does not trigger any representation conversion.</p></div></div></section><h2><a class="nav-anchor" id="Volume-1" href="#Volume-1">Volume</a></h2><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Polyhedra.volume" href="#Polyhedra.volume"><code>Polyhedra.volume</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">volume(p::Polyhedron{T}) where {T}</code></pre><p>Returns the <code>fulldim(p)</code>-dimensional hyper-volume of the polyhedron <code>p</code>. Returns <code>Inf</code> or <code>-one(T)</code> if it is infinite depending on whether the type <code>T</code> has an infinite value.</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Polyhedra.surface" href="#Polyhedra.surface"><code>Polyhedra.surface</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">surface(p::Polyhedron{T}) where {T}</code></pre><p>Returns the <code>fulldim(p)-1</code>-dimensional hyper-volume of the surface of the polyhedron <code>p</code>. Returns <code>Inf</code> or <code>-one(T)</code> if it is infinite depending on whether the type <code>T</code> has an infinite value.</p></div></div></section><h2><a class="nav-anchor" id="Chebyshev-center-1" href="#Chebyshev-center-1">Chebyshev center</a></h2><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Polyhedra.chebyshevcenter" href="#Polyhedra.chebyshevcenter"><code>Polyhedra.chebyshevcenter</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">chebyshevcenter(p::Rep[, solver])</code></pre><p>If <code>p</code> is a H-representation or is a polyhedron for which the H-representation has already been computed, calls <code>hchebyshevcenter</code>, otherwise, call <code>vchebyshevcenter</code>.</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Polyhedra.hchebyshevcenter" href="#Polyhedra.hchebyshevcenter"><code>Polyhedra.hchebyshevcenter</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">hchebyshevcenter(p::HRep[, solver])</code></pre><p>Return a tuple with the center and radius of the largest euclidean ball contained in the polyhedron <code>p</code>. Throws an error if the polyhedron is empty or if the radius is infinite.</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Polyhedra.vchebyshevcenter" href="#Polyhedra.vchebyshevcenter"><code>Polyhedra.vchebyshevcenter</code></a> — <span class="docstring-category">Function</span>.</div><div><div><pre><code class="language-none">vchebyshevcenter(p::VRep[, solver])</code></pre><p>Return a tuple with the center and radius of the smallest euclidean ball containing the polyhedron <code>p</code>. Throws an error if the polyhedron is empty or if the radius is infinite (i.e. <code>p</code> is not a polytope, it contains rays).</p></div></div></section><h2><a class="nav-anchor" id="Defining-new-representation-1" href="#Defining-new-representation-1">Defining new representation</a></h2><p>The following macros make it easy to define new representations:</p><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Polyhedra.@subrepelem" href="#Polyhedra.@subrepelem"><code>Polyhedra.@subrepelem</code></a> — <span class="docstring-category">Macro</span>.</div><div><div><p>The representation <code>rep</code> contain the elements <code>elem</code> inside a representation in the field <code>field</code>.</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Polyhedra.@norepelem" href="#Polyhedra.@norepelem"><code>Polyhedra.@norepelem</code></a> — <span class="docstring-category">Macro</span>.</div><div><div><p>The representation <code>rep</code> does not contain any <code>elem</code>.</p></div></div></section><section class="docstring"><div class="docstring-header"><a class="docstring-binding" id="Polyhedra.@vecrepelem" href="#Polyhedra.@vecrepelem"><code>Polyhedra.@vecrepelem</code></a> — <span class="docstring-category">Macro</span>.</div><div><div><p>The representation <code>rep</code> contain the elements <code>elem</code> inside a vector in the field <code>field</code>.</p></div></div></section><footer><hr/><a class="previous" href="../optimization/"><span class="direction">Previous</span><span class="title">Optimization</span></a></footer></article></body></html>