ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 05 Feb 2019 22:09:47 +0100cartesian product polyhedrahttps://ask.sagemath.org/question/39952/cartesian-product-polyhedra/Are there any book or paper citations on how the Cartesian product of polyhedra is computed within the polyhedron base class? Consider the following example input:
P1 = Polyhedron(vertices = [[1,1], [2,3], [3,0]], rays = [[3,2], [5,2]])
P2 = Polyhedron(vertices = [[6,0]], rays = [[1,9], [1,3]])
ExampleP = P1.product(P2)
ExampleP.Vrepresentation()
The output is:
A ray in the direction (0, 0, 1, 3),
A ray in the direction (0, 0, 1, 9),
A vertex at (1, 1, 6, 0),
A vertex at (2, 3, 6, 0),
A vertex at (3, 0, 6, 0),
A ray in the direction (3, 2, 0, 0),
A ray in the direction (5, 2, 0, 0)Tue, 05 Dec 2017 15:03:48 +0100https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/Comment by tmonteil for <p>Are there any book or paper citations on how the Cartesian product of polyhedra is computed within the polyhedron base class? Consider the following example input:</p>
<pre><code>P1 = Polyhedron(vertices = [[1,1], [2,3], [3,0]], rays = [[3,2], [5,2]])
P2 = Polyhedron(vertices = [[6,0]], rays = [[1,9], [1,3]])
ExampleP = P1.product(P2)
ExampleP.Vrepresentation()
</code></pre>
<p>The output is:</p>
<pre><code>A ray in the direction (0, 0, 1, 3),
A ray in the direction (0, 0, 1, 9),
A vertex at (1, 1, 6, 0),
A vertex at (2, 3, 6, 0),
A vertex at (3, 0, 6, 0),
A ray in the direction (3, 2, 0, 0),
A ray in the direction (5, 2, 0, 0)
</code></pre>
https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=39958#post-id-39958How is this related to Sage ?Tue, 05 Dec 2017 23:24:21 +0100https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=39958#post-id-39958Comment by GDRANIC for <p>Are there any book or paper citations on how the Cartesian product of polyhedra is computed within the polyhedron base class? Consider the following example input:</p>
<pre><code>P1 = Polyhedron(vertices = [[1,1], [2,3], [3,0]], rays = [[3,2], [5,2]])
P2 = Polyhedron(vertices = [[6,0]], rays = [[1,9], [1,3]])
ExampleP = P1.product(P2)
ExampleP.Vrepresentation()
</code></pre>
<p>The output is:</p>
<pre><code>A ray in the direction (0, 0, 1, 3),
A ray in the direction (0, 0, 1, 9),
A vertex at (1, 1, 6, 0),
A vertex at (2, 3, 6, 0),
A vertex at (3, 0, 6, 0),
A ray in the direction (3, 2, 0, 0),
A ray in the direction (5, 2, 0, 0)
</code></pre>
https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=39961#post-id-39961The question is asking if there is any reference for the computation that Sage is making.Wed, 06 Dec 2017 02:44:49 +0100https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=39961#post-id-39961Comment by dan_fulea for <p>Are there any book or paper citations on how the Cartesian product of polyhedra is computed within the polyhedron base class? Consider the following example input:</p>
<pre><code>P1 = Polyhedron(vertices = [[1,1], [2,3], [3,0]], rays = [[3,2], [5,2]])
P2 = Polyhedron(vertices = [[6,0]], rays = [[1,9], [1,3]])
ExampleP = P1.product(P2)
ExampleP.Vrepresentation()
</code></pre>
<p>The output is:</p>
<pre><code>A ray in the direction (0, 0, 1, 3),
A ray in the direction (0, 0, 1, 9),
A vertex at (1, 1, 6, 0),
A vertex at (2, 3, 6, 0),
A vertex at (3, 0, 6, 0),
A ray in the direction (3, 2, 0, 0),
A ray in the direction (5, 2, 0, 0)
</code></pre>
https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=40003#post-id-40003Which is the code doing the computation, for instance for the cartesian product of the following object `X` with itself?
ie = lambda s: [ [1,s,0,0], [1,0,s,0], [1,0,0,s] ]
X = Polyhedron( ieqs = ie(1)+ie(-1) )
Is this `X` in the right (polyhedron base) class?!Thu, 07 Dec 2017 20:48:53 +0100https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=40003#post-id-40003Comment by slelievre for <p>Are there any book or paper citations on how the Cartesian product of polyhedra is computed within the polyhedron base class? Consider the following example input:</p>
<pre><code>P1 = Polyhedron(vertices = [[1,1], [2,3], [3,0]], rays = [[3,2], [5,2]])
P2 = Polyhedron(vertices = [[6,0]], rays = [[1,9], [1,3]])
ExampleP = P1.product(P2)
ExampleP.Vrepresentation()
</code></pre>
<p>The output is:</p>
<pre><code>A ray in the direction (0, 0, 1, 3),
A ray in the direction (0, 0, 1, 9),
A vertex at (1, 1, 6, 0),
A vertex at (2, 3, 6, 0),
A vertex at (3, 0, 6, 0),
A ray in the direction (3, 2, 0, 0),
A ray in the direction (5, 2, 0, 0)
</code></pre>
https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=40012#post-id-40012To the orignal poster: please provide an example of the computation you are asking about.
This makes it way easier to explore a question, thereby increasing chances of an answer.Fri, 08 Dec 2017 16:10:57 +0100https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=40012#post-id-40012Comment by tmonteil for <p>Are there any book or paper citations on how the Cartesian product of polyhedra is computed within the polyhedron base class? Consider the following example input:</p>
<pre><code>P1 = Polyhedron(vertices = [[1,1], [2,3], [3,0]], rays = [[3,2], [5,2]])
P2 = Polyhedron(vertices = [[6,0]], rays = [[1,9], [1,3]])
ExampleP = P1.product(P2)
ExampleP.Vrepresentation()
</code></pre>
<p>The output is:</p>
<pre><code>A ray in the direction (0, 0, 1, 3),
A ray in the direction (0, 0, 1, 9),
A vertex at (1, 1, 6, 0),
A vertex at (2, 3, 6, 0),
A vertex at (3, 0, 6, 0),
A ray in the direction (3, 2, 0, 0),
A ray in the direction (5, 2, 0, 0)
</code></pre>
https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=40056#post-id-40056Thanks for updating your question, now i think/hope i understand what you are asking for.Sun, 10 Dec 2017 11:12:30 +0100https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=40056#post-id-40056Answer by tmonteil for <p>Are there any book or paper citations on how the Cartesian product of polyhedra is computed within the polyhedron base class? Consider the following example input:</p>
<pre><code>P1 = Polyhedron(vertices = [[1,1], [2,3], [3,0]], rays = [[3,2], [5,2]])
P2 = Polyhedron(vertices = [[6,0]], rays = [[1,9], [1,3]])
ExampleP = P1.product(P2)
ExampleP.Vrepresentation()
</code></pre>
<p>The output is:</p>
<pre><code>A ray in the direction (0, 0, 1, 3),
A ray in the direction (0, 0, 1, 9),
A vertex at (1, 1, 6, 0),
A vertex at (2, 3, 6, 0),
A vertex at (3, 0, 6, 0),
A ray in the direction (3, 2, 0, 0),
A ray in the direction (5, 2, 0, 0)
</code></pre>
https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?answer=40055#post-id-40055No reference is given within Sage source code. To access its source code, you just have to add a double question mark on method as follows:
sage: P1 = Polyhedron(vertices = [[1,1], [2,3], [3,0]], rays = [[3,2], [5,2]])
sage: P2 = Polyhedron(vertices = [[6,0]], rays = [[1,9], [1,3]])
sage: P1.product??
You will first see the documentation of the method, and then the program. As you will see, this part of Sage is written in pure Python and is very readable. Moreover, the construction seems straightforward: vertices, rays and lines are processed independenltly. If you have any problem in understanding a particular point of the code, please do not hesitate to ask.Sun, 10 Dec 2017 11:11:39 +0100https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?answer=40055#post-id-40055Comment by jipilab for <p>No reference is given within Sage source code. To access its source code, you just have to add a double question mark on method as follows:</p>
<pre><code>sage: P1 = Polyhedron(vertices = [[1,1], [2,3], [3,0]], rays = [[3,2], [5,2]])
sage: P2 = Polyhedron(vertices = [[6,0]], rays = [[1,9], [1,3]])
sage: P1.product??
</code></pre>
<p>You will first see the documentation of the method, and then the program. As you will see, this part of Sage is written in pure Python and is very readable. Moreover, the construction seems straightforward: vertices, rays and lines are processed independenltly. If you have any problem in understanding a particular point of the code, please do not hesitate to ask.</p>
https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=45334#post-id-45334For a reference on the product of polyhedra, see p.390 in the Handbook of Discrete and Computational Geometry, Chapter 15:
https://www.csun.edu/~ctoth/Handbook/chap15.pdf
Which is the reference which Sage tries to follow for nomenclature.Tue, 05 Feb 2019 22:09:47 +0100https://ask.sagemath.org/question/39952/cartesian-product-polyhedra/?comment=45334#post-id-45334