Opened 3 months ago

Closed 8 weeks ago

#27773 closed enhancement (fixed)

py3: fix round issue with cplex and gurobi

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

Description (last modified by dcoudert)

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

Change History (6)

comment:1 Changed 3 months ago by dcoudert

  • Branch set to public/numerical/27773_cplex
  • Commit set to 57b4539e2e7ba00298aa5ba3cd92b0fcd47cab0a
  • Status changed from new to needs_review

New commits:

57b4539trac #27773: issue with cplex

comment:2 Changed 3 months ago by dcoudert

  • Description modified (diff)

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

comment:3 Changed 3 months ago by dcoudert

  • Cc slabbe added
  • Summary changed from py3: fix round issue with cplex to py3: fix round issue with cplex and gurobi

comment:4 Changed 2 months ago by slabbe

  • Keywords thursdaysbdx added
  • Reviewers set to Sébastien Labbé
  • Status changed from needs_review to positive_review

comment:5 Changed 2 months ago by slabbe

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

comment:6 Changed 8 weeks ago by vbraun

  • Branch changed from public/numerical/27773_cplex to 57b4539e2e7ba00298aa5ba3cd92b0fcd47cab0a
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.