Ask Your Question
2

cartesian product polyhedra

asked 2017-12-05 08:03:48 -0600

anonymous user

Anonymous

updated 2017-12-09 19:36:32 -0600

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 16:24:21 -0600 )edit

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

GDRANIC gravatar imageGDRANIC ( 2017-12-05 19:44:49 -0600 )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 13:48:53 -0600 )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 09:10:57 -0600 )edit

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

tmonteil gravatar imagetmonteil ( 2017-12-10 04:12:30 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-12-10 04:11:39 -0600

tmonteil gravatar image

updated 2017-12-10 04:15:02 -0600

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

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 08:03:48 -0600

Seen: 83 times

Last updated: Dec 10