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

Make completion resume correctly after interruption #4

Open mkoeppe opened 7 years ago

mkoeppe commented 7 years ago

Currently we have the following when the extremality test is interrupted during the first moves diagram plot:

sage: h = bhk_irrational()
INFO: 2017-06-16 09:02:29,906 Coerced into real number field: Real Number Field in `a` as the root of the defining polynomial y^2 - 2 near 1.414213562373095?
INFO: 2017-06-16 09:02:29,909 Conditions for extremality are satisfied if it is a minimal function.
INFO: 2017-06-16 09:02:29,998 Coerced into real number field: Real Number Field in `a` as the root of the defining polynomial y^2 - 2 near 1.414213562373095?
sage: extremality_test(h, True)
INFO: 2017-06-16 09:02:34,933 pi(0) = 0
INFO: 2017-06-16 09:02:34,954 pi is subadditive.
INFO: 2017-06-16 09:02:34,955 pi is symmetric.
INFO: 2017-06-16 09:02:34,955 Thus pi is minimal.
INFO: 2017-06-16 09:02:34,955 Plotting 2d diagram...
INFO: 2017-06-16 09:02:34,955 Computing maximal additive faces...
INFO: 2017-06-16 09:02:35,110 Computing maximal additive faces... done
Launched png viewer for Graphics object consisting of 382 graphics primitives
INFO: 2017-06-16 09:02:38,268 Plotting 2d diagram... done
INFO: 2017-06-16 09:02:38,409 Plotting...
^C
KeyboardInterrupt
sage: extremality_test(h, True)
INFO: 2017-06-16 09:02:43,345 pi(0) = 0
INFO: 2017-06-16 09:02:43,345 pi is subadditive.
INFO: 2017-06-16 09:02:43,346 pi is symmetric.
INFO: 2017-06-16 09:02:43,346 Thus pi is minimal.
INFO: 2017-06-16 09:02:43,346 Plotting 2d diagram...
Launched png viewer for Graphics object consisting of 382 graphics primitives
INFO: 2017-06-16 09:02:46,514 Plotting 2d diagram... done
INFO: 2017-06-16 09:02:46,515 Plotting covered intervals...
Launched png viewer for Graphics object consisting of 38 graphics primitives
INFO: 2017-06-16 09:02:57,235 Plotting covered intervals... done
INFO: 2017-06-16 09:02:57,235 Uncovered intervals: ([<Int(0.3000000000000000?, 0.3500000000000000?)>, <Int(0.4500000000000000?, 0.50000000000000000?)>],)
INFO: 2017-06-16 09:02:57,362 Total: 9 stability orbits, lengths: ['8', '8', '8', '8', '8', '8', '8', '6', '2']
INFO: 2017-06-16 09:02:57,364 Plotting completion diagram with perturbation...
INFO: 2017-06-16 09:02:57,364 pi(0) = 0
INFO: 2017-06-16 09:02:57,364 pi is subadditive.
INFO: 2017-06-16 09:02:57,364 pi is symmetric.
INFO: 2017-06-16 09:02:57,364 Thus pi is minimal.
INFO: 2017-06-16 09:02:57,365 Uncovered intervals: ([<Int(0.3000000000000000?, 0.3500000000000000?)>, <Int(0.4500000000000000?, 0.50000000000000000?)>],)
INFO: 2017-06-16 09:02:57,367 Finding epsilon interval for perturbation...
INFO: 2017-06-16 09:02:57,371 Zero epsilon encountered for x = 0.1500000000000000?, y = 0.3250000000000000?
---------------------------------------------------------------------------
AssertionError: Epsilon should be positive, something is wrong

This is probably because any_change_moves is cleared too early.