#20424 closed defect (fixed)
More tests for common MIP TestSuite: add_col, solve; some fixes for backends
Reported by:  mkoeppe  Owned by:  

Priority:  major  Milestone:  sage7.3 
Component:  numerical  Keywords:  lp 
Cc:  dimpase, vdelecroix, jdemeyer, chapoton, nbruin  Merged in:  
Authors:  Matthias Koeppe  Reviewers:  Dima Pasechnik 
Report Upstream:  N/A  Work issues:  
Branch:  97c4542 (Commits)  Commit:  
Dependencies:  #20323,#20600,#20325  Stopgaps: 
Description (last modified by )
Split out from #20323.
This patch adds new _test methods for add_col
, solve
, and for #18572 (but disabled for CVXOPT, where it fails).
To make the new test methods happy,
 implement
add_col
for Gurobi;  fix the implementation of
add_col
for COIN;  fix Gurobi's treatment of unbounded variables;
 fix CPLEX unboundedness detection.
If anyone at all cares about the CVXOPT backend, perhaps they could fix it?
From dimpase:
I recall asking how one deals with different backends producing different, albeit equivalent, outputs. E.g. some of them would even introduce extra variables for some constraints (see e.g. http://trac.sagemath.org/ticket/13148#comment:2). Some backends assign names to constraints automatically.
Change History (23)
comment:1 Changed 5 years ago by
 Cc dimpase vdelecroix added
 Description modified (diff)
comment:2 Changed 5 years ago by
 Branch set to u/mkoeppe/backend_testsuite_failing_tests
comment:3 Changed 5 years ago by
 Commit set to e5e6227255cc92fe61664eeabc4320be35ad6933
comment:4 Changed 5 years ago by
 Commit changed from e5e6227255cc92fe61664eeabc4320be35ad6933 to af1e88518622375bfb46d37070445d42176e5c1a
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
48b9fe5  Change from mutating instance _test methods to class methods

5394729  New method _test_ncols_nonnegative

7138fa0  GenericBackend: Remove failing _test methods from this ticket to make the patchbot and its friends happy

9f4f25c  Revert "GenericBackend: Remove failing _test methods from this ticket to make the patchbot and its friends happy"

8421950  _test_copy: New

3f0578b  _test_copy_does_not_share_data: New

f5b42b8  Test backend.copy() rather than copy(backend)

f21ce7c  test_copy_some_mips: New

21abe28  Add _test_solve_trac_18572 (autogenerated)

af1e885  _test_solve_trac_18572: Replace float integers by integers to make test suitable for PPL backend

comment:5 Changed 5 years ago by
Rebased on top of #20323 branch on top of 7.2.beta4
comment:6 Changed 5 years ago by
 Commit changed from af1e88518622375bfb46d37070445d42176e5c1a to a5a1c6098815a37b69bd4716d83a639ba35a7ba9
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
6d01dc8  Revert "GenericBackend: Remove failing _test methods from this ticket to make the patchbot and its friends happy"

850b817  Add _test_solve_trac_18572 (autogenerated)

a5a1c60  _test_solve_trac_18572: Replace float integers by integers to make test suitable for PPL backend

comment:7 Changed 5 years ago by
Rebased on top of 7.2.beta5. Dropped "Test backend.copy() rather than copy(backend)".
comment:8 Changed 4 years ago by
How do you do test autogeneration (mentioned in 850b817) ?
comment:9 Changed 4 years ago by
comment:10 Changed 4 years ago by
 Commit changed from a5a1c6098815a37b69bd4716d83a639ba35a7ba9 to bb7f5de0594b3381770039003ec763b901f1dc41
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
cc0d326  Revert "GenericBackend: Remove failing _test methods from this ticket to make the patchbot and its friends happy"

6cd0b4a  Add _test_solve_trac_18572 (autogenerated)

492534d  _test_solve_trac_18572: Replace float integers by integers to make test suitable for PPL backend

658972c  Fix doctests when Gurobi is installed

cfaf157  Instead of running MixedIntegerLinearProgram doctests with the default solver, use GLPK

bb7f5de  Merge branch 't/20328/tests_related_to_cplex___gurobi' into t/20424/backend_testsuite_failing_tests

comment:11 Changed 4 years ago by
rebased on 7.2.beta6
comment:12 Changed 4 years ago by
 Commit changed from bb7f5de0594b3381770039003ec763b901f1dc41 to 07c9c5dd48f4911e1f249698c3c13892af4a06f1
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
f0ead34  CPLEXBackend: Use CPXgetstat to properly detect unboundedness

4aeaf9b  GurobiBackend.add_col: Implement

a65f66b  GenericBackend._test_add_col: New

51c2116  GurobiBackend.add_variable: Support coefficients keyword

c2eb25d  GurobiBackend: Fix GRB_INFINITY confusion

6adf3d9  CVXOPTBackend: Don't test _test_solve because of #18572

def61de  Add _test_solve_trac_18572 (autogenerated)

9f287a3  _test_solve_trac_18572: Replace float integers by integers to make test suitable for PPL backend

b60d790  CVXOPTBackend: Disable _test_solve_trac_18572 because of #18572

07c9c5d  GLPKExactBackend: Adjust output

comment:13 Changed 4 years ago by
 Dependencies changed from #20323 to #20323,#20600,#20325
 Status changed from new to needs_review
comment:14 Changed 4 years ago by
 Cc jdemeyer chapoton nbruin added
 Description modified (diff)
 Summary changed from More tests for common MIP TestSuite to More tests for common MIP TestSuite: add_col, solve; some fixes for backends
comment:15 Changed 4 years ago by
 Commit changed from 07c9c5dd48f4911e1f249698c3c13892af4a06f1 to 1ce4eb632f0b86e2802e9bd5cbceab282513fe62
Branch pushed to git repo; I updated commit sha1. New commits:
1ce4eb6  CoinBackend.add_col: Use all coefficients

comment:16 Changed 4 years ago by
 Description modified (diff)
comment:17 followup: ↓ 21 Changed 4 years ago by
 Commit changed from 1ce4eb632f0b86e2802e9bd5cbceab282513fe62 to 97c4542ebaf4585cec9b2a3f56da4d32ab016def
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
e43bdc9  GurobiBackend.add_col: Implement

f42bd1c  GenericBackend._test_add_col: New

d4eccf6  GurobiBackend.add_variable: Support coefficients keyword

e9eb094  GurobiBackend: Fix GRB_INFINITY confusion

bc739f3  CVXOPTBackend: Don't test _test_solve because of #18572

9639a1f  Add _test_solve_trac_18572 (autogenerated)

c2bb379  _test_solve_trac_18572: Replace float integers by integers to make test suitable for PPL backend

0d75d6e  CVXOPTBackend: Disable _test_solve_trac_18572 because of #18572

b2b3031  GLPKExactBackend: Adjust output

97c4542  CoinBackend.add_col: Use all coefficients

comment:18 Changed 4 years ago by
rebased on 7.3.beta5
comment:19 Changed 4 years ago by
 Milestone changed from sage7.2 to sage7.3
 Reviewers set to Dima Pasechnik
 Status changed from needs_review to positive_review
looks good to me
comment:20 Changed 4 years ago by
 Branch changed from u/mkoeppe/backend_testsuite_failing_tests to 97c4542ebaf4585cec9b2a3f56da4d32ab016def
 Resolution set to fixed
 Status changed from positive_review to closed
comment:21 in reply to: ↑ 17 ; followup: ↓ 23 Changed 3 years ago by
 Commit 97c4542ebaf4585cec9b2a3f56da4d32ab016def deleted
Replying to git:
d4eccf6 GurobiBackend.add_variable: Support coefficients keyword
Are there any plans to support this for other backends? I noticed that it's not even documented in add_variable.__doc__
for the Gurobi backend.
The interface between backends should be consistent, so even just raise NotImplementedError("the foo backend does not support the 'coefficients' argument")
in other backends would be good to have. What do you think?
comment:22 Changed 3 years ago by
IMHO different backends might have different features, which might be impossible to have for each backend.
Only if there are multiple backend supporting this, we can think of adding it to the generic backend, with the default implementation as you propose.
Branch is on top of #20323.
Last 10 new commits:
Change from mutating instance _test methods to class methods
New method _test_ncols_nonnegative
GenericBackend: Remove failing _test methods from this ticket to make the patchbot and its friends happy
Revert "GenericBackend: Remove failing _test methods from this ticket to make the patchbot and its friends happy"
_test_copy: New
_test_copy_does_not_share_data: New
Test backend.copy() rather than copy(backend)
test_copy_some_mips: New
Add _test_solve_trac_18572 (autogenerated)
_test_solve_trac_18572: Replace float integers by integers to make test suitable for PPL backend