First time here? Check out the FAQ!

Ask Your Question
2

cartesian product polyhedra

asked 7 years ago

anonymous user

Anonymous

updated 7 years ago

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)
Preview: (hide)

Comments

How is this related to Sage ?

tmonteil gravatar imagetmonteil ( 7 years ago )

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

GDRANIC gravatar imageGDRANIC ( 7 years ago )

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 ( 7 years ago )

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 ( 7 years ago )

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

tmonteil gravatar imagetmonteil ( 7 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 7 years ago

tmonteil gravatar image

updated 7 years ago

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.

Preview: (hide)
link

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 ( 6 years ago )

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: 7 years ago

Seen: 541 times

Last updated: Dec 10 '17