| products/Sources/formale Sprachen/GAP/pkg/normalizinterface/doc/chap3_mj.html |
 |
<?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>
< script type= "text/javascript"
src= "https://cdn.<>Returns:: digraph.</>
</ script>
< title>GAP (NormalizInterface) - Chapter 3: Examples</ 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" />
< script src= "manual.js" type= "text/javascript"></ script>
< script type= "text/javascript">overwriteStyle();</ script>
</ head>
< body class= "chap3" onload= "jscontent()">
< div class= "chlinktop">< span class= "chlink1">Goto Chapter: </ span>< a href= "chap0_mj.html">Top< /a> <a
<div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap2_mj.html">[Previous Chapter]</a> <a href="chap4_mj.html">[Next Chapter]</a> <<If< "rg"><>and<class"Arg>/are java.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 236
<p id="mathjaxlink" class="pcenter"><a href="chap3.html">[MathJax off]</a></p>
<p><a id="X7A489A5D79DA9E5C" name="X7A489A5D79DA9E5C"></a></p>
<div class="ChapSectsp>The ' possiblemovesofthepiece across a chessboard. An <var class="Arg">m</var> by <var class="Arg">n</var> chessboard is a grid of <var class="Arg">m</var> columns ("files") and <var class="Arg">n</var> rows ("ranks") that intersect in squares. Orthogonally adjacent squares are alternately colored light and dark, with the square in the first rank and file being dark.</p>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X7BD5B55C802805B4">3.1 <span class="Heading">Generators</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X872A3FB37D6D7DFE">3.2 <span class="<p>The <code class="code"><var class="Arg">m</var> * <var class="Arg">n</var></code> vertices of the queen's graph can be placed onto the <codeclass="code"<class="Arg>var ">/varcode> vertices of queen' graph canbeplaced onto the codeclass"ode"<var ="<var *varclassjava.lang.StringIndexOutOfBoundsException: Range [200, 199) out of bounds for length 673
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X8570F3C87B5B7DD7">3.3 <span class="Heading">System of inhomogeneous equations</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss"> java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </p>Note that the <code class="func">QueensGraph</code> is the <code class="func">DigraphEdgeUnion</code> (<a href="chap3.html#X7DA997697D310E44"><span class="RefLink">3.3-30</span></a>) of the <code class="func">RooksGraph</code> (<a href="chap3.html#X7A6DD11881874F51"><span class="RefLink">3.5-42</span></a>) and the <code class="func">BishopsGraph</code> (<a href="chap3.html#X7E3240047C92733F"><span class="RefLink">3.5-5</span></a>) of the same dimensions.</p>
</span>
</div>
</div>
<h3>3 <span class="Heading">Examples</span></h3>
<p><a id="X7BD5B55C802805B4" name="X7BD5B55C802805B4"></a></p>
<h4>3.1 <span class="Heading">Generators</span></h4>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">C := NmzCone(["integral_closure",[[2,1],[1,3]]]);</span>
<a Normaliz cone>
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzHasConeProperty(C,"HilbertBasis");</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzHasConeProperty(C,"SupportHyperplanes");</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzConeProperty(C,"HilbertBasis");</span>
[ [ 1, 1 ], [ 1, 2 ], [ 1, 3 ], [ 2, 1 ] ]
<span class="GAPprompt">gap></span> <span class=" class="xample"><pre
true
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzConeProperty(C,"SupportHyperplanes");</span>
[ [ -1, 2 ], [ 3, -1 ] ]
</pre></div>
<p><a id="X872A3FB37D6D7DFE" name="X872A3FB37D6D7DFE<class="APprompt>gap>/pan span "APinput"QueensGraph(,5;/span>
<h4>3.2 <span class="Heading">System of equations</span></h4>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := NmzCone(["equations",[[1,2,-3]], "grading"immutable symmetric digraph 10 java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 72
<a Normaliz cone>
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzCompute(D,["DualMode","HilbertSeries"]);</span>
true
<span class="GAPprompt">gap&spanclass==GAPprompt">gap></span> <span class="GAPinput">D := QueensGraph(4, 3);</span>
[ [ 1, 1, 1 ], [ 0, 3, 2 ], [ 3, 0, 1 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzHilbertSeries(D);</span>
[ t^2-t+1, [ [ 1, 1 ], [ 3, 1 ] ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput&t; connected with 12 vertices,92 edges>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzSupportHyperplanes(D);</span>
[ [ 0, 1, 0 ], [ 1, 0, 0 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzEquations(D);</span>
[ [ 1, 2, -3 ] ]
<pre>/div>
<p><a id="X8570F3C87B5B7DD7" name="X8570F3C87B5B7DD7"></a></p>
<h4>3.3 <span class="Heading">System of inhomogeneous equations</span></h4>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">P := NmzCone(["inhom_equations",[[<alse
<a Normaliz cone>
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzIsInhomogeneous(C);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzIsInhomogeneous(P);</span>
true
<span class="GAPprompt">gap></<pan class=">gt;/ span =>java.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 88
[ [ 1, 1, 1, 0 ], [ 3, 0, 1, 0 ], [ 0, 3, 2, 0 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzModuleGenerators(P);</span>
[ [ 0, 1, 1, 1 ], [ 2, 0, 1, 1 ] ]
</pre></div>
<p><a id="X7B191A1778012C1D" name="X7B191A1778012C1D"></a></p>
<h4>3.4 <span class="Heading">Combined input</span></h4>
<p>Normaliz also allows the combination of different kinds of input, e.g. multiple constraint types, or additional data like a grading.</p>
<p>Suppose that you have a 3 by 3 <q>square</q> of nonnegative integers such that the 3 numbers in all rows, all columns, and both diagonals sum to the same constant <span class="SimpleMath">\(M\)</span>. Sometimes such squares are called magic and <span class="SimpleMath">\(M\)</span> is the magic constant. This leads to a linear <pre<div>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">Magic3x3even := NmzCone(["equations",</span>
<span class="GAPprompt">></span> <span class="GAPinput">[ [1, 1, 1, -1, -1, -1, 0, 0, 0],</span>
<span class="GAPprompt"<><a id"7" =>/></
<span class="GAPprompt">></span> <span class="GAPinput"> [0, 1, 1, -1, 0, 0, -1, 0, 0],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [1, 0,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<span class="GAPprompt">></span> <span class="GAPinput"> [1, 1, 0, 0, 0, -1, 0, 0, -1],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [0, 1, 1, 0, -1, 0, 0, 0, -1],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [1, 1, 0, 0, -1, 0, -1, 0, 0] ],</span>
<span class="GAPprompt">></span> <span class="GAPinput">"congruences",div "unc"<table class"func"100"<tr>td class"java.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 275
<span class="GAPprompt">></span> <span class="GAPinput">[ [1, 0, 0, 0, 0, 0, 0, 0, 0, 2],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [0, 0, 1, 0, 0, 0, 0, 0, 0, 2],</span>
<class">g<span>span => 0,0,0,0 0 , ,0 ,2],/java.lang.StringIndexOutOfBoundsException: Index 104 out of bounds for length 104
<span class="GAPprompt">></span> <span class="GAPinput"> [0, 0, 0, 0, 0, 0, 0, 0, 1, 2] ],</span>
<span class="GAPprompt">></span> <span class="GAPinput">"grading",</span>
<span class="GAPprompt">></span> <span class="GAPinput">[ [1, 1, 1, 0, 0, 0, 0, 0, 0] ] ] );</span>
<a Normaliz cone>
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzHilbertBasis(Magic3x3even);</span>
[ [ 0, 4, 2, 4, 2, 0, 2, 0, 4 ], [ 2, 0, 4, 4, 2, 0, 0, 4, 2 ],
[ 2, 2, 2, 2, 2, 2, 2, 2, 2 ], [ 2, 4, 0, 0, 2, 4, 4, 0, 2 ],
[4,0,2, 0 ,4,2,4 ,[2, , ,,3,1, 2, 3, 4 ],
[ 2, 5, 2, 3, 3, 3, 4, 1, 4 ], [ 4, 1, 4, 3, 3, 3, 2, 5, 2 ],
[ 4, 3, 2, 1, 3, 5, 4, 3, 2 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzHilbertSeries(Magic3x3even);</span>
[ t^3+3*t^2-t+1, [ [ 1, 1 ], [ 2, 2 ] ] ]
<<span "">java.lang.StringIndexOutOfBoundsException: Range [88, 87) out of bounds for length 109
[ 1/2*t^2+t+1, 1/2*t^2-1/2 ]
</pre></div>
<p><a id="X8406B01578B99D14" name="X8406B01578B99D14"></a></p>
<h4>3.5 <span class="Heading">Using the dual mode</span></h4>
<p>For solving systems of equations and inequalities it is often faster to use the dual Normaliz algorithm. We demonstrate how to use it with an inhomogeneous system of equations and inequalities.</p>
<p>The input consists of a system of 8 inhomogeneous equations in R^3. The first row of the matrix M encodes the inequality <span class="SimpleMath">\(8x + 8y + 8z + 7 \geq 0\)</span>. Additionally we say that <span class="SimpleMath">\(x, y, z\)</span> should be non-negative by giving the sign vector and use the total degree.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">M := [</span>
<<>Thechosen correspondence between vertices and chess squares is given by <code class="func">DigraphVertexLabels</code> (<a href="chap5.html#X7E51F2FE87140B32"><span class="RefLink">5.1-12</span></a>). In more detail, the vertices of the digraph are labelled by elements of the Cartesian product <code class="code">[1..<var class="Arg">m</var>] x [1..<var class="Arg">n</var>]</code>, where the first entry indexes
<span class="GAPprompt">></span> <span class="GAPinput"> [ 0, 4, 0, 1 ],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ 0, 1, 0, 7 ],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ 0, -2, 0, 7 ],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ 0, -2, 0, 1 ],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ 8, 48, 8, 17 ],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ 1, 6, 1, 34 ],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ 2,-12, -2, 37 ],</span>
<span class="GAPprompt">></span> <span class="GAPinput"> [ 4,-24, -4, 14 ]</span>
<span class="GAPprompt">></span> <span class="GAPinput">];;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := NmzCone(["inhom_inequalities", M,</span>
<span div class">pre>
<span class="GAPprompt">></span> <span class="GAPinput"> "grading", [[1,1,1]]]);</span>
<a Normaliz cone>
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzCompute(D,["DualMode","span class="java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 91
true
<span class="GAPprompt">gap></span> <span class="GAPinput">NmzHilbertBasis(D);</span>
[ [ 1, 0, 0, 0 ], [ 1, 0, 1, 0 ] ]
<java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 92
[ [ 0, 0, 0, 1 ], [ 0, 0, 1, 1 ], [ 0, 0, 2, 1 ], [ 0, 0, 3, 1 ] ]
</pre></div>
<p>As result we get the Hilbert g;
<div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap2_mj.html">[Previous Chapter]</a> <a href="chap4_mj.html">[Next Chapter]</a> </div>
<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html<;java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 74
<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>
¤ Dauer der Verarbeitung: 0.7 Sekunden
¤
*© Formatika GbR, Deutschland
|
|