Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 5e1854624d3bc613bdd0dd13d1ef9ac7 > files > 3252

gap-system-4.4.12-5mdv2010.0.i586.rpm

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (toric) - Chapter 2: Cones and semigroups</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
</head>
<body>


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop">&nbsp;<a href="chap0.html">Top of Book</a>&nbsp;  &nbsp;<a href="chap1.html">Previous Chapter</a>&nbsp;  &nbsp;<a href="chap3.html">Next Chapter</a>&nbsp;  </div>

<p><a id="X7D23D3CC7F0A06BA" name="X7D23D3CC7F0A06BA"></a></p>
<div class="ChapSects"><a href="chap2.html#X7D23D3CC7F0A06BA">2. <span class="Heading">Cones and semigroups</span></a>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap2.html#X8524A7567BA4FFA6">2.1 <span class="Heading">Cones</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap2.html#X7FEBB7547EEE8E2A">2.1-1 InsideCone</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap2.html#X87566480802A161C">2.1-2 InDualCone</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap2.html#X7B303CDE8729008F">2.1-3 PolytopeLatticePoints</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap2.html#X872AD1E785C7EB03">2.1-4 Faces</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap2.html#X7A2DA9B38507BDD3">2.1-5 ConesOfFan</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap2.html#X7C923A4B785606D6">2.1-6 NumberOfConesOfFan</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap2.html#X80C858E97E741B21">2.1-7 ToricStar</a></span>
</div>
<div class="ContSect"><span class="nocss">&nbsp;</span><a href="chap2.html#X80AF5F307DBDC2B4">2.2 <span class="Heading">Semigroups</span></a>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap2.html#X818998428722C3B5">2.2-1 DualSemigroupGenerators</a></span>
</div>
</div>

<h3>2. <span class="Heading">Cones and semigroups</span></h3>

<p><a id="X8524A7567BA4FFA6" name="X8524A7567BA4FFA6"></a></p>

<h4>2.1 <span class="Heading">Cones</span></h4>

<p>This section introduces the <strong class="pkg">toric</strong> commands which deal with cones and related combinatorial-geometric objects. Recall, a <strong class="button">cone</strong> is a strongly convex polyhedral cone (<a href="chapBib.html#biBF93">[Ful93]</a>, page 4).</p>

<p><a id="X7FEBB7547EEE8E2A" name="X7FEBB7547EEE8E2A"></a></p>

<h5>2.1-1 InsideCone</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; InsideCone</code>( <var class="Arg">v, L</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>This command returns `true` if the vector <var class="Arg">v</var> belongs to the interior of the (strongly convex polyhedral) cone generated by the vectors in <var class="Arg">L</var>.</p>

<p>This procedure does not check if <var class="Arg">L</var> generates a strongly convex polyhedral cone.</p>


<table class="example">
<tr><td><pre>
gap&gt; L:=[[1,0,0],[1,1,0],[1,1,1],[1,0,1]];; v:=[0,0,1];;
gap&gt; InsideCone(v,L);
false
gap&gt; L:=[[1,0],[3,4]];;
gap&gt; v:=[1,-7]; InsideCone(v,L);
[ 1, -7 ]
false
gap&gt; v:=[4,-3]; InsideCone(v,L);
[ 4, -3 ]
false
gap&gt; v:=[4,-4]; InsideCone(v,L);
[ 4, -4 ]
false
gap&gt; v:=[4,1]; InsideCone(v,L);
[ 4, 1 ]
true
</pre></td></tr></table>

<p><a id="X87566480802A161C" name="X87566480802A161C"></a></p>

<h5>2.1-2 InDualCone</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; InDualCone</code>( <var class="Arg">v, L</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>This command returns `true` if <var class="Arg">v</var> belongs to the dual of the cone generated by the vectors in <var class="Arg">L</var>.</p>


<table class="example">
<tr><td><pre>
gap&gt; L:=[[1,0,0],[1,1,0],[1,1,1],[1,0,1]];; v:=[0,0,1];;
gap&gt; InDualCone(v,L);
true
gap&gt; L:=[[1,0],[3,4]];
[ [ 1, 0 ], [ 3, 4 ] ]
gap&gt; v:=[1,-7]; InDualCone(v,L);
[ 1, -7 ]
false
gap&gt; v:=[4,-3]; InDualCone(v,L);
[ 4, -3 ]
true
gap&gt; v:=[4,-4]; InDualCone(v,L);
[ 4, -4 ]
false
gap&gt; v:=[4,1]; InDualCone(v,L);
[ 4, 1 ]
true
</pre></td></tr></table>

<p><a id="X7B303CDE8729008F" name="X7B303CDE8729008F"></a></p>

<h5>2.1-3 PolytopeLatticePoints</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; PolytopeLatticePoints</code>( <var class="Arg">A, Perps</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><em>Input</em>: <var class="Arg">Perps</var>=[v_1,...,v_k] is the list of ``inward normal" vectors perpendicular to the walls of a polytope P in the vector space L_0^*otimes Q, <br /> <var class="Arg">A</var>=[a_1,...,a_k] is a k-tuple of integers, where a_i denotes the amount the i-th ``wall" (defined by the normal v_i) is shifted from the origin (each a_i is assumed non-negative). <br /> For example, the polytope P with faces <code class="code">[x=0, x=a, y=0, y=b]</code> has <var class="Arg">Perps</var>=[[1,0],[-1,0],[0,1],[0,-1]] and <var class="Arg">A</var>=[0,a,0,b]. <br /> <em>Output</em>: the list of points in P cap L_0^*.</p>


<table class="example">
<tr><td><pre>
gap&gt; Perps:=[[1,0],[-1,0],[0,1],[0,-1]];
[ [ 1, 0 ], [ -1, 0 ], [ 0, 1 ], [ 0, -1 ] ]
gap&gt; A:=[0,4,0,3];
[ 0, 4, 0, 3 ]
gap&gt; PolytopeLatticePoints(A,Perps);
[ [ 0, 0 ], [ 0, 1 ], [ 0, 2 ], [ 0, 3 ], [ 1, 0 ], [ 1, 1 ], [ 1, 2 ],
  [ 1, 3 ], [ 2, 0 ], [ 2, 1 ], [ 2, 2 ], [ 2, 3 ], [ 3, 0 ], [ 3, 1 ],
  [ 3, 2 ], [ 3, 3 ], [ 4, 0 ], [ 4, 1 ], [ 4, 2 ], [ 4, 3 ] ]
gap&gt; Length(last);
20
</pre></td></tr></table>

<p><a id="X872AD1E785C7EB03" name="X872AD1E785C7EB03"></a></p>

<h5>2.1-4 Faces</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; Faces</code>( <var class="Arg">Rays</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><em>Input</em>: <var class="Arg">Rays</var> is a list of rays for the fan Delta <br /> <em>Output</em>: All the normals to the faces (hyperplanes of the cone).</p>


<table class="example">
<tr><td><pre>
gap&gt; Cones1:=[[[2,-1],[-1,2]],[[-1,2],[-1,-1]],[[-1,-1],[2,-1]]];;
gap&gt; Faces(Cones1[1]);
[ [ 1/2, 1 ], [ 2, 1 ] ]
gap&gt; Faces(Cones1[2]);
[ [ -2, -1 ], [ -1, 1 ] ]
gap&gt; Cones2:=[[[ 2,0,0],[0,2,0],[0,0,2]], [[2,0,0], [0,2,0], [2,-2,1],[1,2,-2]]];;
gap&gt; Faces(Cones2[1]);
[ [ 0, 0, 1 ], [ 0, 1, 0 ], [ 1, 0, 0 ] ]
gap&gt; Faces(Cones2[2]);
[ [ 1/3, 5/6, 1 ], [ 1/2, 0, -1 ], [ 2, 0, 1 ] ]
gap&gt;
</pre></td></tr></table>

<p><a id="X7A2DA9B38507BDD3" name="X7A2DA9B38507BDD3"></a></p>

<h5>2.1-5 ConesOfFan</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; ConesOfFan</code>( <var class="Arg">Delta, k</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><em>Input</em>: <var class="Arg">Delta</var> is the fan of cones, <br /> <var class="Arg">k</var> is the dimension of the cones desired. <br /> <em>Output</em>: The <var class="Arg">k</var>-dimensional cones in the fan.</p>

<p><a id="X7C923A4B785606D6" name="X7C923A4B785606D6"></a></p>

<h5>2.1-6 NumberOfConesOfFan</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; NumberOfConesOfFan</code>( <var class="Arg">Delta, k</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><em>Input</em>: <var class="Arg">Delta</var> is the fan of cones in V=Q^n, <br /> <var class="Arg">k</var> is the dimension of the cones counted. <br /> <em>Output</em>: The number of <var class="Arg">k</var>-dimensional cones in the fan.</p>

<p>Idea: The fan <var class="Arg">Delta</var> is represented as a set of maximal cones. For each maximal cone, look at the <var class="Arg">k</var>-dimensional faces obtained by taking n choose <var class="Arg">k</var> subsets of the rays describing the cone. Certain of these <var class="Arg">k</var>-subsets yield the desired cones.</p>


<table class="example">
<tr><td><pre>
gap&gt; Delta0:=[ [ [2,0,0],[0,2,0],[0,0,2] ], [ [2,0,0],[0,2,0],[2,-2,1],[1,2,-2] ] ];;
gap&gt;
gap&gt; NumberOfConesOfFan(Delta0,2);
6
gap&gt; ConesOfFan(Delta0,2);
[ [ [ 0, 0, 2 ], [ 0, 2, 0 ] ], [ [ 0, 0, 2 ], [ 2, 0, 0 ] ], 
  [ [ 0, 2, 0 ], [ 1, 2, -2 ] ], [ [ 0, 2, 0 ], [ 2, -2, 1 ] ],
  [ [ 0, 2, 0 ], [ 2, 0, 0 ] ], [ [ 1, 2, -2 ], [ 2, -2, 1 ] ] ]
gap&gt; ConesOfFan(Delta0,1);
[ [ [ 0, 0, 2 ] ], [ [ 0, 2, 0 ] ], [ [ 1, 2, -2 ] ], 
  [ [ 2, -2, 1 ] ], [ [ 2, 0, 0 ] ] ]
gap&gt; NumberOfConesOfFan(Delta0,1);
5

</pre></td></tr></table>

<p><a id="X80C858E97E741B21" name="X80C858E97E741B21"></a></p>

<h5>2.1-7 ToricStar</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; ToricStar</code>( <var class="Arg">sigma, Delta</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><em>Input</em>: <var class="Arg">sigma</var> is a cone in the fan, represented by its set of maximal (i.e., highest dimensional) cones. <br /> <var class="Arg">Delta</var> is the fan of cones in V=Q^n. <br /> <em>Output</em>: The star of the cone <var class="Arg">sigma</var> in <var class="Arg">Delta</var>, i.e., the cones tau which have <var class="Arg">sigma</var> as a face.</p>


<table class="example">
<tr><td><pre>
gap&gt; MaxCones:=[ [ [2,0,0],[0,2,0],[0,0,2] ], 
                 [ [2,0,0],[0,2,0],[2,-2,1],[1,2,-2] ] ];;
gap&gt; #this is the set of maximal cones in the fan Delta
gap&gt; ToricStar([[1,0]],MaxCones);
[  ]
gap&gt; ToricStar([[2,0,0],[0,2,0]],MaxCones);
[ [ [ 0, 2, 0 ], [ 2, 0, 0 ] ], [ [ 2, 0, 0 ], [ 0, 2, 0 ], [ 0, 0, 2 ] ],
  [ [ 2, 0, 0 ], [ 0, 2, 0 ], [ 2, -2, 1 ], [ 1, 2, -2 ] ] ]
gap&gt;
gap&gt; MaxCones:=[ [ [2,0,0],[0,2,0],[0,0,2] ], [ [2,0,0],[0,2,0],[1,1,-2] ] ];;
gap&gt; ToricStar([[2,0,0],[0,2,0]],MaxCones);
[ [ [ 0, 2, 0 ], [ 2, 0, 0 ] ], [ [ 2, 0, 0 ], [ 0, 2, 0 ], [ 0, 0, 2 ] ],
  [ [ 2, 0, 0 ], [ 0, 2, 0 ], [ 1, 1, -2 ] ] ]
gap&gt; ToricStar([[1,0]],MaxCones);
[  ]

</pre></td></tr></table>

<p><a id="X80AF5F307DBDC2B4" name="X80AF5F307DBDC2B4"></a></p>

<h4>2.2 <span class="Heading">Semigroups</span></h4>

<p><a id="X818998428722C3B5" name="X818998428722C3B5"></a></p>

<h5>2.2-1 DualSemigroupGenerators</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&gt; DualSemigroupGenerators</code>( <var class="Arg">L</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><em>Input</em>: <var class="Arg">L</var> is a list of integral n-vectors generating a cone sigma. <br /> <em>Output</em>: the generators of S_sigma,</p>

<p>Idea: let M be the maximum of the absolute values of the coordinates of the <var class="Arg">L</var>[i]'s, for each vector v in [1..M]^n, test if v is in the dual cone sigma^*. If so, add v to list of possible generators. Once this for loop is finished, one can check this list for redundant generators. The trick is to simply omit those elements which are of the form d_1+d_2, where d_1 and d_2 are ``small" elements in the integral dual cone.</p>

<p>This program is not very efficient and should not be used in ``large examples'' involving semigroups with ``many'' generators. For example, if you take <var class="Arg">L:=[[1,2,3,4],[0,1,0,7],[3,1,0,2],[0,0,1,0]];</var> then <code class="code">DualSemigroupGenerators(L);</code> can exhaust GAP's memory allocation.</p>


<table class="example">
<tr><td><pre>
gap&gt; L:=[[1,0],[3,4]];; DualSemigroupGenerators([[1,0],[3,4]]);
[ [ 0, 0 ], [ 0, 1 ], [ 1, 0 ], [ 2, -1 ], [ 3, -2 ], [ 4, -3 ] ]
gap&gt; L:=[[1,0,0],[1,1,0],[1,1,1],[1,0,1]];;
gap&gt; DualSemigroupGenerators(L);
[ [ 0, 0, 0 ], [ 0, 0, 1 ], [ 0, 1, 0 ], [ 1, -1, 0 ], [ 1, 0, -1 ] ]
gap&gt;
</pre></td></tr></table>


<div class="chlinkprevnextbot">&nbsp;<a href="chap0.html">Top of Book</a>&nbsp;  &nbsp;<a href="chap1.html">Previous Chapter</a>&nbsp;  &nbsp;<a href="chap3.html">Next Chapter</a>&nbsp;  </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>