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

CBC spkg updated because of modifications in sage.numerical.mip #7333

Closed
nathanncohen mannequin opened this issue Oct 28, 2009 · 11 comments
Closed

CBC spkg updated because of modifications in sage.numerical.mip #7333

nathanncohen mannequin opened this issue Oct 28, 2009 · 11 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Oct 28, 2009

Since the new version of sage.numerical.mip, which is now in the standard distribution of Sage, the old CBC spkg was not working anymore because of many changes in the structure of class MIP. This patch fixes this, by mainly changing some variables' names to the new ones, and Cythonizing part of the code when it was possible !

The spkg is available in two locations :

Thank you for your help !!!!

Component: packages: optional

Author: Nathann Cohen

Reviewer: Martin Albrecht

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

@nathanncohen nathanncohen mannequin added this to the sage-4.3 milestone Oct 28, 2009
@nathanncohen nathanncohen mannequin changed the title CBC spkg CBC spkg updated because of modifications in sage.numerical.mip Oct 28, 2009
@nathanncohen nathanncohen mannequin added the s: needs review label Oct 28, 2009
@malb
Copy link
Member

malb commented Dec 8, 2009

Author: Nathann Cohen

@malb
Copy link
Member

malb commented Dec 8, 2009

Reviewer: Martin Albrecht

@malb
Copy link
Member

malb commented Dec 8, 2009

comment:2

I get a bunch of --optional doctest errors if only CBC but not GLPK is installed. Most of them are fine (they point out that I need GLPK), but this one isn't:

    sage: p.get_values(x[3]) # optional - requires Glpk or COIN-OR/CBC
Expected:
    2.0
Got:
    0.0

Other than that, it looks fine. I have been using it over the last week or so and cannot report any problems.

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Dec 8, 2009

comment:3

I should have got rid of this before... :p

This is just caused by the fact that the problem that is optimized is symmetric in the two variables x[3] and y. CBC returnd x[3] set to two, and Coin returns the other one to 2, both being good answers :p

But I thought this had been updated... Did you test it on the last alpha version ?

@malb
Copy link
Member

malb commented Dec 8, 2009

comment:4

Yes, alpha1.

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Dec 8, 2009

comment:5

Sorry, then I did not check on the good file. I can not find any occurrence of p.get_values(x[3]) in mip.pyx. Could you tell me which file contains it please ? :-)

I'll fix it immediately after !!!

Nathann

@malb
Copy link
Member

malb commented Dec 8, 2009

comment:6

Line 477:

        EXAMPLE::

            sage: p = MixedIntegerLinearProgram()
            sage: x = p.new_variable()
            sage: y = p.new_variable(dim=2)
            sage: p.set_objective(x[3] + y[2][9] + x[5])
            sage: p.add_constraint(x[3] + y[2][9] + 2*x[5], max=2)
            sage: p.solve() # optional - requires Glpk or COIN-OR/CBC
            2.0
            sage: #
            sage: # Returns the optimal value of x[3]
>>>         sage: p.get_values(x[3]) # optional - requires Glpk or COIN-OR/CBC
            2.0

@malb
Copy link
Member

malb commented Dec 8, 2009

comment:7

Ah, I was talking about vanilla alpha1, while you are probably talking about #7561. Thus it might be fixed already since #7561 is in rc0.

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Dec 8, 2009

comment:8

Yes, sorry for the misunderstanding :-)

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Dec 8, 2009

comment:11

Thank you ! :-)

@mwhansen
Copy link
Contributor

mwhansen commented Dec 9, 2009

comment:12

Merged in with the optional packages.

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