#10344: Polyhedron incorrectly handles RR-vertices
----------------------------+-----------------------------------------------
Reporter: novoselt | Owner: mhampton
Type: defect | Status: new
Priority: major | Milestone: sage-5.1
Component: geometry | Resolution:
Keywords: sd40.5 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
----------------------------+-----------------------------------------------
Changes (by novoselt):
* keywords: => sd40.5
Comment:
There is some change in this behaviour:
{{{
sage: Polyhedron(vertices=[vector(RR, [1/2, 3/4]), vector(RR, [4, 5])])
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
/home/novoselt/<ipython console> in <module>()
/home/novoselt/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
685 kwds[new_name] = kwds[old_name]
686 del kwds[old_name]
--> 687 return func(*args, **kwds)
688
689 return wrapper
/home/novoselt/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/geometry/polyhedron/constructor.pyc in Polyhedron(vertices,
rays, lines, ieqs, eqns, base_ring, minimize, verbose, backend)
285 if base_ring is QQ:
286 from backend_ppl import Polyhedron_QQ_ppl
--> 287 return Polyhedron_QQ_ppl(ambient_dim, Vrep, Hrep,
minimize=minimize)
288 elif base_ring is RDF:
289 from backend_cdd import Polyhedron_RDF_cdd
/home/novoselt/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/geometry/polyhedron/base.pyc in __init__(self, ambient_dim,
Vrep, Hrep, **kwds)
124 if len(vertices)==0:
125 vertices = [[0] * ambient_dim]
--> 126 self._init_from_Vrepresentation(ambient_dim, vertices,
rays, lines, **kwds)
127 elif Hrep is not None:
128 ieqs, eqns = Hrep
/home/novoselt/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/geometry/polyhedron/backend_ppl.pyc in
_init_from_Vrepresentation(self, ambient_dim, vertices, rays, lines,
minimize)
70 if vertices is None: vertices = []
71 for v in vertices:
---> 72 d = lcm([denominator(v_i) for v_i in v])
73 dv = [ ZZ(d*v_i) for v_i in v ]
74 gs.insert(point(Linear_Expression(dv, 0), d))
/home/novoselt/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/misc/functional.pyc in denominator(x)
320 if isinstance(x, (int, long)):
321 return 1
--> 322 return x.denominator()
323
324 def det(x):
/home/novoselt/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/structure/element.so in
sage.structure.element.Element.__getattr__
(sage/structure/element.c:2984)()
/home/novoselt/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/structure/parent.so in
sage.structure.parent.getattr_from_other_class
(sage/structure/parent.c:3396)()
AttributeError: 'sage.rings.real_mpfr.RealNumber' object has no attribute
'denominator'
sage:
}}}
Would be nice to have a better error message or handle it - if I replace
RR with RDF there is still an error despite RDF support with `field=RDF`.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10344#comment:1>
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.