Changes between Version 5 and Version 6 of Ticket #20302


Ignore:
Timestamp:
03/30/16 04:50:05 (4 years ago)
Author:
mkoeppe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20302 – Description

    v5 v6  
    55 - `add_variables` and `add_linear_constraints` should have a default implementation in `GenericBackend`, like `add_linear_constraint_vector`.
    66
     7 - The doctest of `add_linear_constraint_vector` from generic_backend.pyx (which is never run for any real backend!), when applied to COIN or GLPK leads to segfaults:
     8{{{
     9sage:             sage: coeffs = ([0, vector([1, 2])], [1, vector([2, 3])])
     10sage:             sage: upper = vector([5, 5])
     11sage:             sage: lower = vector([0, 0])
     12sage:             sage: from sage.numerical.backends.generic_backend import get_solver
     13sage:             sage: p = get_solver(solver = "Coin")                         # optional - cbc
     14sage: p.add_linear_constraint_vector(2, coeffs, lower, upper, 'foo')
     15------------------------------------------------------------------------
     160   signals.so                          0x0000000109df05c5 print_backtrace + 37
     17------------------------------------------------------------------------
     18Unhandled SIGSEGV: A segmentation fault occurred.
     19This probably occurred because a *compiled* module has a bug
     20in it and is not properly wrapped with sig_on(), sig_off().
     21Python will now terminate.
     22------------------------------------------------------------------------
     23Segmentation fault: 11
     24$ sage
     25SageMath Version 7.2.beta0, Release Date: 2016-03-24
     26sage: sage:             sage: coeffs = ([0, vector([1, 2])], [1, vector([2, 3])])
     27sage: sage:             sage: upper = vector([5, 5])
     28sage: sage:             sage: lower = vector([0, 0])
     29sage: sage:             sage: from sage.numerical.backends.generic_backend import get_solver
     30sage: sage:             sage: p = get_solver(solver = "Coin")                         # optional - cbc
     31sage: p.add_linear_constraint_vector(2, coeffs, lower, upper)
     32------------------------------------------------------------------------
     330   signals.so                          0x0000000109c8a5c5 print_backtrace + 37
     34------------------------------------------------------------------------
     35Unhandled SIGSEGV: A segmentation fault occurred.
     36}}}
     37
    738Also, I think the backends should be tested using a common `TestSuite`. Right now each backend uses its own doctests, which have slightly diverged from each other, so there is nothing (other than the fact that they were the result of copy-paste from each other) that ensures consistency. (#20296 fixes several wrong doctests in `GenericBackend`, from which I tried to copy-paste, for example.)