Ask Your Question
2

cartesian product polyhedra

asked 2017-12-05 15:03:48 +0100

anonymous user

Anonymous

updated 2017-12-10 02:36:32 +0100

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 flag offensive close merge delete

Comments

How is this related to Sage ?

tmonteil gravatar imagetmonteil ( 2017-12-05 23:24:21 +0100 )edit

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

GDRANIC gravatar imageGDRANIC ( 2017-12-06 02:44:49 +0100 )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?!

dan_fulea gravatar imagedan_fulea ( 2017-12-07 20:48:53 +0100 )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.

slelievre gravatar imageslelievre ( 2017-12-08 16:10:57 +0100 )edit

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

tmonteil gravatar imagetmonteil ( 2017-12-10 11:12:30 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-12-10 11:11:39 +0100

tmonteil gravatar image

updated 2017-12-10 11:15:02 +0100

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.

edit flag offensive delete link 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.

jipilab gravatar imagejipilab ( 2019-02-05 22:09:47 +0100 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

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

Seen: 500 times

Last updated: Dec 10 '17