-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Count integral points without PALP #11429
Comments
Dependencies: #11312 |
Updated patch |
This comment has been minimized.
This comment has been minimized.
comment:2
Attachment: trac_11429_native_enumeration_of_lattice_polytope_points.patch.gz |
comment:3
The order of points is different from PALP (unsurprisingly), so doctests needed to be fixed. This is done in the last patch. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Reviewer: Andrey Novoseltsev |
Changed keywords from none to sd31 |
comment:6
Regarding the reuse of objects, there was this ticket which may be related/useful: #8702. |
comment:8
Updated patch because of Andrey's documentation changes to #11312. |
comment:9
Hi Volker, Would it make any sense to somehow unite these functions/classes with your PPL wrapper, which already has stuff for inequalities and their systems? Do you know if they (PPL-people) have plans on algorithms for point counts and point listing? There are also functions without documentation or without full description of input/output... |
comment:10
I don't know the PPL future plans, but I don't think that some Cython code would fit into their project. Its also not functionality that fits with their core misson objective, I think. I haven't used the usual standards of documentation for cdef'd functions since they aren't reachable from Python, so you'll never see the help. Nor can you write Python doctests for them. Also, I think documenting input/output is implicit when you have typed arguments. |
comment:11
Line numbers are for the new module in the big patch:
Will look over the second half of the new module in the next few days, I am fine with the rest of the code. Speedwise PALP is still more efficient for small polytopes, but of course only if one can call PALP at once for a lot of them, which is not always possible:
The last line is actually somewhat sad: PALP spends half a second to compute all the points and then Sage spends 3 seconds to read its output and convert into matrices. But hopefully objects of new generations will be more efficient ;-) |
comment:12
There is some overhead to avoid integer overflows and the like, which is a good thing. Possible improvements are
|
comment:13
Updated patch fixes the remaining points of comment:11 |
Attachment: trac_11429_fix_doctests.patch.gz Rebased patch |
comment:14
Last small picks, lines again refer to the new module in the big patch:
|
comment:15
|
comment:16
OK, positive review! With deep apollogies for the duration of "the next few days"... |
comment:18
When running this with Python-2.7.2 (#9958), there is a doctest failure:
Since Python-2.7 will surely be merged in sage-5.0.beta0, you should fix the error message. |
comment:19
By the way: #9958 suggests the error message might be different on 32-bit and 64-bit systems. |
Updated patch |
comment:20
Attachment: trac_11429_cythonize_lattice_points.patch.gz I've modified the doctest to only expect |
Changed reviewer from Andrey Novoseltsev to Andrey Novoseltsev, Jeroen Demeyer |
comment:21
Replying to @vbraun:
I haven't yet tested it, but this should fix the issue. |
Merged: sage-5.0.beta2 |
We want our own code to enumerate lattice points in polyhedra because:
Going through the PALP pexpect interface is annoyingly slow.
no more compile-time bounds
It seems like PALP uses a very unsophisticated algorithm:
takes forever with PALP but only 500ms with my Python code.
Comparing timings, it seems that PALP always runs over the integral points of a rectangular bounding box. This is good for small polytopes (low overhead) but bad for large ones. To match PALP's speed for small polytopes, I implemented the same algorithm in Cython (the second patch) and use it for bounding boxes containing <50k points.
Apply:
Depends on #11312
Depends on #9958
CC: @novoselt @zafeirakopoulos
Component: geometry
Keywords: sd31
Author: Volker Braun
Reviewer: Andrey Novoseltsev, Jeroen Demeyer
Merged: sage-5.0.beta2
Issue created by migration from https://trac.sagemath.org/ticket/11429
The text was updated successfully, but these errors were encountered: