#10140: Base sage.geometry.cone on the Parma Polyhedra Library (PPL)
-------------------------------------+--------------------------------------
Reporter: vbraun | Owner: mhampton
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.7
Component: geometry | Keywords: ppl
Author: Volker Braun | Upstream: N/A
Reviewer: Andrey Novoseltsev | Merged:
Work_issues: intersect sublattices |
-------------------------------------+--------------------------------------
Changes (by novoselt):
* status: needs_info => needs_work
* work_issues: => intersect sublattices
Old description:
> As a first useful application of the PPL Cython library interface I have
> changed `sage.geometry.cone.Cone` to use the PPL wrapper instead of
> `cddlib`. Here is a quick benchmark with a fan that was somewhat
> challenging:
> {{{
> sage: from sage.schemes.generic.toric_variety_library import
> toric_varieties_rays_cones
> sage: rays, cones = toric_varieties_rays_cones['BCdlOG']
> sage: timeit('Fan(cones,rays)')
> 5 loops, best of 3: 1.95 s per loop
> }}}
> With the old `Polyhedron`/`cddlib` interface, I got instead
> {{{
> 5 loops, best of 3: 42.1 s per loop
> }}}
>
>
> Depends on #10039: Make Parma Polyhedra Library a standard library
New description:
As a first useful application of the PPL Cython library interface I have
changed `sage.geometry.cone.Cone` to use the PPL wrapper instead of
`cddlib`. Here is a quick benchmark with a fan that was somewhat
challenging:
{{{
sage: from sage.schemes.generic.toric_variety_library import
toric_varieties_rays_cones
sage: rays, cones = toric_varieties_rays_cones['BCdlOG']
sage: timeit('Fan(cones,rays)')
5 loops, best of 3: 1.95 s per loop
}}}
With the old `Polyhedron`/`cddlib` interface, I got instead
{{{
5 loops, best of 3: 42.1 s per loop
}}}
Depends on #10039: Make Parma Polyhedra Library a standard library
'''Apply'''
1. [attachment:trac_10140_base_cone_on_ppl_original.patch]
1. [attachment:trac_10140_reviewer.patch]
--
Comment:
First of all, what I have done with Volker's patches:
1. Folded and rebased them (on top of 3 `FanMorphism` patches as I wanted
to check that nothing breaks, without them there is one fuzzy hunk but it
still applies).
1. Removed doctest fixes related to the ray order as it is restored by
the reviewer patch.
1. Removed the modification to cone-from-polyhedron code since the old
one still works fine and makes all the checks.
1. Left the original of the line mentioned in
http://trac.sagemath.org/sage_trac/ticket/10140#comment:40 since it seems
to be the correct one to me.
The reviewer patch does the following:
1. Preserves ray order for strictly convex cones given by the minimal
generating set of rays, ''without performance penalty.''
1. Removes `self.dual_lattice() is self.lattice()` check as
`dual_lattice` now returns `ZZ^n` if there is no "honest dual". (This was
not the case when this ticket was created.)
1. Modifies the intersection code (discussed above) slightly. This is
'''not''' its final version, I need to play a bit with lattice
intersection but I think it is the way to go.
While I was writing it, I ran tests on top of clean sage-4.7.alpha4 and
there are breaks which seem to be related to `rays[0].parent()` without
`.ambient_module()`. I believe that they are fixed by #10882.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10140#comment:42>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.