Skip to content
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

py3: fix round issue with cplex and gurobi #27773

Closed
dcoudert opened this issue May 5, 2019 · 9 comments
Closed

py3: fix round issue with cplex and gurobi #27773

dcoudert opened this issue May 5, 2019 · 9 comments

Comments

@dcoudert
Copy link
Contributor

dcoudert commented May 5, 2019

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)()
   1451 
   1452     if value_only:
-> 1453         return Integer(round(p.solve(objective_only=True, log=verbose)))
   1454 
   1455     val = Integer(round(p.solve(log=verbose)))

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

CC: @seblabbe

Component: numerical

Keywords: thursdaysbdx

Author: David Coudert

Branch/Commit: 57b4539

Reviewer: Sébastien Labbé

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

@dcoudert dcoudert added this to the sage-8.8 milestone May 5, 2019
@dcoudert
Copy link
Contributor Author

dcoudert commented May 5, 2019

New commits:

57b4539trac #27773: issue with cplex

@dcoudert
Copy link
Contributor Author

dcoudert commented May 5, 2019

Branch: public/numerical/27773_cplex

@dcoudert
Copy link
Contributor Author

dcoudert commented May 5, 2019

Commit: 57b4539

@dcoudert
Copy link
Contributor Author

dcoudert commented May 5, 2019

comment:2

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

@dcoudert

This comment has been minimized.

@dcoudert dcoudert changed the title py3: fix round issue with cplex py3: fix round issue with cplex and gurobi May 6, 2019
@seblabbe
Copy link
Contributor

Reviewer: Sébastien Labbé

@seblabbe
Copy link
Contributor

Changed keywords from none to thursdaysbdx

@seblabbe
Copy link
Contributor

comment:5

As a remark, I do not have cplex installed, but I confirm it works with Gurobi.

@vbraun
Copy link
Member

vbraun commented May 25, 2019

Changed branch from public/numerical/27773_cplex to 57b4539

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants