Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIP backends: Unify add_col, add_variable; and clarify defaulting behavior of binary, continuous, integer #20324

Open
mkoeppe opened this issue Mar 30, 2016 · 10 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 30, 2016

add_col and add_variable both add a variable to the problem; but add_col only allows to add a column with no name; whereas add_variable only allows to add a column with no coefficients.
There should be one function (add_variable, probably - see #20296 for a possible interface) that can do both; should then deprecate add_col.
Note that add_col is not used by MixedIntegerLinearProgram; it is only used in doctests of the backends.
Also, GurobiBackend does not implement add_col (this is fixed in #20424).
(Also compare with add_linear_constraint, which takes a zipped index/coefficient list, whereas add_col takes two parallel lists.)

While making this change, should also clarify the defaulting behavior of the binary, continuous, integer arguments of add_variable. The argument list is:

cpdef int add_variable(self, lower_bound=0.0, upper_bound=None, binary=False, continuous=False, integer=False, obj=0.0, name=None)

Whereas the documentation says:

Also #23600 should be fixed: the signatures of the cpdef functions should be the same in all implementations to fix Cython vtable warnings.

CC: @dimpase @nathanncohen @videlec

Component: numerical

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

@mkoeppe mkoeppe added this to the sage-7.2 milestone Mar 30, 2016
@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title MIP backends: Unify add_col, add_variable MIP backends: Unify add_col, add_variable; and clarify defaulting behavior of binary, continuous, integer Apr 5, 2016
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 3, 2016

Dependencies: #20424

@mkoeppe

This comment has been minimized.

@jdemeyer
Copy link
Contributor

Changed dependencies from #20424 to none

@jdemeyer

This comment has been minimized.

@jdemeyer

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants