Skip to content

Polyhedron function broken with floats in sage-6.3 (worked in sage-6.2) #17264

@williamstein

Description

@williamstein

If you try to make the convex hull of a set of points given by float coordinates using Polyhedron, this worked fine in Sage-6.2, but is broken in Sage-6.3.

sage: Polyhedron([(0.8370682893845995r, 0.2027977776670088r, 0.2547890063224252r)])
AttributeError: type object 'float' has no attribute 'fraction_field'
sage: Polyhedron([(0.8370682893845995, 0.2027977776670088, 0.2547890063224252)])
A 0-dimensional polyhedron in (Real Field with 54 bits of precision)^3 defined as the convex hull of 1 vertex

I noticed when making this interact:

https://cloud.sagemath.com/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/files/support/2014-10-30-105145-convex-hull-interact.sagews

This is also still broken in sage-6.4.rc0:

/scratch/wstein/sage-6.4.rc0$ ./sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.4.rc0, Release Date: 2014-10-30                     │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: Polyhedron([(0.8370682893845995r, 0.2027977776670088r, 0.2547890063224252r)])
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-69a05f87fbc6> in <module>()
----> 1 Polyhedron([(0.8370682893845995, 0.2027977776670088, 0.2547890063224252)])
 
/scratch/wstein/sage-6.4.rc0/local/lib/python2.7/site-packages/sage/misc/lazy_import.so in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/laz
y_import.c:3230)()
 
/scratch/wstein/sage-6.4.rc0/local/lib/python2.7/site-packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
    703                     kwds[new_name] = kwds[old_name]
    704                     del kwds[old_name]
--> 705             return func(*args, **kwds)
    706
    707         return wrapper
 
/scratch/wstein/sage-6.4.rc0/local/lib/python2.7/site-packages/sage/geometry/polyhedron/constructor.pyc in Polyhedron(vertices, rays, lines, ieqs, eqns, ambient_dim
, base_ring, minimize, verbose, backend)
    444     # Specific backends can override the base_ring
    445     from sage.geometry.polyhedron.parent import Polyhedra
--> 446     parent = Polyhedra(base_ring, ambient_dim, backend=backend)
    447     base_ring = parent.base_ring()
    448
 
/scratch/wstein/sage-6.4.rc0/local/lib/python2.7/site-packages/sage/geometry/polyhedron/parent.pyc in Polyhedra(base_ring, ambient_dim, backend)
     84         return Polyhedra_RDF_cdd(RDF, ambient_dim)
     85     elif backend == 'field':
---> 86         return Polyhedra_field(base_ring.fraction_field(), ambient_dim)
     87     else:
     88         raise ValueError('No such backend (='+str(backend)+
 
AttributeError: type object 'float' has no attribute 'fraction_field'
sage:  

Component: geometry

Keywords: days88

Reviewer: Vincent Delecroix, Jean-Philippe Labbé

Issue created by migration from https://trac.sagemath.org/ticket/17264

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions