Opened 7 years ago

Last modified 6 years ago

#20325 closed defect

GenericBackend: Add default implementation of `add_variables` and `add_linear_constraints` — at Version 9

Reported by: Matthias Köppe Owned by:
Priority: major Milestone: sage-7.3
Component: numerical Keywords: lp
Cc: Dima Pasechnik, Vincent Delecroix, Jeroen Demeyer, Frédéric Chapoton, Nils Bruin Merged in:
Authors: Matthias Koeppe Reviewers:
Report Upstream: N/A Work issues:
Branch: u/mkoeppe/genericbackend__add_default_implementation_of__add_variables__and__add_linear_constraints_ (Commits, GitHub, GitLab) Commit: 40876eed69fae9ba7d2ac0440a2fd3b131eef85f
Dependencies: #20323 Stopgaps:

Status badges

Description (last modified by Matthias Köppe)

The backend methods add_variables and add_linear_constraints should have a default implementation in GenericBackend, like add_linear_constraint_vector.

add_variables can be taken from Gurobi and also removed from CVXOPT and InteractiveLP. add_linear_constraints can be taken from COIN and also removed from CVXOPT and InteractiveLP. (The other backends have specific implementations of these methods; one supposes that they are faster, though this probably has not been tested.)

Since the removal of the copy-pasted functions from the backends would remove doctests, I mark this ticket as dependent on #20323.

  • * *

The new tests revealed a bug in the PPL backend, which has been fixed. Also, the CPLEX backend used to add variables in reverse order for no good reason; changed that.

Change History (9)

comment:1 Changed 6 years ago by Matthias Köppe

Dependencies: #20323
Description: modified (diff)

comment:2 Changed 6 years ago by Matthias Köppe

Branch: u/mkoeppe/genericbackend__add_default_implementation_of__add_variables__and__add_linear_constraints_

comment:3 Changed 6 years ago by Matthias Köppe

Commit: 987f6093b9821038074801f8790ceaa406ce4c56
Status: newneeds_review

Last 10 new commits:

f2d52f5CPLEXBackend._test_add_variables: Make test suitable for InteractiveLPBackend
6604442GenericBackend._test_add_linear_constraint_vector: Make test suitable for InteractiveLPBackend
e6ba997GenericBackend._test_solve: Remove again for now; too many failures
c3d2959CVXOPTBackend, InteractiveLPBackend: Remove add_variables implementations, inherit them from GenericBackend
d061abfGenericBackend.add_linear_constraints: New
8b73e2dCoinBackend.add_linear_constraints: Remove, inherit from GenericBackend
16ed7e9CVXOPTBackend.add_linear_constraints: Remove, inherit from GenericBackend
afad991InteractiveLPBackend.add_linear_constraints: Remove, inherit from GenericBackend
941d30bGurobiBackend.add_variables: Remove, inherit from GenericBackend
987f609GenericBackend._test_add_linear_constraints: Add tests from COINBackend, CVXOPTBackend

comment:4 Changed 6 years ago by Matthias Köppe

Authors: Matthias Koeppe

comment:5 Changed 6 years ago by Volker Braun

Status: needs_reviewneeds_work

Falilures in the patch bot

comment:6 Changed 6 years ago by git

Commit: 987f6093b9821038074801f8790ceaa406ce4c5640876eed69fae9ba7d2ac0440a2fd3b131eef85f

Branch pushed to git repo; I updated commit sha1. New commits:

40876eePPLBackend.add_linear_constraints: Fix handling of 'names' argument

comment:7 Changed 6 years ago by Matthias Köppe

Status: needs_workneeds_review

comment:8 Changed 6 years ago by Matthias Köppe

Cc: Jeroen Demeyer Frédéric Chapoton Nils Bruin added; Nathann Cohen removed

comment:9 Changed 6 years ago by Matthias Köppe

Description: modified (diff)
Type: enhancementdefect

Needs review.

Note: See TracTickets for help on using tickets.