Skip to content

GenericBackend: Add default implementation of add_variables and add_linear_constraints #20325

@mkoeppe

Description

@mkoeppe

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.

Depends on #20323

CC: @dimpase @videlec @jdemeyer @fchapoton @nbruin

Component: numerical

Author: Matthias Koeppe

Branch/Commit: 40876ee

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/20325

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions