Ask Your Question

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)

edit retag close merge delete

Comments

How is this related to Sage ?

( 2017-12-05 23:24:21 +0200 )edit

The question is asking if there is any reference for the computation that Sage is making.

( 2017-12-06 02:44:49 +0200 )edit

Which 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?!

( 2017-12-07 20:48:53 +0200 )edit

To 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.

( 2017-12-08 16:10:57 +0200 )edit

Thanks for updating your question, now i think/hope i understand what you are asking for.

( 2017-12-10 11:12:30 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

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:

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.

more

Comments

For 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/...

Which is the reference which Sage tries to follow for nomenclature.

( 2019-02-05 22:09:47 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Stats

Asked: 2017-12-05 15:03:48 +0200

Seen: 436 times

Last updated: Dec 10 '17