<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>halfspaces -- computes the defining half-spaces of a Cone or a Polyhedron</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_hilbert__Basis.html">next</a> | <a href="_gen__Cones.html">previous</a> | <a href="_hilbert__Basis.html">forward</a> | <a href="_gen__Cones.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>halfspaces -- computes the defining half-spaces of a Cone or a Polyhedron</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt> M = halfspaces C </tt><br/><tt>(M,v) = halfspaces P</tt></div> </dd></dl> </div> </li> <li><div class="single">Inputs:<ul><li><span><tt>C</tt>, <span>a <a href="___Cone.html">convex rational cone</a></span></span></li> <li><span><tt>P</tt>, <span>a <a href="___Polyhedron.html">convex polyhedron</a></span></span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><tt>M</tt>, <span>a <a href="../../Macaulay2Doc/html/___Matrix.html">matrix</a></span>, with entries over <a href="../../Macaulay2Doc/html/___Q__Q.html" title="the class of all rational numbers">QQ</a></span></li> <li><span><tt>v</tt>, <span>a <a href="../../Macaulay2Doc/html/___Matrix.html">matrix</a></span>, with entries over <a href="../../Macaulay2Doc/html/___Q__Q.html" title="the class of all rational numbers">QQ</a> and only one column</span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><p/> <tt>halfspaces</tt> returns the defining affine half-spaces. For a polyhedron <tt>P</tt> the output is <tt>(M,v)</tt>, where the source of <tt>M</tt> has the dimension of the ambient space of <tt>P</tt> and <tt>v</tt> is a one column matrix in the target space of <tt>M</tt> such that <tt>P = {p in H | M*p =< v}</tt> where <tt>H</tt> is the intersection of the defining affine hyperplanes.<p/> For a cone <tt>C</tt> the output is the matrix<tt>M</tt> that is the same matrix as before but <tt>v</tt> is omitted since it is 0, so <tt>C = {c in H | M*c =< 0}</tt> and <tt>H</tt> is the intersection of the defining linear hyperplanes.<table class="examples"><tr><td><pre>i1 : R = matrix {{1,1,2,2},{2,3,1,3},{3,2,3,1}}; 3 4 o1 : Matrix ZZ <--- ZZ</pre> </td></tr> <tr><td><pre>i2 : V = matrix {{1,-1},{0,0},{0,0}}; 3 2 o2 : Matrix ZZ <--- ZZ</pre> </td></tr> <tr><td><pre>i3 : C = posHull R o3 = {ambient dimension => 3 } dimension of lineality space => 0 dimension of the cone => 3 number of facets => 4 number of rays => 4 o3 : Cone</pre> </td></tr> <tr><td><pre>i4 : halfspaces C o4 = | -2 1 1 | | 1 -1 1 | | 1 1 -1 | | 5 -1 -1 | 4 3 o4 : Matrix QQ <--- QQ</pre> </td></tr> </table> <p/> Now we take this cone over a line and get a polyhedron.<table class="examples"><tr><td><pre>i5 : P = convexHull(V,R) o5 = {ambient dimension => 3 } dimension of lineality space => 0 dimension of polyhedron => 3 number of facets => 6 number of rays => 4 number of vertices => 2 o5 : Polyhedron</pre> </td></tr> <tr><td><pre>i6 : halfspaces P o6 = (| 0 1 -3 |, | 0 |) | 2 -1 -1 | | 2 | | -1 1 -1 | | 1 | | 0 -3 1 | | 0 | | -1 -1 1 | | 1 | | -5 1 1 | | 5 | o6 : Sequence</pre> </td></tr> </table> </div> </div> <div class="waystouse"><h2>Ways to use <tt>halfspaces</tt> :</h2> <ul><li>halfspaces(Cone)</li> <li>halfspaces(Polyhedron)</li> </ul> </div> </div> </body> </html>