-
Notifications
You must be signed in to change notification settings - Fork 27
/
index.html
49 lines (48 loc) · 31 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
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Polyhedron · Polyhedra</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 src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit">Polyhedra</span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Index</a></li><li><a class="tocitem" href="../installation/">Installation</a></li><li><a class="tocitem" href="../representation/">Representation</a></li><li class="is-active"><a class="tocitem" href>Polyhedron</a><ul class="internal"><li><a class="tocitem" href="#Retrieving-a-representation"><span>Retrieving a representation</span></a></li><li><a class="tocitem" href="#Checking-if-a-representation-has-been-computed"><span>Checking if a representation has been computed</span></a></li><li><a class="tocitem" href="#Incidence"><span>Incidence</span></a></li><li><a class="tocitem" href="#Default-libraries"><span>Default libraries</span></a></li></ul></li><li><a class="tocitem" href="../plot/">Plot</a></li><li><a class="tocitem" href="../redundancy/">Containment/Redundancy</a></li><li><a class="tocitem" href="../projection/">Projection/Elimination</a></li><li><a class="tocitem" href="../optimization/">Optimization</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><span class="tocitem">Examples</span><ul><li><a class="tocitem" href="../generated/Convex hull and intersection/">Convex hull and intersection</a></li><li><a class="tocitem" href="../generated/Extended Formulation/">Extended Formulation</a></li><li><a class="tocitem" href="../generated/Minimal Robust Positively Invariant Set/">Minimal Robust Positively Invariant Set</a></li><li><a class="tocitem" href="../generated/Convex hull of a set of points/">Convex hull of a set of points</a></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>Polyhedron</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Polyhedron</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/master/docs/src/polyhedron.md" 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" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Polyhedron"><a class="docs-heading-anchor" href="#Polyhedron">Polyhedron</a><a id="Polyhedron-1"></a><a class="docs-heading-anchor-permalink" href="#Polyhedron" title="Permalink"></a></h1><p>As seen in the previous section, a polyhedron can be described in 2 ways: either using the H-representation (intersection of halfspaces) or the V-representation (convex hull of points and rays). The problem of computing the H-representation from the V-representation (or vice versa) is called the <em>representation conversion problem</em>. It can be solved by the Double-Description method</p><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.doubledescription" href="#Polyhedra.doubledescription"><code>Polyhedra.doubledescription</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">doubledescription(h::HRepresentation)</code></pre><p>Computes the V-representation of the polyhedron represented by <code>h</code> using the Double-Description algorithm [MRTT53, FP96]. It maintains a list of the points, rays and lines that are in the resulting representation and in the hyperplane corresponding to each halfspace and then add their intersection for each halfspace with <a href="#Polyhedra.add_intersection!"><code>Polyhedra.add_intersection!</code></a>. The resulting V-representation has no redundancy.</p><pre><code class="language-none">doubledescription(V::VRepresentation)</code></pre><p>Computes the H-representation of the polyhedron represented by <code>v</code> using the Double-Description algorithm [MRTT53, FP96]. Currently, this fallbacks to lifting it to the V-representation of a cone by homogenization, interpreting it as the H-representation of the dual cone so that it can rely on <code>doubledescription(::HRepresentation)</code>.</p><p>[MRTT53] Motzkin, T. S., Raiffa, H., Thompson, G. L. and Thrall, R. M. The double description method <em>Contribution to the Theory of Games</em>, <em>Princeton University Press</em>, <strong>1953</strong></p><p>[FP96] Fukuda, K. and Prodon, A. Double description method revisited <em>Combinatorics and computer science</em>, <em>Springer</em>, <strong>1996</strong>, 91-111</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/doubledescription.jl#L21-L45">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.add_intersection!" href="#Polyhedra.add_intersection!"><code>Polyhedra.add_intersection!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">add_intersection!(data, idx1, idx2, hp_idx, hs_idx = hp_idx - 1)</code></pre><p>Add the intersection of the elements of indices <code>idx1</code> and <code>idx2</code> that belong to the hyperplane corresponding the halfspace of index <code>hp_idx</code> (see 3.2 (ii) of [FP96]) or have inherited adjacency if <code>hp_idx === nothing</code> (see 3.2 (i) of [FP96]). In case of inherited adjacency, <code>hs_idx</code> is the halfspace where <code>idx1</code> was created. If <code>idx1</code> and <code>idx2</code> are not adjacent or if they are in the hyperplane corresponding to a halfspace of lower index then the intersection is not added to avoid adding redundant elements.</p><p>[FP96] Fukuda, K. and Prodon, A. Double description method revisited <em>Combinatorics and computer science</em>, <em>Springer</em>, <strong>1996</strong>, 91-111</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/doubledescription.jl#L374-L389">source</a></section></article><p>However, other methods exist such as the reverse search implemented by <a href="https://github.com/JuliaPolyhedra/LRSLib.jl">LRS</a> and the quick hull algorithm implemented by <a href="https://github.com/JuliaPolyhedra/QHull.jl">qhull</a>.</p><p>This motivates the creation of a type representing polyhedra, transparently handling the conversion from H-representation to V-representation when needed for some operation. Just like the abstract type <code>AbstractArray{N,T}</code> represents an <code>N</code>-dimensional array with elements of type <code>T</code>, the abstract type <code>Polyhedron{N,T}</code> represents an <code>N</code>-dimensional polyhedron with elements of coefficient type <code>T</code>.</p><p>There is typically one concrete subtype of <code>Polyhedron</code> by library. For instance, the CDD library defines <code>CDDLib.Polyhedron</code> and the LRS library defines <code>LRSLib.Polyhedron</code>. It must be said that the type <code>T</code> is not necessarily how the elements are stored internally by the library but the polyhedron will behave just like it is stored that way. For instance, when retreiving an H-(or V-)representation, the representation will be of type <code>T</code>. Therefore using <code>Int</code> for <code>T</code> may result in <code>InexactError</code>. For this reason, by default, the type <code>T</code> chosen is not a subtype of <code>Integer</code>.</p><p>A polyhedron can be created from a representation and a library using the <code>polyhedron</code> function.</p><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.polyhedron" href="#Polyhedra.polyhedron"><code>Polyhedra.polyhedron</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">polyhedron(rep::Representation{T})</code></pre><p>Creates a polyhedron from the representation <code>rep</code> using the default library included in the Polyhedra package.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/polyhedron.jl#L6-L10">source</a></section></article><p>To illustrate the usage of the <code>polyhedron</code> function, consider the following representations:</p><pre><code class="language-julia">hr = HalfSpace([1, 1], 1) ∩ HalfSpace([1, -1], 0) ∩ HalfSpace([-1, 0], 0)
vre = convexhull([0, 0], [0, 1], [1//2, 1//2])
vrf = convexhull([0, 0], [0, 1], [1/2, 1/2])</code></pre><p>One can use the CDD library, to create an instance of a concrete subtype of <code>Polyhedron</code> as follows:</p><pre><code class="language-julia">julia> using CDDLib
julia> polyf = polyhedron(hr, CDDLib.Library())
julia> typeof(polyhf)
CDDLib.CDDLib.Polyhedron{2,Float64}</code></pre><p>We see that the library has choosen to deal with floating point arithmetic. This decision does not depend on the type of <code>hr</code> but only on the instance of <code>CDDLib.Library</code> given. <code>CDDLib.Library</code> creates <code>CDDLib.Polyhedron</code> of type either <code>Float64</code> or <code>Rational{BigInt}</code>. One can choose the first one using <code>CDDLib.Library(:float)</code> and the second one using <code>CDDLib.Library(:exact)</code>, by default it is <code>:float</code>.</p><pre><code class="language-julia">julia> poly = polyhedron(hr, CDDLib.Library(:exact))
julia> typeof(poly)
CDDLib.Polyhedron{2,Rational{BigInt}}</code></pre><p>The first polyhedron <code>polyf</code> can also be created from its V-representation using either of the 4 following lines:</p><pre><code class="language-julia">julia> polyf = polyhedron(vrf, CDDLib.Library(:float))
julia> polyf = polyhedron(vrf, CDDLib.Library())
julia> polyf = polyhedron(vre, CDDLib.Library(:float))
julia> polyf = polyhedron(vre, CDDLib.Library())</code></pre><p>and <code>poly</code> using either of those lines:</p><pre><code class="language-julia">julia> poly = polyhedron(vrf, CDDLib.Library(:exact))
julia> poly = polyhedron(vre, CDDLib.Library(:exact))</code></pre><p>Of course, creating a representation in floating points with exact arithmetic works here because we have <code>0.5</code> which is <code>0.1</code> in binary but in general, is not a good idea.</p><pre><code class="language-julia">julia> Rational{BigInt}(1/2)
1//2
julia> Rational{BigInt}(1/3)
6004799503160661//18014398509481984
julia> Rational{BigInt}(1/5)
3602879701896397//18014398509481984</code></pre><h2 id="Retrieving-a-representation"><a class="docs-heading-anchor" href="#Retrieving-a-representation">Retrieving a representation</a><a id="Retrieving-a-representation-1"></a><a class="docs-heading-anchor-permalink" href="#Retrieving-a-representation" title="Permalink"></a></h2><p>One can retrieve an H-representation (resp. V-representation) from a polyhedron using <code>hrep</code> (resp. <code>vrep</code>). The concrete subtype of <code>HRepresentation</code> (resp. <code>VRepresentation</code>) returned is not necessarily the same that the one used to create the polyhedron. As a rule of thumb, it is the representation the closest to the internal representation used by the library.</p><pre><code class="language-julia">julia> hr = hrep(poly)
julia> typeof(hr)
Polyhedra.LiftedHRepresentation{2,Rational{BigInt}}
julia> hr = MixedMatHRep(hr)
julia> typeof(hr)
Polyhedra.MixedMatHRep{2,Rational{BigInt}}
julia> hr.A
3x2 Array{Rational{BigInt},2}:
1//1 1//1
1//1 -1//1
-1//1 0//1
julia> hr.b
3-element Array{Rational{BigInt},1}:
1//1
0//1
0//1
julia> vr = vrep(poly)
julia> typeof(vr)
Polyhedra.LiftedVRepresentation{2,Rational{BigInt}}
julia> vr = MixedMatVRep(vrep)
julia> typeof(vr)
Polyhedra.MixedMatVRep{2,Rational{BigInt}}
julia> vr.V
3x2 Array{Rational{BigInt},2}:
1//2 1//2
0//1 1//1
0//1 0//1
julia> vr.R
0x2 Array{Rational{BigInt},2}</code></pre><h2 id="Checking-if-a-representation-has-been-computed"><a class="docs-heading-anchor" href="#Checking-if-a-representation-has-been-computed">Checking if a representation has been computed</a><a id="Checking-if-a-representation-has-been-computed-1"></a><a class="docs-heading-anchor-permalink" href="#Checking-if-a-representation-has-been-computed" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.hrepiscomputed" href="#Polyhedra.hrepiscomputed"><code>Polyhedra.hrepiscomputed</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">hrepiscomputed(p::Polyhedron)</code></pre><p>Returns whether the H-representation of this polyhedron has been computed.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/polyhedron.jl#L13-L17">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.vrepiscomputed" href="#Polyhedra.vrepiscomputed"><code>Polyhedra.vrepiscomputed</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">vrepiscomputed(p::Polyhedron)</code></pre><p>Returns whether the V-representation of this polyhedron has been computed.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/polyhedron.jl#L27-L31">source</a></section></article><h2 id="Incidence"><a class="docs-heading-anchor" href="#Incidence">Incidence</a><a id="Incidence-1"></a><a class="docs-heading-anchor-permalink" href="#Incidence" title="Permalink"></a></h2><p>Elements can be accessed in a representation or polyhedron using indices and <code>Base.get</code>:</p><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.Index" href="#Polyhedra.Index"><code>Polyhedra.Index</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia">Index{T, ElemT}</code></pre><p>Index of an element of type <code>ElemT</code> in a <code>Rep{T}</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/indices.jl#L2-L6">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.Indices" href="#Polyhedra.Indices"><code>Polyhedra.Indices</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia">Indices{T, ElemT, RepT<:Rep{T}}</code></pre><p>Iterator over the indices of the elements of type <code>ElemT</code> of the field <code>rep</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/indices.jl#L29-L33">source</a></section></article><p>The list of indices can be obtained using, e.g., <code>eachindex(points(rep))</code>. For instance, the following prints all points using indices</p><pre><code class="language-julia">for pi in eachindex(points(rep))
@show get(rep, pi)
end</code></pre><p>A point <span>$p$</span> (resp. ray <span>$r$</span>) is incident to an halfspace <span>$\langle a, x \rangle \le \beta$</span> if <span>$\langle a, p \rangle = \beta$</span> (resp. <span>$\langle a, r \rangle = \beta$</span>).</p><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.incidenthalfspaces" href="#Polyhedra.incidenthalfspaces"><code>Polyhedra.incidenthalfspaces</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">incidenthalfspaces(p::Polyhedron, idx)</code></pre><p>Returns the list of halfspaces incident to idx for the polyhedron <code>p</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/iterators.jl#L147-L151">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.incidenthalfspaceindices" href="#Polyhedra.incidenthalfspaceindices"><code>Polyhedra.incidenthalfspaceindices</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">incidenthalfspaceindices(p::Polyhedron, idx)</code></pre><p>Returns the list of the indices of halfspaces incident to idx for the polyhedron <code>p</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/iterators.jl#L154-L158">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.incidentpoints" href="#Polyhedra.incidentpoints"><code>Polyhedra.incidentpoints</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">incidentpoints(p::Polyhedron, idx)</code></pre><p>Returns the list of points incident to idx for the polyhedron <code>p</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/iterators.jl#L147-L151">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.incidentpointindices" href="#Polyhedra.incidentpointindices"><code>Polyhedra.incidentpointindices</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">incidentpointindices(p::Polyhedron, idx)</code></pre><p>Returns the list of the indices of points incident to idx for the polyhedron <code>p</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/iterators.jl#L154-L158">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.incidentrays" href="#Polyhedra.incidentrays"><code>Polyhedra.incidentrays</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">incidentrays(p::Polyhedron, idx)</code></pre><p>Returns the list of rays incident to idx for the polyhedron <code>p</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/iterators.jl#L147-L151">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.incidentrayindices" href="#Polyhedra.incidentrayindices"><code>Polyhedra.incidentrayindices</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">incidentrayindices(p::Polyhedron, idx)</code></pre><p>Returns the list of the indices of rays incident to idx for the polyhedron <code>p</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/iterators.jl#L154-L158">source</a></section></article><p>In a polyhedron, all points and rays are incident to all hyperplanes and all halfspaces are incident to all lines. The following methods are therefore redundant, e.g. <code>incidenthyperplanes(p, idx)</code> is equivalent to <code>hyperplanes(p)</code> and <code>incidenthyperplaneindices(p, idx)</code> is equivalent to <code>eachindex(hyperplanes(p))</code>. The methods are hence only defined for consistency.</p><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.incidenthyperplanes" href="#Polyhedra.incidenthyperplanes"><code>Polyhedra.incidenthyperplanes</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">incidenthyperplanes(p::Polyhedron, idx)</code></pre><p>Returns the list of hyperplanes incident to idx for the polyhedron <code>p</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/iterators.jl#L147-L151">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.incidenthyperplaneindices" href="#Polyhedra.incidenthyperplaneindices"><code>Polyhedra.incidenthyperplaneindices</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">incidenthyperplaneindices(p::Polyhedron, idx)</code></pre><p>Returns the list of the indices of hyperplanes incident to idx for the polyhedron <code>p</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/iterators.jl#L154-L158">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.incidentlines" href="#Polyhedra.incidentlines"><code>Polyhedra.incidentlines</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">incidentlines(p::Polyhedron, idx)</code></pre><p>Returns the list of lines incident to idx for the polyhedron <code>p</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/iterators.jl#L147-L151">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.incidentlineindices" href="#Polyhedra.incidentlineindices"><code>Polyhedra.incidentlineindices</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">incidentlineindices(p::Polyhedron, idx)</code></pre><p>Returns the list of the indices of lines incident to idx for the polyhedron <code>p</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/iterators.jl#L154-L158">source</a></section></article><h2 id="Default-libraries"><a class="docs-heading-anchor" href="#Default-libraries">Default libraries</a><a id="Default-libraries-1"></a><a class="docs-heading-anchor-permalink" href="#Default-libraries" title="Permalink"></a></h2><p>The following functions allows to select a default library:</p><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.default_library" href="#Polyhedra.default_library"><code>Polyhedra.default_library</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">default_library(d::FullDim, ::Type{T}) where {T}</code></pre><p>Returns the default polyhedral library for <code>d</code>-dimensional polyhedron of coefficient type <code>T</code>.</p><p><strong>Examples</strong></p><p>To obtain the default library for 2-dimensional polyhedra of eltype <code>Float64</code>, do <code>default_library(2, Float64)</code>.</p><p>Given an <code>StaticArrays.SVector</code> <code>v</code>, to obtain a default library for points of the type of <code>v</code> in a type stable way, do <code>default_library(Polyhedra.FullDim(v), eltype(v))</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/default.jl#L24-L37">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.similar_library" href="#Polyhedra.similar_library"><code>Polyhedra.similar_library</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">similar_library(lib::Library, d::FullDim, T::Type)</code></pre><p>Returns a library that supports polyhedra of full dimension <code>T</code> with coefficient type <code>T</code>. If <code>lib</code> does not support it, this commonly calls <code>default_library(d, T)</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/default.jl#L53-L57">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.library" href="#Polyhedra.library"><code>Polyhedra.library</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">library(p::Polyhedron)</code></pre><p>Returns the library used by <code>p</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/default.jl#L65-L69">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.default_type" href="#Polyhedra.default_type"><code>Polyhedra.default_type</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">default_type(d::FullDim, ::Type{T}) where {T}</code></pre><p>Returns the default polyhedron type for <code>d</code>-dimensional polyhedron of coefficient type <code>T</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/default.jl#L3-L7">source</a></section></article><p>The following libraries serves as fallback:</p><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.DefaultLibrary" href="#Polyhedra.DefaultLibrary"><code>Polyhedra.DefaultLibrary</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia">DefaultLibrary{T}</code></pre><p>Default library for polyhedra of dimension larger than 1 (<a href="#Polyhedra.IntervalLibrary"><code>IntervalLibrary</code></a> is the default for polyhedra of dimension 1). The library implements the bare minimum and uses the fallback implementation for all operations.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/defaultlibrary.jl#L3-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.IntervalLibrary" href="#Polyhedra.IntervalLibrary"><code>Polyhedra.IntervalLibrary</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia">IntervalLibrary{T}</code></pre><p>Default library for polyhedra of dimension 1. Many aspect of polyhedral computation become trivial in one dimension. This library exploits this fact. The library is also used as a fallback for libraries that do not support 1-dimensional polyhedra (e.g. qhull). That is projecting a polyhedron using such library produces a polyhedron using <code>IntervalLibrary</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/interval.jl#L3-L8">source</a></section></article><p>The type and library of the polyhedron obtained after applying an operation of several polyhedra (of possibly different type and/or library) is determined by the <code>similar</code> function.</p><article class="docstring"><header><a class="docstring-binding" id="Base.similar" href="#Base.similar"><code>Base.similar</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia">similar(p::Tuple{Vararg{Polyhedra.Rep}}, d::Polyhedra.FullDim, ::Type{T}, it::Polyhedra.It{T}...)</code></pre><p>Creates a representation with a type similar to <code>p</code> of a polyhedron of full dimension <code>d</code>, element type <code>T</code> and initialize it with the iterators <code>it</code>. The type of the result will be chosen closer to the type of <code>p[1]</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/83493da0a751420aa309c26c36da5f8a6c294967/src/default.jl#L174-L179">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../representation/">« Representation</a><a class="docs-footer-nextpage" href="../plot/">Plot »</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><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></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="Tuesday 26 October 2021 20:07">Tuesday 26 October 2021</span>. Using Julia version 1.6.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>