mkoeppe / cutgeneratingfunctionology

Python code for computation and experimentation with cut-generating functions, in particular the Gomory-Johnson infinite group problem. By M. Köppe, Y. Zhou, C.Y. Hong, J. Wang with contributions by undergrad programmers
GNU General Public License v2.0
12 stars 11 forks source link

problem with limiting_slopes #2

Closed fserra closed 8 years ago

fserra commented 8 years ago

Hi
There seems to be a bug in limiting_slopes:

sage: limiting_slopes(gmic(f=0.66666666))
INFO: 2016-08-01 16:20:58,542 Rational case.
(50000000/33333333, -Infinity)
sage: limiting_slopes(gmic(f=0.666666666))
INFO: 2016-08-01 16:22:48,343 Rational case.
(499999997/333333331, -499999973/166666658)
mkoeppe commented 8 years ago

Try to coerce f to rationals by using QQ(0.66666666). The code is not floating point safe.

On Monday, August 1, 2016, fserra notifications@github.com wrote:

Hi

There seems to be a bug in limiting_slopes:

sage: limiting_slopes(gmic(f=0.66666666)) INFO: 2016-08-01 16:20:58,542 Rational case. (50000000/33333333, -Infinity) sage: limiting_slopes(gmic(f=0.666666666)) INFO: 2016-08-01 16:22:48,343 Rational case. (499999997/333333331, -499999973/166666658)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mkoeppe/infinite-group-relaxation-code/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AH9WhfFFlTPFZiip5Cc8h8pOyWPc6eKeks5qbgGEgaJpZM4JZoxq .

Sent from my phone

fserra commented 8 years ago

great, that solves the issue, thanks!