Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PolyhedralComplex as new object #887

Merged
merged 25 commits into from
Jan 18, 2022
Merged

Add PolyhedralComplex as new object #887

merged 25 commits into from
Jan 18, 2022

Conversation

lkastner
Copy link
Member

Since we have cones and fans (and polyhedra), it makes sense to complete this.

Polyhedral complexes are needed in the tropical geometry part to come, nevertheless it seems sensible to have a separate PR.

@lkastner
Copy link
Member Author

Looking at https://github.com/oscar-system/Oscar.jl/actions/runs/1558072926 it talks about merging? Was it trying to merge my draft?

@thofma
Copy link
Collaborator

thofma commented Dec 13, 2021

Yes, it always runs the tests on a merge into the master branch. The failure was just a network hiccup.

###############################################################################
function Base.show(io::IO, PC::PolyhedralComplex)
ad = ambient_dim(PC)
if ad == -1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this line of code: (1) it should not be possible to create a polyhedral complex without an ambient dimension. (2) Why is the right hand side -1.0 (and not an integer)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we not make a polyhedral complex just from a Hasse diagram? @YueRen says he needs polyhedral complexes that aren't embedded. We also had polyhedra without embedding. This right hand side stems from the fact that polymake would not error, but instead return -1.0 if the ambient dimension could not be computed. The code is the same for the polyhedron, maybe this is fixed now, @benlorenz ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the code in polymake for Cone, Polytope and PolyhedralFan but somehow missed PolyhedralComplex. I will add the missing input property for the upcoming release, after that change the ambient dim method should fail instead of returning a plain perl number. The code tries to compute FAN_AMBIENT_DIM - 1 which should be an int but in this case it is undef - 1 which perl evaluates to a float (perl number type) -1. (This is then translated to a julia Float)

Copy link
Member

@micjoswig micjoswig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me (except for minor complaints). I'd suggest to fix those, merge from master and then to merge everything back into master.

src/PolyhedralGeometry/Serialization.jl Outdated Show resolved Hide resolved
@@ -42,6 +42,7 @@ ambient_dim(PC::PolyhedralComplex)
codim(PC::PolyhedralComplex)
dim(PC::PolyhedralComplex)
f_vector(PC::PolyhedralComplex)
isembedded(PC::PolyhedralComplex)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason for this function?

According to your definition in the doc a polyhedral complex is always embedded.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YueRen needs complexes that aren't embedded, where we e.g. only know the Hasse diagram. I was going to say that we also have polyhedra that aren't embedded, but they seem to be gone? The definition seems now always to be embedded.

$\mathbb{F}^n$, for $n$ fixed, is a *polyhedral complex* if

- the set $\mathcal{F}$ is closed with respect to taking faces and
- if $C,D\in\mathcal{F}$ then $C\cap D$ is a face of both, $C$ and $D$.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- if $C,D\in\mathcal{F}$ then $C\cap D$ is a face of both, $C$ and $D$.
- if $C,D\in\mathcal{F}$ then $C\cap D$ is a face of both $C$ and $D$.

Seems this PR was extracted from PR #889 so I guess some more of the comments I made there apply here (and should probably be addressed here).

Alas, this PR here also is marked as a draft. So I am not sure whether you actually want feedback right now, or not, or what?!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unsure why I am being questioned in this way. I marked both this and #889 as drafts since they are not finished. You are of course free to give feedback, but you might remark on things that we intend to change anyway. I thought marking a PR as draft implies that feedback at this point is not needed yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Lars, sorry, only saw your comment here just now. To be clear: I did not mean to "question" you (like an inquisitor), to the contrary: what I meant was this: I saw the one PR and had some immediate feedback. Then I saw this PR. Then I noticed that they are marked as draft, and now was like "oh, ok, maybe he doesn't even want feedback?!?".

My apologies for very badly communicating this!

@lkastner lkastner marked this pull request as ready for review January 17, 2022 23:40
@lkastner lkastner marked this pull request as draft January 18, 2022 14:15
Previously Polymake.jl did not give an error when the ambient dimension
could not be computed, instead it returned -1.0. This has now changed,
so we can deal with this properly in the show method.
@lkastner lkastner marked this pull request as ready for review January 18, 2022 16:39
@benlorenz benlorenz merged commit ac826e1 into master Jan 18, 2022
@benlorenz benlorenz deleted the lk/polyhedralComplex branch January 18, 2022 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants