Opened 9 years ago

Closed 9 years ago

#7333 closed enhancement (fixed)

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

Reported by: ncohen Owned by: tbd
Priority: major Milestone: sage-4.3
Component: packages: optional Keywords:
Cc: Merged in:
Authors: Nathann Cohen Reviewers: Martin Albrecht
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

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 !!!!

Change History (12)

comment:1 Changed 9 years ago by ncohen

  • Status changed from new to needs_review
  • Summary changed from CBC spkg to CBC spkg updated because of modifications in sage.numerical.mip

comment:2 Changed 9 years ago by malb

  • Authors set to Nathann Cohen
  • Report Upstream set to N/A
  • Reviewers set to Martin Albrecht
  • Status changed from needs_review to needs_work

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.

comment:3 Changed 9 years ago by ncohen

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 ?

comment:4 Changed 9 years ago by malb

Yes, alpha1.

comment:5 Changed 9 years ago by ncohen

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

comment:6 Changed 9 years ago by malb

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

comment:7 Changed 9 years ago by malb

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.

comment:8 Changed 9 years ago by ncohen

Yes, sorry for the misunderstanding :-)

comment:9 Changed 9 years ago by malb

  • Status changed from needs_work to needs_review

comment:10 Changed 9 years ago by malb

  • Status changed from needs_review to positive_review

comment:11 Changed 9 years ago by ncohen

Thank you ! :-)

comment:12 Changed 9 years ago by mhansen

  • Resolution set to fixed
  • Status changed from positive_review to closed

Merged in with the optional packages.

Note: See TracTickets for help on using tickets.