Opened 3 years ago

Last modified 3 years ago

#27773 closed enhancement

py3: fix round issue with cplex — at Version 2

Reported by: David Coudert Owned by:
Priority: major Milestone: sage-8.8
Component: numerical Keywords: py3, thursdaysbdx
Cc: Sébastien Labbé Merged in:
Authors: David Coudert Reviewers:
Report Upstream: N/A Work issues:
Branch: public/numerical/27773_cplex (Commits, GitHub, GitLab) Commit: 57b4539e2e7ba00298aa5ba3cd92b0fcd47cab0a
Dependencies: Stopgaps:

Status badges

Description (last modified by David Coudert)

When cplex is installed, the following occur

sage: g = graphs.PetersenGraph()
sage: g.vertex_connectivity()
TypeError                                 Traceback (most recent call last)
<ipython-input-4-8e3aa0688fc2> in <module>()
----> 1 g.vertex_connectivity()

/Users/dcoudert/sage3/sage/local/lib/python3.7/site-packages/sage/graphs/connectivity.pyx in sage.graphs.connectivity.vertex_connectivity (build/cythonized/sage/graphs/connectivity.c:17319)()
   1452     if value_only:
-> 1453         return Integer(round(p.solve(objective_only=True, log=verbose)))
   1455     val = Integer(round(p.solve(log=verbose)))

TypeError: type sage.rings.real_double.RealDoubleElement doesn't define __round__ method

Change History (2)

comment:1 Changed 3 years ago by David Coudert

Branch: public/numerical/27773_cplex
Commit: 57b4539e2e7ba00298aa5ba3cd92b0fcd47cab0a
Status: newneeds_review

New commits:

57b4539trac #27773: issue with cplex

comment:2 Changed 3 years ago by David Coudert

Description: modified (diff)

I tried to put a doctest with sage: round(p.solve()), but it's not using the same round...

Note: See TracTickets for help on using tickets.